home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / include / private / qremoteinterface_p.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  5KB  |  163 lines

  1. /****************************************************************************
  2. ** $Id$
  3. **
  4. ** Definition of QRemoteInterface class
  5. **
  6. ** Created : 010301
  7. **
  8. ** Copyright (C) 1992-2001 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
  22. ** licenses may use this file in accordance with the Qt Commercial License
  23. ** Agreement provided with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QREMOTEINTERFACE_P_H
  39. #define QREMOTEINTERFACE_P_H
  40.  
  41. //
  42. //  W A R N I N G
  43. //  -------------
  44. //
  45. // This file is not part of the Qt API.  It exists for the convenience
  46. // of Qt Remote Control. This header file may change from version to
  47. // version without notice, or even be removed.
  48. //
  49. // We mean it.
  50. //
  51. //
  52.  
  53. #ifndef QT_H
  54. #include <private/qcom_p.h>
  55. #endif // QT_H
  56.  
  57. #ifndef QT_NO_REMOTE
  58. #ifndef QT_NO_COMPONENT
  59.  
  60. #include <qobject.h>
  61. class QString;
  62. class QEvent;
  63. class QRemoteClient;
  64. class QPixmap;
  65. class QSocket;
  66.  
  67.  
  68. // {70EC01D4-2AB0-406F-B279-5BC348768C61}
  69. #ifndef IID_QRemoteInterface
  70. #define IID_QRemoteInterface QUuid( 0x70ec01d4, 0x2ab0, 0x406f, 0xb2, 0x79, 0x5b, 0xc3, 0x48, 0x76, 0x8c, 0x61)
  71. #endif
  72.  
  73. // {3AC6E129-654A-4B7E-B1BA-85ECF379E182} 
  74. #ifndef IID_QRemoteFactory
  75. #define IID_QRemoteFactory QUuid( 0x3ac6e129, 0x654a, 0x4b7e, 0xb1, 0xba, 0x85, 0xec, 0xf3, 0x79, 0xe1, 0x82)
  76. #endif
  77.  
  78.  
  79. class Q_EXPORT QRemoteInterface : public QObject// public QUnknownInterface
  80. {
  81.     Q_OBJECT
  82.  
  83. public:
  84. /*!
  85.     Opens a connection to the remote controller (host). The connection is anticipated to
  86.     be a socket connection, hence the parameters \a hostName and \a port.
  87.     QRemoteInterface only defines the interface. The actual connect functionality must be
  88.     implemented in a derived class.
  89. */
  90.     virtual void open(const QString& hostname, int port) = 0;
  91.  
  92. /*!
  93.     Returns TRUE if a connection has been set up to a remote control.
  94. */
  95.     virtual bool isOpen() = 0;
  96.  
  97. /*!
  98.     Closes the connection to the remote controller (host).
  99.     QRemoteInterface only defines the interface. The actual close functionality must be
  100.     implemented in a derived class.
  101. */
  102.     virtual void close() = 0;
  103.  
  104. /*!
  105.     Extends the functionality of QApp::notify() by appending remote functionality.
  106.     Depending on the information provided by \a receiver and msgType \e certain actions
  107.     may be taken.
  108.     The function returns TRUE if the msgType has been handled completely, i.e. doesn't need
  109.     to nor should be handled any more by QApplication::notify() itself.
  110.     QRemoteInterface only defines the interface. The actual handleNotification functionality
  111.     must be implemented in a derived class.
  112. */
  113.     virtual bool handleNotification(QObject *receiver, QEvent * e) = 0;
  114.  
  115. /*!
  116.     Saves a reference to the specified \a receiver.
  117.     The reference can be used to communicate with the remote client code.
  118. */
  119.     virtual void setRemoteClient(QRemoteClient *receiver) = 0;
  120.  
  121. /*!
  122.     Posts (e.g. non blocking) an \a msgType and \a message to the remote controller (host).
  123.     QRemoteInterface only defines the interface. The actual postObject functionality must be
  124.     implemented in a derived class.
  125. */
  126.     virtual void postObject(const QString &msgType, const QString &message) = 0;
  127.  
  128. /*!
  129.     \Overload.
  130.     The additional parameter \a pixmap can be used to transfer a pixmap to the remote
  131.     controller (host).
  132. */
  133.     virtual void postObject(const QString &msgType, const QString &message, const QPixmap *pixmap) = 0;
  134.  
  135. /*!
  136.     Sends (e.g. blocking) an \a msgType, \a message and \a pixmap to the remote controller
  137.     (host) and waits for a \a result. You can use \a timeout to specify the max wait time
  138.     for the reply. If \a timeout == -1 the function waits forever.
  139.     The \a result parameter returns the answer from the receiver of this message.
  140.     QRemoteInterface only defines the interface. The actual sendObject functionality must be
  141.     implemented in a derived class.
  142. */
  143.     virtual bool sendObject(const QString &msgType, const QString &message, const QPixmap *pixmap, QString &result, int timeout = -1) = 0;
  144. };
  145.  
  146.  
  147. class Q_EXPORT QRemoteClient : public QObject
  148. {
  149. public:
  150.     virtual bool execCommand(QByteArray *) { return FALSE;};
  151. };
  152.  
  153.  
  154. struct Q_EXPORT QRemoteFactoryInterface : public QFeatureListInterface
  155. {
  156.     virtual QRemoteInterface* create( const QString& type ) = 0;
  157. };
  158.  
  159. #endif //QT_NO_COMPONENT
  160. #endif //QT_NO_REMOTE
  161.  
  162. #endif //QREMOTEINTERFACE_P_H
  163.