-rw-r--r-- | x11/ipc/client/ocopclient.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/x11/ipc/client/ocopclient.h b/x11/ipc/client/ocopclient.h new file mode 100644 index 0000000..5300132 --- a/dev/null +++ b/x11/ipc/client/ocopclient.h | |||
@@ -0,0 +1,56 @@ | |||
1 | #ifndef OPIE_OCOP_CLIENT_H | ||
2 | #define OPIE_OCOP_CLIENT_H | ||
3 | |||
4 | |||
5 | #include <qobject.h> | ||
6 | #include <qcstring.h> | ||
7 | #include <qmap.h> | ||
8 | #include <qsignal.h> | ||
9 | #include <qstring.h> | ||
10 | #include <qsocketnotifier.h> | ||
11 | |||
12 | |||
13 | /** | ||
14 | * This is the OCOP client | ||
15 | * It currently only supports | ||
16 | * asking if a Channel is registered, | ||
17 | * calling and receiving calls | ||
18 | */ | ||
19 | class OCOPPacket; | ||
20 | class OCOPClient : public QObject{ | ||
21 | Q_OBJECT | ||
22 | public: | ||
23 | |||
24 | /** | ||
25 | * Occasionally I decide to start a Server from here | ||
26 | */ | ||
27 | OCOPClient(const QString& pathToServer = QString::null, QObject* obj = 0l); | ||
28 | ~OCOPClient(); | ||
29 | |||
30 | bool isRegistered( const QCString& )const; | ||
31 | void send( const QCString& chan, const QCString&, const QByteArray& msg ); | ||
32 | |||
33 | /** | ||
34 | * add a channel and does connect to a signal | ||
35 | * callback is the object | ||
36 | * slot is the SLOT() | ||
37 | */ | ||
38 | void addChannel( const QCString& channel ); | ||
39 | void delChannel( const QCString& channel ); | ||
40 | /* no direct signals due the design */ | ||
41 | signals: | ||
42 | void called(const QCString&, const QCString&, const QByteArray ); | ||
43 | private slots: | ||
44 | void init(const QCString& pa); | ||
45 | void newData(); | ||
46 | private: | ||
47 | OCOPPacket packet(); | ||
48 | void call( const OCOPPacket& ); | ||
49 | |||
50 | QSocketNotifier* m_notify; | ||
51 | int m_socket; | ||
52 | private slots: | ||
53 | |||
54 | }; | ||
55 | |||
56 | #endif | ||