-rw-r--r-- | core/launcher/qcopbridge.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/core/launcher/qcopbridge.h b/core/launcher/qcopbridge.h index 408d10d..bae3f88 100644 --- a/core/launcher/qcopbridge.h +++ b/core/launcher/qcopbridge.h | |||
@@ -17,37 +17,43 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef __qcopbridge_h__ | 20 | #ifndef __qcopbridge_h__ |
21 | #define __qcopbridge_h__ | 21 | #define __qcopbridge_h__ |
22 | 22 | ||
23 | #include <qtopia/global.h> | ||
23 | #include <qserversocket.h> | 24 | #include <qserversocket.h> |
24 | #include <qsocket.h> | 25 | #include <qsocket.h> |
25 | #include <qdir.h> | 26 | #include <qdir.h> |
26 | #include <qfile.h> | 27 | #include <qfile.h> |
27 | #include <qbuffer.h> | 28 | #include <qbuffer.h> |
28 | 29 | ||
29 | class QFileInfo; | 30 | class QFileInfo; |
30 | class QCopBridgePI; | 31 | class QCopBridgePI; |
31 | class QCopChannel; | 32 | class QCopChannel; |
33 | class QTimer; | ||
32 | 34 | ||
33 | class QCopBridge : public QServerSocket | 35 | class QCopBridge : public QServerSocket |
34 | { | 36 | { |
35 | Q_OBJECT | 37 | Q_OBJECT |
36 | 38 | ||
37 | public: | 39 | public: |
38 | QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); | 40 | QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); |
39 | virtual ~QCopBridge(); | 41 | virtual ~QCopBridge(); |
40 | 42 | ||
41 | void newConnection( int socket ); | 43 | void newConnection( int socket ); |
42 | void closeOpenConnections(); | 44 | void closeOpenConnections(); |
45 | void authorizeConnections(); | ||
43 | 46 | ||
44 | public slots: | 47 | public slots: |
45 | void connectionClosed( QCopBridgePI *pi ); | 48 | void closed( QCopBridgePI *pi ); |
46 | void desktopMessage( const QCString &call, const QByteArray & ); | 49 | void desktopMessage( const QCString &call, const QByteArray & ); |
47 | 50 | ||
51 | signals: | ||
52 | void connectionClosed( const QHostAddress & ); | ||
53 | |||
48 | protected: | 54 | protected: |
49 | void timerEvent( QTimerEvent * ); | 55 | void timerEvent( QTimerEvent * ); |
50 | 56 | ||
51 | private: | 57 | private: |
52 | QCopChannel *desktopChannel; | 58 | QCopChannel *desktopChannel; |
53 | QCopChannel *cardChannel; | 59 | QCopChannel *cardChannel; |
@@ -64,29 +70,28 @@ class QCopBridgePI : public QSocket | |||
64 | 70 | ||
65 | public: | 71 | public: |
66 | QCopBridgePI( int socket, QObject *parent = 0, const char* name = 0 ); | 72 | QCopBridgePI( int socket, QObject *parent = 0, const char* name = 0 ); |
67 | virtual ~QCopBridgePI(); | 73 | virtual ~QCopBridgePI(); |
68 | 74 | ||
69 | void sendDesktopMessage( const QString &msg ); | 75 | void sendDesktopMessage( const QString &msg ); |
76 | void sendDesktopMessage( const QCString &msg, const QByteArray& ); | ||
70 | void startSync() { sendSync = TRUE; } | 77 | void startSync() { sendSync = TRUE; } |
78 | bool verifyAuthorised(); | ||
71 | 79 | ||
72 | signals: | 80 | signals: |
73 | void connectionClosed( QCopBridgePI *); | 81 | void connectionClosed( QCopBridgePI *); |
74 | 82 | ||
75 | protected slots: | 83 | protected slots: |
76 | void read(); | 84 | void read(); |
77 | void send( const QString& msg ); | 85 | void send( const QString& msg ); |
78 | void process( const QString& command ); | 86 | void process( const QString& command ); |
79 | void connectionClosed(); | 87 | void myConnectionClosed(); |
80 | |||
81 | protected: | ||
82 | void timerEvent( QTimerEvent *e ); | ||
83 | 88 | ||
84 | private: | 89 | private: |
85 | State state; | 90 | State state; |
86 | Q_UINT16 peerport; | 91 | Q_UINT16 peerport; |
87 | QHostAddress peeraddress; | 92 | QHostAddress peeraddress; |
88 | bool connected; | ||
89 | bool sendSync; | 93 | bool sendSync; |
94 | QTimer *timer; | ||
90 | }; | 95 | }; |
91 | 96 | ||
92 | #endif | 97 | #endif |