-rw-r--r-- | core/launcher/qcopbridge.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/launcher/qcopbridge.h b/core/launcher/qcopbridge.h index bae3f88..9483d9d 100644 --- a/core/launcher/qcopbridge.h +++ b/core/launcher/qcopbridge.h | |||
@@ -1,97 +1,100 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
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 <qtopia/global.h> |
24 | #include <qserversocket.h> | 24 | #include <qserversocket.h> |
25 | #include <qsocket.h> | 25 | #include <qsocket.h> |
26 | #include <qdir.h> | 26 | #include <qdir.h> |
27 | #include <qfile.h> | 27 | #include <qfile.h> |
28 | #include <qbuffer.h> | 28 | #include <qbuffer.h> |
29 | 29 | ||
30 | class QFileInfo; | 30 | class QFileInfo; |
31 | class QCopBridgePI; | 31 | class QCopBridgePI; |
32 | class QCopChannel; | 32 | class QCopChannel; |
33 | class QTimer; | 33 | class QTimer; |
34 | 34 | ||
35 | class QCopBridge : public QServerSocket | 35 | class QCopBridge : public QServerSocket |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | 38 | ||
39 | public: | 39 | public: |
40 | enum Mode { Qtopia1_7= 0x01, Sharp = 0x02, Both = Qtopia1_7 | Sharp }; | ||
40 | QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); | 41 | QCopBridge( Q_UINT16 port, QObject *parent = 0, const char* name = 0 ); |
41 | virtual ~QCopBridge(); | 42 | virtual ~QCopBridge(); |
42 | 43 | ||
43 | void newConnection( int socket ); | 44 | void newConnection( int socket ); |
44 | void closeOpenConnections(); | 45 | void closeOpenConnections(); |
45 | void authorizeConnections(); | 46 | void authorizeConnections(); |
46 | 47 | ||
47 | public slots: | 48 | public slots: |
48 | void closed( QCopBridgePI *pi ); | 49 | void closed( QCopBridgePI *pi ); |
49 | void desktopMessage( const QCString &call, const QByteArray & ); | 50 | void desktopMessage( const QCString &call, const QByteArray & ); |
50 | 51 | ||
51 | signals: | 52 | signals: |
52 | void connectionClosed( const QHostAddress & ); | 53 | void connectionClosed( const QHostAddress & ); |
53 | 54 | ||
54 | protected: | 55 | protected: |
55 | void timerEvent( QTimerEvent * ); | 56 | void timerEvent( QTimerEvent * ); |
57 | void sendDesktopMessageOld( const QCString&, const QByteArray& ); | ||
56 | 58 | ||
57 | private: | 59 | private: |
58 | QCopChannel *desktopChannel; | 60 | QCopChannel *desktopChannel; |
59 | QCopChannel *cardChannel; | 61 | QCopChannel *cardChannel; |
60 | QList<QCopBridgePI> openConnections; | 62 | QList<QCopBridgePI> openConnections; |
61 | bool sendSync; | 63 | bool sendSync; |
64 | Mode m_mode; | ||
62 | }; | 65 | }; |
63 | 66 | ||
64 | 67 | ||
65 | class QCopBridgePI : public QSocket | 68 | class QCopBridgePI : public QSocket |
66 | { | 69 | { |
67 | Q_OBJECT | 70 | Q_OBJECT |
68 | 71 | ||
69 | enum State { Connected, Wait_USER, Wait_PASS, Ready, Forbidden }; | 72 | enum State { Connected, Wait_USER, Wait_PASS, Ready, Forbidden }; |
70 | 73 | ||
71 | public: | 74 | public: |
72 | QCopBridgePI( int socket, QObject *parent = 0, const char* name = 0 ); | 75 | QCopBridgePI( int socket, QObject *parent = 0, const char* name = 0 ); |
73 | virtual ~QCopBridgePI(); | 76 | virtual ~QCopBridgePI(); |
74 | 77 | ||
75 | void sendDesktopMessage( const QString &msg ); | 78 | void sendDesktopMessage( const QString &msg ); |
76 | void sendDesktopMessage( const QCString &msg, const QByteArray& ); | 79 | void sendDesktopMessage( const QCString &msg, const QByteArray& ); |
77 | void startSync() { sendSync = TRUE; } | 80 | void startSync() { sendSync = TRUE; } |
78 | bool verifyAuthorised(); | 81 | bool verifyAuthorised(); |
79 | 82 | ||
80 | signals: | 83 | signals: |
81 | void connectionClosed( QCopBridgePI *); | 84 | void connectionClosed( QCopBridgePI *); |
82 | 85 | ||
83 | protected slots: | 86 | protected slots: |
84 | void read(); | 87 | void read(); |
85 | void send( const QString& msg ); | 88 | void send( const QString& msg ); |
86 | void process( const QString& command ); | 89 | void process( const QString& command ); |
87 | void myConnectionClosed(); | 90 | void myConnectionClosed(); |
88 | 91 | ||
89 | private: | 92 | private: |
90 | State state; | 93 | State state; |
91 | Q_UINT16 peerport; | 94 | Q_UINT16 peerport; |
92 | QHostAddress peeraddress; | 95 | QHostAddress peeraddress; |
93 | bool sendSync; | 96 | bool sendSync; |
94 | QTimer *timer; | 97 | QTimer *timer; |
95 | }; | 98 | }; |
96 | 99 | ||
97 | #endif | 100 | #endif |