summaryrefslogtreecommitdiff
path: root/x11/ipc/common/ocoppacket.h
authorzecke <zecke>2002-10-01 14:27:17 (UTC)
committer zecke <zecke>2002-10-01 14:27:17 (UTC)
commitbba0335bbea81519beafb7fec1979a0abbd8a7ea (patch) (unidiff)
treeee334cf518c59582a36a3dd24238a05dfc3535a2 /x11/ipc/common/ocoppacket.h
parentef8d0a15d706b0e230f052efcb1eab6f905a8737 (diff)
downloadopie-bba0335bbea81519beafb7fec1979a0abbd8a7ea.zip
opie-bba0335bbea81519beafb7fec1979a0abbd8a7ea.tar.gz
opie-bba0335bbea81519beafb7fec1979a0abbd8a7ea.tar.bz2
5th try
initial checkin of X11 Opie stuff it features an IPC Server the client is todo this will become the OPIE X11 department including alternative QPEApplication, QCOP replacement
Diffstat (limited to 'x11/ipc/common/ocoppacket.h') (more/less context) (ignore whitespace changes)
-rw-r--r--x11/ipc/common/ocoppacket.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/x11/ipc/common/ocoppacket.h b/x11/ipc/common/ocoppacket.h
new file mode 100644
index 0000000..490ff03
--- a/dev/null
+++ b/x11/ipc/common/ocoppacket.h
@@ -0,0 +1,64 @@
1/* GPL!*/
2
3#ifndef OPIE_OCOP_PACKET_H
4#define OPIE_OCOP_PACKET_H
5
6#include <qcstring.h>
7#include <qstring.h>
8
9/**
10 * This is the head which will be sent
11 * in advance to every packet
12 */
13struct OCOPHead {
14 int magic;
15 int type;
16 int chlen;
17 int funclen;
18 int datalen;
19};
20
21/**
22 * This is the basic packet we will
23 * use for the communication between server
24 * and client
25 */
26class OCOPPacket {
27public:
28 enum Type {
29 Register = 0, Unregister, Call,
30 Method, Reply, RegisterChannel,
31 UnregisterChannel, Return, Signal,
32 IsRegistered
33 };
34 /**
35 * the c'tor
36 * type the Type of this packet
37 * the Channel
38 * the header of the function
39 * the data inside a QByteArray
40 */
41 OCOPPacket( int type, const QCString& channel = QCString(),
42 const QCString& header = QCString(),
43 const QByteArray& array = QByteArray() );
44
45 QByteArray toByteArray()const;
46 int type()const;
47 QCString channel()const;
48 QCString header()const;
49 QByteArray content()const;
50 OCOPHead head()const;
51
52 void setType( int type );
53 void setChannel( const QCString& );
54 void setHeader(const QCString& );
55 void setContent( const QByteArray& );
56
57private:
58 int m_type;
59 QCString m_channel;
60 QCString m_header;
61 QByteArray m_content;
62};
63
64#endif