home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iddetsrv.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.9 KB  |  185 lines

  1. #ifndef _IDDETSRV_
  2. #define _IDDETSRV_
  3. /*******************************************************************************
  4. * FILE NAME: iddetsrv.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IDDETopicServer                                                          *
  9. *                                                                              *
  10. * COPYRIGHT:                                                                   *
  11. *   IBM Open Class Library                                                     *
  12. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  13. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  14. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  15. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  16. *                                                                              *
  17. *******************************************************************************/
  18. #include <istring.hpp>
  19. #include <ihandler.hpp>
  20. #include <ihandle.hpp>
  21. #include <iddeevt.hpp>
  22.  
  23. class IObjectWindow;
  24. class IFrameWindow;
  25. class IThread;
  26. class IDDEServerConversationSet;
  27. class IDDEServerHotLinkItemSet;
  28. class IDDEFormatSet;
  29. class IDDETopicServerData;
  30.  
  31.   class IDDEItemAtomSet;
  32.  
  33. #pragma pack(4)
  34.  
  35.  
  36. class IDDETopicServer : protected IHandler {
  37. typedef IHandler
  38.   Inherited;
  39. public:
  40. /*------------------------------- Constructors -------------------------------*/
  41.   IDDETopicServer ( const char*   applicationName,
  42.                     const char*   supportedTopic,
  43.                     IFrameWindow* owner = 0,
  44.                     Boolean       useEventThread = true );
  45.  
  46. virtual
  47.  ~IDDETopicServer ( );
  48.  
  49. /*------------------- Conversation Initiation/Termination --------------------*/
  50. virtual IDDETopicServer
  51.  &beginConversation ( const IWindowHandle& clientHandle ),
  52.  &endConversation   ( unsigned long conversationId );
  53.  
  54. /*----------------------------- Hot Link Updates -----------------------------*/
  55. unsigned long
  56.   hotLinkUpdate ( const char* item );
  57.  
  58. /*---------------------------- Server Attributes -----------------------------*/
  59. unsigned long
  60.   conversationCount ( ) const,
  61.   hotLinkCount      ( ) const;
  62.  
  63. IString
  64.   application ( ) const,
  65.   topic       ( ) const;
  66.  
  67. IWindowHandle
  68.   serverHandle ( ) const;
  69.  
  70. protected:
  71. /*----------------------------- Event Processing -----------------------------*/
  72. virtual Boolean
  73.   requestData        ( unsigned long           conversationId,
  74.                        IDDERequestDataEvent&   event ) = 0,
  75.   pokeData           ( unsigned long           conversationId,
  76.                        IDDEPokeEvent&          event ),
  77.   beginHotLink       ( unsigned long           conversationId,
  78.                        IDDEServerHotLinkEvent& event ),
  79.   executeCommands    ( unsigned long           conversationId,
  80.                        IDDEExecuteEvent&       event ),
  81.   acceptConversation ( unsigned long           conversationId,
  82.                        IDDEBeginEvent&         event );
  83.  
  84. virtual void
  85.   requestHotLinkData  ( IDDERequestDataEvent&       event ),
  86.   hotLinkEnded        ( unsigned long               conversationId,
  87.                         IDDEEvent&                  event ),
  88.   acknowledged        ( unsigned long               conversationId,
  89.                         IDDEServerAcknowledgeEvent& event ),
  90.   conversationEnded   ( unsigned long               conversationId,
  91.                         IDDEEndEvent&               event );
  92.  
  93. /*--------------------- Event Processing Implementation ----------------------*/
  94. virtual Boolean
  95.   dispatchHandlerEvent ( IEvent& event );
  96.  
  97. virtual void
  98.   handleAck       ( const IEvent& ackEvent ),
  99.   handleAdvise    ( const IEvent& adviseEvent ),
  100.   handleExecute   ( const IEvent& executeEvent ),
  101.   handleInitiate  ( const IEvent& initiateEvent ),
  102.   handlePoke      ( const IEvent& pokeEvent ),
  103.   handleRequest   ( const IEvent& requestEvent ),
  104.   handleTerminate ( const IEvent& terminateEvent ),
  105.   handleUnadvise  ( const IEvent& unadviseEvent );
  106.  
  107. virtual Boolean
  108.   removeLink ( IString       item,
  109.                IString       format,
  110.                unsigned long conversationId );
  111.  
  112. private:
  113. /*------------------------------ Hidden Members ------------------------------*/
  114.   IDDETopicServer ( const IDDETopicServer& server );
  115. IDDETopicServer
  116.  &operator=( const IDDETopicServer& server );
  117.  
  118. /*--------------------------------- Private ----------------------------------*/
  119. IDDEServerHotLinkItemSet
  120.  &hotLinkItems ( ) const;
  121. IDDEServerConversationSet
  122.  &closedConversations ( ) const,
  123.  &conversations       ( ) const;
  124. IDDEFormatSet
  125.  &formats ( ) const;
  126.  
  127. IDDEItemAtomSet
  128.  &itemAtoms ( ) const;
  129.  
  130. unsigned long
  131.   queueHandle ( ) const;
  132.  
  133. void
  134.   dispatchEventFromQueue ( );
  135.  
  136. void
  137.  *buildDDEStruct ( int            ddeStructType,
  138.                    const char*    dataFormat,
  139.                    unsigned short status,
  140.                    const void*    xferData,
  141.                    unsigned long  dataLength );
  142.  
  143. unsigned long
  144.  ulClQHandle,
  145.  ulClSemaphore;
  146. IThread
  147.  *pThreadCl;
  148. Boolean
  149.   fClHdrActive,
  150.   fClPostMsgFail;
  151. IWindowHandle
  152.   wndhClServer;
  153. IObjectWindow
  154.  *pwndClServer;
  155. IString
  156.   strClTopic,
  157.   strClApplication;
  158. IDDEServerConversationSet
  159.  *pConvSetCl;
  160. IDDEServerHotLinkItemSet
  161.  *pHLItemSetCl;
  162. IDDEServerConversationSet
  163.  *pClsdConvSetCl;
  164. IDDEFormatSet
  165.  *pFormatSetCl;
  166.  
  167. IDDEItemAtomSet
  168.  *pItemAtomSetCl;
  169.  
  170. void
  171.  *hReadPipe,
  172.  *hWritePipe,
  173.  *hFinish;
  174.  
  175. IDDETopicServerData
  176.  *fDDETopicServerData;
  177. }; // IDDETopicServer
  178.  
  179.  
  180. #pragma pack()
  181.  
  182.   #include <iddetsrv.inl>
  183.  
  184. #endif /* _IDDETSRV_ */
  185.