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

  1. #ifndef _IDDECCNV_
  2. #define _IDDECCNV_
  3. /*******************************************************************************
  4. * FILE NAME: iddeccnv.hpp                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IDDEClientConversation                                                   *
  9. *                                                                              *
  10. *   NOTE:  IDDEActiveServer, IDDEActiveServerSet and IDDEClientHotLinkSet      *
  11. *          are defined in iddecset.hpp.                                        *
  12. *                                                                              *
  13. * COPYRIGHT:                                                                   *
  14. *   IBM Open Class Library                                                     *
  15. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  16. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  17. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  18. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  19. *                                                                              *
  20. *******************************************************************************/
  21. #include <istring.hpp>
  22. #include <ihandle.hpp>
  23. #include <ihandler.hpp>
  24. #include <iddeevt.hpp>
  25. #include <iddecomm.hpp>
  26.  
  27. class IObjectWindow;
  28. class IDDEClosedConversationSet;
  29. class IDDETransactionQueue;
  30. class IDDEActiveServerSet;
  31. class IDDEClientHotLinkSet;
  32. class IDDEFormatSet;
  33. class IThread;
  34. class IDDEClientConversationData;
  35.  
  36.   class IDDEItemAtomSet;
  37.  
  38. #pragma pack(4)
  39.  
  40.  
  41. class IDDEClientConversation : protected IHandler {
  42. typedef IHandler
  43.   Inherited;
  44. public:
  45. /*------------------------------- Constructors -------------------------------*/
  46.   IDDEClientConversation ( Boolean     useEventThread = true );
  47.   IDDEClientConversation ( const char* applicationName,
  48.                            const char* topicName,
  49.                            Boolean     useEventThread = true );
  50.  
  51. virtual
  52.  ~IDDEClientConversation ( );
  53.  
  54. /*------------------- Conversation Initiation/Termination --------------------*/
  55. virtual Boolean
  56.   begin ( const char* applicationName,
  57.           const char* topicName );
  58.  
  59. virtual IDDEClientConversation
  60.  &begin ( const IWindowHandle& serverHandle ),
  61.  &end   ( );
  62.  
  63. /*------------------------------- Transactions -------------------------------*/
  64. virtual IDDEClientConversation
  65.  &requestData     ( const char*   item,
  66.                     IDDE::Format  format = IDDE::textFormat ),
  67.  &pokeData        ( const char*   item,
  68.                     const void*   data,
  69.                     unsigned long dataLength,
  70.                     IDDE::Format  format = IDDE::textFormat ),
  71.  &beginHotLink    ( const char*   item,
  72.                     IDDE::Format  format = IDDE::textFormat,
  73.                     Boolean       sendData = true,
  74.                     Boolean       pacing = false ),
  75.  &endHotLink      ( const char*   item,
  76.                     IDDE::Format  format = IDDE::textFormat ),
  77.  &endHotLinks     ( const char*   item = 0),
  78.  &executeCommands ( const void*   commands,
  79.                     unsigned long commandLength );
  80.  
  81. /*------------------------- Conversation Attributes ---------------------------*/
  82. IString
  83.   application ( ) const,
  84.   topic       ( ) const;
  85.  
  86. Boolean
  87.   isCaseSensitive ( ) const,
  88.   inConversation  ( ) const;
  89.  
  90. unsigned long
  91.   outstandingTransactionCount ( ) const;
  92.  
  93. IWindowHandle
  94.   clientHandle ( ) const;
  95.  
  96. /*--------------------------- Hot Link Information ---------------------------*/
  97. IDDEClientConversation
  98.  &hotLinks ( IDDEClientHotLinkSet& hotLinkSet );
  99.  
  100. unsigned long
  101.   hotLinkCount ( ) const;
  102.  
  103. /*-------------------------------- Broadcasts --------------------------------*/
  104. virtual IDDEClientConversation
  105.  &supportedTopics        ( IDDEActiveServerSet& activeServerSet,
  106.                            const char* applicationName = 0 ),
  107.  &supportingApplications ( IDDEActiveServerSet& activeServerSet,
  108.                            const char* topicName );
  109.  
  110. protected:
  111. /*----------------------------- Event Processing -----------------------------*/
  112. virtual Boolean
  113.   data           ( IDDEDataEvent&          event) = 0,
  114.   hotLinkInform  ( IDDEClientHotLinkEvent& event);
  115.  
  116. virtual void
  117.   acknowledged        ( IDDEClientAcknowledgeEvent&  event ),
  118.   executeAcknowledged ( IDDEAcknowledgeExecuteEvent& event ),
  119.   pokeAcknowledged    ( IDDEAcknowledgePokeEvent&    event ),
  120.   conversationEnded   ( IDDEClientEndEvent&          event );
  121.  
  122. /*--------------------- Event Processing Implementation ----------------------*/
  123. virtual Boolean
  124.   dispatchHandlerEvent ( IEvent& event );
  125.  
  126. virtual void
  127.   handleAck         ( const IEvent& ackEvent ),
  128.   handleData        ( const IEvent& dataEvent ),
  129.   handleInitiateAck ( const IEvent& initiateAckEvent ),
  130.   handleTerminate   ( const IEvent& terminateEvent );
  131.  
  132. /*----------------------- Miscellaneous Implementation -----------------------*/
  133. virtual void
  134.   endAllHotLinks ( const char* item ),
  135.   endAllHotLinks ( );
  136.  
  137. virtual Boolean
  138.   findTransaction ( const IEvent& event,
  139.                     Boolean       removeMatch = false );
  140.  
  141. private:
  142. /*------------------------------ Hidden Members ------------------------------*/
  143.   IDDEClientConversation  ( const IDDEClientConversation& conversation );
  144. IDDEClientConversation
  145.  &operator=               ( const IDDEClientConversation& conversation );
  146.  
  147. /*--------------------------------- Private ----------------------------------*/
  148. IWindowHandle
  149.   serverHandle ( ) const;
  150. IDDEClientHotLinkSet
  151.  &hotLinksForUpdate ( ) const;
  152. IDDEClosedConversationSet
  153.  &closedConversations ( ) const;
  154. IDDETransactionQueue
  155.  &transactions ( ) const;
  156. IDDEFormatSet
  157.  &formats ( ) const;
  158.  
  159. IDDEItemAtomSet
  160.  &itemAtoms ( ) const;
  161.  
  162. unsigned long
  163.   queueHandle ( ) const;
  164. void
  165.   dispatchEventFromQueue ( );
  166.  
  167. void
  168.  *buildDDEStruct ( int            ddeStructType,
  169.                    const char*    dataFormat,
  170.                    unsigned short status,
  171.                    const void*    xferData,
  172.                    unsigned long  dataLength );
  173.  
  174. unsigned long
  175.  ulClQHandle,
  176.  ulClSemaphore;
  177. IThread
  178.  *pThreadCl;
  179. IWindowHandle
  180.   wndhClServer,
  181.   wndhClClient;
  182. IObjectWindow
  183.  *pwndClClient;
  184. Boolean
  185.   fClBrdcstInPrgrs,
  186.   fClHdrActive,
  187.   fClPostMsgFail,
  188.   fClCaseSensitive;
  189. IString
  190.   strClTopic,
  191.   strClApplication;
  192. IDDEActiveServerSet
  193.  *pActServSetCl;
  194. IDDEClosedConversationSet
  195.  *pClsdConvSetCl;
  196. IDDEClientHotLinkSet
  197.  *pHLSetCl;
  198. IDDETransactionQueue
  199.  *pTransQCl;
  200. IDDEFormatSet
  201.  *pFormatSetCl;
  202.  
  203. IDDEItemAtomSet
  204.  *pItemAtomSetCl;
  205.  
  206. void
  207.  *hReadPipe,
  208.  *hWritePipe,
  209.  *hFinish;
  210.  
  211. IDDEClientConversationData
  212.  *fDDEClientConversationData;
  213. }; // IDDEClientConversation
  214.  
  215.  
  216. #pragma pack()
  217.  
  218.   #include <iddeccnv.inl>
  219.  
  220. #endif /* _IDDECCNV_ */
  221.