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

  1. #ifndef _IDDEEVT_
  2. #define _IDDEEVT_
  3. /*******************************************************************************
  4. * FILE NAME: iddeevt.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IDDEEvent                                                                *
  9. *     IDDEAcknowledgeEvent                                                     *
  10. *     IDDESetAcknowledgeInfoEvent                                              *
  11. *     IDDEClientAcknowledgeEvent                                               *
  12. *     IDDEServerAcknowledgeEvent                                               *
  13. *     IDDEAcknowledgePokeEvent                                                 *
  14. *     IDDEAcknowledgeExecuteEvent                                              *
  15. *     IDDEDataEvent                                                            *
  16. *     IDDEClientHotLinkEvent                                                   *
  17. *     IDDERequestDataEvent                                                     *
  18. *     IDDEPokeEvent                                                            *
  19. *     IDDEServerHotLinkEvent                                                   *
  20. *     IDDEExecuteEvent                                                         *
  21. *     IDDEEndEvent                                                             *
  22. *     IDDEClientEndEvent                                                       *
  23. *     IDDEBeginEvent                                                           *
  24. *                                                                              *
  25. * COPYRIGHT:                                                                   *
  26. *   IBM Open Class Library                                                     *
  27. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  28. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  29. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  30. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  31. *                                                                              *
  32. *******************************************************************************/
  33. #include <istring.hpp>
  34. #include <ievent.hpp>
  35.  
  36. class IDDEClientConversation;
  37. class IDDETopicServer;
  38. class IDDEEventData;
  39.  
  40. #pragma pack(4)
  41.  
  42.  
  43. class IDDEEvent : protected IEvent {
  44. typedef IEvent
  45.   Inherited;
  46. public:
  47. /*------------------------------- Constructors -------------------------------*/
  48.   IDDEEvent ( const IEvent&    ddeEvent );
  49.   IDDEEvent ( const IDDEEvent& ddeEvent );
  50.  
  51.  ~IDDEEvent ( );
  52.  
  53. /*----------------------------- Event Attributes -----------------------------*/
  54. IString
  55.   item   ( ) const,
  56.   format ( ) const;
  57.  
  58. protected:
  59. /*------------------------------ Implementation ------------------------------*/
  60. IDDEEvent
  61.  &setStatus ( unsigned short status ),
  62.  &setBuffer ( IString        dataBuffer );
  63.  
  64. unsigned short
  65.   status ( ) const;
  66.  
  67. IString
  68.   buffer ( ) const;
  69.  
  70. private:
  71. /*--------------------------------- Private ----------------------------------*/
  72. friend class IDDEClientConversation;
  73. friend class IDDETopicServer;
  74.  
  75. IDDEEvent
  76.  &setFormat ( IString format );
  77.  
  78. // new private members for Win32
  79. void
  80.   loadItem   ( ),
  81.   loadFormat ( ),
  82.   loadStatus ( ),
  83.   loadBuffer ( );
  84.  
  85. unsigned short
  86.   usClStatus;
  87. IString
  88.   strClItem,
  89.   strClFormat,
  90.   strClData;
  91.  
  92. IDDEEventData
  93.  *fDDEEventData;
  94. }; // IDDEEvent
  95.  
  96. class IDDEAcknowledgeEvent : public IDDEEvent {
  97. typedef IDDEEvent
  98.   Inherited;
  99. public:
  100. /*------------------------------- Constructors -------------------------------*/
  101.   IDDEAcknowledgeEvent ( const IEvent& ddeEvent );
  102.  
  103.  ~IDDEAcknowledgeEvent ( );
  104.  
  105. /*----------------------------- Event Attributes -----------------------------*/
  106. Boolean
  107.   isApplicationBusy   ( ) const,
  108.   isAckPositive       ( ) const,
  109.   isMessageUnderstood ( ) const;
  110.  
  111. unsigned char
  112.   applicationSpecificData ( ) const;
  113.  
  114. protected:
  115. /*----------------------------- Transaction Type -----------------------------*/
  116. unsigned short
  117.   transactionType ( ) const;
  118.  
  119. private:
  120. /*--------------------------------- Private ----------------------------------*/
  121. friend class IDDEClientConversation;
  122. friend class IDDETopicServer;
  123.  
  124. }; // IDDEAcknowledgeEvent
  125.  
  126. class IDDESetAcknowledgeInfoEvent : public IDDEEvent {
  127. typedef IDDEEvent
  128.   Inherited;
  129. public:
  130. /*------------------------------- Constructors -------------------------------*/
  131.   IDDESetAcknowledgeInfoEvent ( const IEvent&                      ddeEvent );
  132.   IDDESetAcknowledgeInfoEvent ( const IDDESetAcknowledgeInfoEvent& ddeEvent );
  133.  
  134.  ~IDDESetAcknowledgeInfoEvent ( );
  135.  
  136. /*----------------------------- Event Attributes -----------------------------*/
  137. IDDESetAcknowledgeInfoEvent
  138.  &setApplicationBusy         ( ),
  139.  &setMessageNotUnderstood    ( ),
  140.  &setApplicationSpecificData ( unsigned char applicationData );
  141.  
  142. }; // IDDESetAcknowledgeInfoEvent
  143.  
  144. class IDDEClientAcknowledgeEvent : public IDDEAcknowledgeEvent {
  145. typedef IDDEAcknowledgeEvent
  146.   Inherited;
  147. public:
  148. /*------------------------------- Constructors -------------------------------*/
  149.   IDDEClientAcknowledgeEvent ( const IEvent& ddeEvent );
  150.  
  151.  ~IDDEClientAcknowledgeEvent ( );
  152.  
  153. /*----------------------------- Event Attributes -----------------------------*/
  154. Boolean
  155.   isAckToRequestData  ( ) const,
  156.   isAckToBeginHotLink ( ) const,
  157.   isAckToEndHotLink   ( ) const;
  158.  
  159. }; // IDDEClientAcknowledgeEvent
  160.  
  161. class IDDEServerAcknowledgeEvent : public IDDEAcknowledgeEvent {
  162. typedef IDDEAcknowledgeEvent
  163.   Inherited;
  164. public:
  165. /*------------------------------- Constructors -------------------------------*/
  166.   IDDEServerAcknowledgeEvent ( const IEvent& ddeEvent );
  167.  
  168.  ~IDDEServerAcknowledgeEvent ( );
  169.  
  170. /*----------------------------- Event Attributes -----------------------------*/
  171. Boolean
  172.   isAckToHotLinkUpdate ( ) const;
  173.  
  174. IString
  175.   data ( ) const;
  176.  
  177. }; // IDDEServerAcknowledgeEvent
  178.  
  179. class IDDEAcknowledgePokeEvent : public IDDEAcknowledgeEvent {
  180. typedef IDDEAcknowledgeEvent
  181.   Inherited;
  182. public:
  183. /*------------------------------- Constructors -------------------------------*/
  184.   IDDEAcknowledgePokeEvent ( const IEvent& ddeEvent );
  185.  
  186.  ~IDDEAcknowledgePokeEvent ( );
  187.  
  188. /*-------------------------------- Poked Data --------------------------------*/
  189. IString
  190.   pokedData ( ) const;
  191.  
  192. }; // IDDEAcknowledgePokeEvent
  193.  
  194. class IDDEAcknowledgeExecuteEvent : public IDDEAcknowledgeEvent {
  195. typedef IDDEAcknowledgeEvent
  196.   Inherited;
  197. public:
  198. /*------------------------------- Constructors -------------------------------*/
  199.   IDDEAcknowledgeExecuteEvent ( const IEvent& ddeEvent );
  200.  
  201.  ~IDDEAcknowledgeExecuteEvent ( );
  202.  
  203. /*------------------------------ Command String ------------------------------*/
  204. IString
  205.   commands ( ) const;
  206.  
  207. }; // IDDEAcknowledgeExecuteEvent
  208.  
  209. class IDDEDataEvent : public IDDESetAcknowledgeInfoEvent {
  210. typedef IDDESetAcknowledgeInfoEvent
  211.   Inherited;
  212. public:
  213. /*------------------------------- Constructors -------------------------------*/
  214.   IDDEDataEvent ( const IEvent& ddeEvent );
  215.  
  216.  ~IDDEDataEvent ( );
  217.  
  218. /*----------------------------- Event Attributes -----------------------------*/
  219. IString
  220.   data ( ) const;
  221.  
  222. Boolean
  223.   isAckRequested    ( ) const,
  224.   isDataFromHotLink ( ) const;
  225.  
  226. }; // IDDEDataEvent
  227.  
  228. class IDDEClientHotLinkEvent : public IDDESetAcknowledgeInfoEvent {
  229. typedef IDDESetAcknowledgeInfoEvent
  230.   Inherited;
  231. public:
  232. /*------------------------------- Constructors -------------------------------*/
  233.   IDDEClientHotLinkEvent ( const IEvent&                 ddeEvent );
  234.   IDDEClientHotLinkEvent ( const IDDEClientHotLinkEvent& ddeEvent );
  235.  
  236.  ~IDDEClientHotLinkEvent ( );
  237.  
  238. /*----------------------------- Event Attributes -----------------------------*/
  239. Boolean
  240.   isAckRequested  ( ) const,
  241.   isDataRequested ( ) const;
  242.  
  243. }; // IDDEClientHotLinkEvent
  244.  
  245. class IDDERequestDataEvent : public IDDESetAcknowledgeInfoEvent {
  246. typedef IDDESetAcknowledgeInfoEvent
  247.   Inherited;
  248. public:
  249. /*------------------------------- Constructors -------------------------------*/
  250.   IDDERequestDataEvent ( const IEvent& ddeEvent );
  251.  
  252.  ~IDDERequestDataEvent ( );
  253.  
  254. /*----------------------------- Event Attributes -----------------------------*/
  255. IDDERequestDataEvent
  256.  &requestAck ( ),
  257.  &setData    ( const char*   dataString ),
  258.  &setData    ( const void*   dataBuffer,
  259.                unsigned long dataLength );
  260.  
  261. }; // IDDERequestDataEvent
  262.  
  263. class IDDEPokeEvent : public IDDESetAcknowledgeInfoEvent {
  264. typedef IDDESetAcknowledgeInfoEvent
  265.   Inherited;
  266. public:
  267. /*------------------------------- Constructors -------------------------------*/
  268.   IDDEPokeEvent ( const IEvent& ddeEvent );
  269.  
  270.  ~IDDEPokeEvent ( );
  271.  
  272. /*-------------------------------- Poked Data --------------------------------*/
  273. IString
  274.   pokedData ( ) const;
  275.  
  276. }; // IDDEPokeEvent
  277.  
  278. class IDDEExecuteEvent : public IDDESetAcknowledgeInfoEvent {
  279. typedef IDDESetAcknowledgeInfoEvent
  280.   Inherited;
  281. public:
  282. /*------------------------------- Constructors -------------------------------*/
  283.   IDDEExecuteEvent ( const IEvent& ddeEvent );
  284.  
  285.  ~IDDEExecuteEvent ( );
  286.  
  287. /*------------------------------ Command String ------------------------------*/
  288. IString
  289.   commands ( ) const;
  290.  
  291. }; // IDDEExecuteEvent
  292.  
  293. class IDDEServerHotLinkEvent : public IDDESetAcknowledgeInfoEvent {
  294. typedef IDDESetAcknowledgeInfoEvent
  295.   Inherited;
  296. public:
  297. /*------------------------------- Constructors -------------------------------*/
  298.   IDDEServerHotLinkEvent ( const IEvent& ddeEvent );
  299.  
  300.  ~IDDEServerHotLinkEvent ( );
  301.  
  302. /*----------------------------- Event Attributes -----------------------------*/
  303. Boolean
  304.   isPacingRequested ( ) const,
  305.   isDataRequested   ( ) const;
  306.  
  307. }; // IDDEServerHotLinkEvent
  308.  
  309. class IDDEEndEvent : protected IEvent {
  310. typedef IEvent
  311.   Inherited;
  312. public:
  313. /*---------------------------- Termination Source ----------------------------*/
  314. enum Source { client, server, error };
  315.  
  316. Source
  317.   sourceOfEnd ( ) const;
  318.  
  319. /*------------------------------- Constructors -------------------------------*/
  320.   IDDEEndEvent ( const IEvent& ddeEvent,
  321.                  Source        endSource );
  322.  
  323.  ~IDDEEndEvent ( );
  324.  
  325. private:
  326. /*--------------------------------- Private ----------------------------------*/
  327. Source
  328.   sourceCl;
  329.  
  330. }; // IDDEEndEvent
  331.  
  332. class IDDEClientEndEvent : public IDDEEndEvent {
  333. typedef IDDEEndEvent
  334.   Inherited;
  335. public:
  336. /*------------------------------- Constructors -------------------------------*/
  337.   IDDEClientEndEvent ( const IEvent&  ddeEvent,
  338.                        Source         endSource,
  339.                        IString        application,
  340.                        IString        topic );
  341.  
  342.  ~IDDEClientEndEvent ( );
  343.  
  344. /*----------------------------- Event Attributes -----------------------------*/
  345. IString
  346.   application ( ) const,
  347.   topic       ( ) const;
  348.  
  349. private:
  350. /*--------------------------------- Private ----------------------------------*/
  351. IString
  352.   strClApp,
  353.   strClTopic;
  354.  
  355. }; // IDDEClientEndEvent
  356.  
  357. class IDDEBeginEvent : protected IEvent {
  358. typedef IEvent
  359.   Inherited;
  360. public:
  361. /*------------------------------- Constructors -------------------------------*/
  362.   IDDEBeginEvent ( const IEvent& ddeBeginEvent );
  363.  
  364.  ~IDDEBeginEvent ( );
  365.  
  366. /*----------------------------- Event Attributes -----------------------------*/
  367. IString
  368.   application ( ) const,
  369.   topic       ( ) const;
  370.  
  371. IDDEBeginEvent
  372.  &setCaseSensitive ( Boolean caseSensitive );
  373.  
  374. private:
  375. /*----------------------------- Hidden Functions -----------------------------*/
  376.   IDDEBeginEvent ( const IDDEBeginEvent& event );
  377. IDDEBeginEvent&
  378.   operator=      ( const IDDEBeginEvent& event );
  379.  
  380. /*--------------------------------- Private ----------------------------------*/
  381. friend class IDDEClientConversation;
  382. friend class IDDETopicServer;
  383.  
  384. Boolean
  385.   isCaseSensitive ( ) const;
  386.  
  387. IString
  388.   strClApp,
  389.   strClTopic;
  390. Boolean
  391.   bClCaseSens;
  392.  
  393. }; // IDDEBeginEvent
  394.  
  395.  
  396. #pragma pack()
  397.  
  398.   #include <iddeevt.inl>
  399.  
  400. #endif /* _IDDEEVT_ */
  401.