nxcl @VERSION@
nxcl.h
Go to the documentation of this file.
1/* -*-c++-*- */
2/***************************************************************************
3 nxcl: The NXCL dbus daemon.
4 -------------------
5 begin : June 2007
6 copyright : (C) 2007 Embedded Software Foundry Ltd. (U.K.)
7 : Author: Sebastian James
8 email : seb@esfnet.co.uk
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
27#ifndef _NXCL_H_
28#define _NXCL_H_ 1
29
30#include "nxdata.h"
31#include "../lib/nxclientlib.h"
32
33/* This define is required for slightly older versions of dbus as
34 * found, for example, in Ubuntu 6.06. */
35#define DBUS_API_SUBJECT_TO_CHANGE 1
36extern "C" {
37#include <dbus/dbus.h>
38}
39
40using namespace std;
41
42namespace nxcl
43{
44
46 {
47 public:
48 NxclBase() {}
49 virtual ~NxclBase() {}
50
51 virtual void haveResumableSessions (list<NXResumeData> resumeData) {}
52 virtual void noResumableSessions (void) {}
53 virtual void serverCapacityReached (void) {}
54 virtual void sendDbusInfoMsg (string&) {}
55 virtual void sendDbusInfoMsg (int, string&) {}
56 virtual void sendDbusErrorMsg (string&) {}
57 };
58
60 {
61 public:
64
71 void write (string msg);
85 void write (int num, string msg);
89 void error (string msg);
94 void debug (string msg);
103 void stdoutSignal (string msg);
108 void stderrSignal (string msg);
114 void stdinSignal (string msg);
120 void resumeSessionsSignal (list<NXResumeData> resumeData);
127 void noSessionsSignal (void);
138
142 void setParent (NxclBase * p) { this->parent = p; }
143 private:
144 NxclBase * parent;
145
146 };
147
148 class Nxcl : public NxclBase
149 {
150 public:
151 Nxcl();
152 Nxcl(int n);
153 ~Nxcl();
154
155 // Public Methods
168 void setupDbus (void);
176 void setupDbus (int id);
188 int receiveSettings (void);
202
203 // Accessors
205 NXClientLib* getNXClientLib (void) { return &(this->nxclientlib); }
207
208 // Public Slots
210
213 void haveResumableSessions (list<NXResumeData> resumable);
227 void requestConfirmation (string msg);
237 void sendDbusInfoMsg (string& info);
244 void sendDbusInfoMsg (int num, string& info);
248 void sendDbusErrorMsg (string& errorMsg);
250
255
256 private:
262 void initiate (void);
276 void sendResumeList (list<NXResumeData>& resumable);
287 void receiveStartInstruction (void);
288
293 NXClientLib nxclientlib;
299 NXSessionData sessionData;
303 DBusConnection *conn;
307 DBusError error;
312 int dbusNum;
316 string dbusName;
320 string dbusMatch;
324 string dbusMatchInterface;
328 string dbusSendInterface;
333 string nxuser;
338 string nxpass;
343 string nxserver;
348 int nxport;
352 int xRes;
356 int yRes;
360 int displayDepth;
361 };
362
363} // namespace
364
365#endif // ifndef _NXCL_H_
void setParent(NxclBase *p)
Definition: nxcl.h:142
void debug(string msg)
void noSessionsSignal(void)
void serverCapacitySignal(void)
void stdinSignal(string msg)
void stdoutSignal(string msg)
void stderrSignal(string msg)
void resumeSessionsSignal(list< NXResumeData > resumeData)
void write(string msg)
void error(string msg)
void write(int num, string msg)
NxclCallbacks callbacks
Definition: nxcl.h:254
void sendDbusErrorMsg(string &errorMsg)
void setSessionDefaults(void)
Set default values for.
void startTheNXConnection(void)
Configure the.
void sendDbusInfoMsg(int num, string &info)
void haveResumableSessions(list< NXResumeData > resumable)
void setupDbus(int id)
Sets dbusNum to be.
void setupDbus(void)
Sets up a connection to the dbus daemon, based on the member attribute.
int receiveSettings(void)
Wait for a dbus message containing session settings.
void sendDbusInfoMsg(string &info)
void noResumableSessions(void)
void requestConfirmation(string msg)
void serverCapacityReached(void)