home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / IBMCLASS / IDDEEVT.HPP < prev    next >
C/C++ Source or Header  |  1993-10-22  |  46KB  |  801 lines

  1. #ifndef _IDDEEVT_
  2. #define _IDDEEVT_
  3. /*******************************************************************************
  4. * FILE NAME: iddeevt.hpp                                                       *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the class(es):                                              *
  8. *     IDDEEvent                   - Base DDE event class.                      *
  9. *     IDDEAcknowledgeEvent        - Base DDE acknowledgement class.            *
  10. *     IDDESetAcknowledgeInfoEvent - Base class for all events that need to set *
  11. *                                   acknowledgement information.               *
  12. *     IDDEClientAcknowledgeEvent  - Information for acknowledgements from a    *
  13. *                                   server to requestData(), beginHotLink()    *
  14. *                                   and endHotLink() requests.                 *
  15. *     IDDEServerAcknowledgeEvent  - Information for acknowledgements from a    *
  16. *                                   client.                                    *
  17. *     IDDEAcknowledgePokeEvent    - Information for acknowledgements from a    *
  18. *                                   server to pokeData() requests.             *
  19. *     IDDEAcknowledgeExecuteEvent - Information for acknowledgements from a    *
  20. *                                   server to executeCommands() requests.      *
  21. *     IDDEDataEvent               - Information and data from a server in      *
  22. *                                   response to requestData() requests and as  *
  23. *                                   a result of beginHotLink() requests.       *
  24. *     IDDEClientHotLinkEvent      - Information from a server as a result of   *
  25. *                                   beginHotLink() requests.                   *
  26. *     IDDERequestDataEvent        - Information for requestData() requests     *
  27. *                                   from a client.                             *
  28. *     IDDEPokeEvent               - Information for pokeData() requests from   *
  29. *                                   a client.                                  *
  30. *     IDDEServerHotLinkEvent      - Information for beginHotLink() requests    *
  31. *                                   from a client.                             *
  32. *     IDDEExecuteEvent            - Information for executeCommands() requests *
  33. *                                   from a client.                             *
  34. *     IDDEEndEvent                - Base DDE end conversation event class.     *
  35. *     IDDEClientEndEvent          - Information for a client about the ending  *
  36. *                                   of a conversation.                         *
  37. *     IDDEBeginEvent              - Information for a server about             *
  38. *                                   beginConversation() requests.              *
  39. *                                                                              *
  40. * COPYRIGHT:                                                                   *
  41. *   Licensed Materials - Property of IBM                                       *
  42. *   (C) Copyright IBM Corporation 1992, 1993                                   *
  43. *   All Rights Reserved                                                        *
  44. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  45. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  46. *                                                                              *
  47. *******************************************************************************/
  48. #ifndef _ISTRING_
  49.   #include <istring.hpp>
  50. #endif
  51. #ifndef _IEVENT_
  52.   #include <ievent.hpp>
  53. #endif
  54.  
  55. /*----------------------------------------------------------------------------*/
  56. /* Align classes on four byte boundary.                                       */
  57. /*----------------------------------------------------------------------------*/
  58. #pragma pack(4)
  59.  
  60. // Forward declarations for other classes:
  61. class IDDEClientConversation;
  62. class IDDETopicServer;
  63.  
  64. class IDDEEvent : protected IEvent {
  65. typedef IEvent
  66.   Inherited;
  67. /*******************************************************************************
  68. * IDDEEvent is the base class for most dynamic data exchange (DDE) event       *
  69. * classes.                                                                     *
  70. *                                                                              *
  71. * An instance of this class, or one of its subclasses, is created when an      *
  72. * instance of IDDEClientConversation or IDDETopicServer needs to pass          *
  73. * information to the client or server application.  Instances of this class    *
  74. * are not intended to be created by application programmers.                   *
  75. *******************************************************************************/
  76. public:
  77. /*---------------------- Constructor -------------------------------------------
  78. | Instances of this class are created from an IEvent.                          |
  79. ------------------------------------------------------------------------------*/
  80.   IDDEEvent  ( const IEvent&    ddeEvent );
  81.   IDDEEvent  ( const IDDEEvent& ddeEvent );
  82.  
  83.   ~IDDEEvent ( );
  84.  
  85. /*-------------------------------- Accessors -----------------------------------
  86. | Use the following functions to get the accessible attributes of instances    |
  87. | of this class:                                                               |
  88. |   item   - Returns the name of the item.                                     |
  89. |   format - Returns the name of the format.                                   |
  90. ------------------------------------------------------------------------------*/
  91. IString
  92.   item   ( ) const,
  93.   format ( ) const;
  94.  
  95. protected:
  96. /*------------------------------ Implementation --------------------------------
  97. | The following functions allow a subclass to get and set the accessible       |
  98. | attributes of instances of this class:                                       |
  99. |   setStatus - Sets the status field of the event.                            |
  100. |   setBuffer - Sets the data into the data buffer.                            |
  101. |   status    - Returns the status of the event.                               |
  102. |   buffer    - Returns the data buffer.                                       |
  103. |               NOTE:  The buffer function's IString is constructed from a     |
  104. |                      void* and length.  For character strings, if the        |
  105. |                      terminating NULL was included in the length, it will    |
  106. |                      be in the buffer.  Before performing string             |
  107. |                      operations such as concatenation on this string,        |
  108. |                      strip any trailing NULL. (See IString::stripTrailing.)  |
  109. ------------------------------------------------------------------------------*/
  110. IDDEEvent
  111.  &setStatus ( unsigned short status ),
  112.  &setBuffer ( IString        dataBuffer );
  113.  
  114. unsigned short
  115.   status ( ) const;
  116.  
  117. IString
  118.   buffer ( ) const;
  119.  
  120. private:
  121. /*--------------------------------- PRIVATE ----------------------------------*/
  122. friend class IDDEClientConversation;
  123. friend class IDDETopicServer;
  124.  
  125. IDDEEvent
  126.  &setFormat ( IString format );
  127.  
  128. unsigned short
  129.   usClStatus;
  130. IString
  131.   strClItem,
  132.   strClFormat,
  133.   strClData;
  134.  
  135. }; // IDDEEvent
  136.  
  137. class IDDEAcknowledgeEvent : public IDDEEvent {
  138. typedef IDDEEvent
  139.   Inherited;
  140. /*******************************************************************************
  141. * The IDDEAcknowledgeEvent class is the base class for the dynamic data        *
  142. * exchange (DDE) acknowledge event information classes.                        *
  143. *                                                                              *
  144. * An instance of this class or one of its subclasses is created when an        *
  145. * instance of IDDEClientConversation or IDDETopicServer needs to pass          *
  146. * acknowledgement information to the client or server application.             *
  147. * Instances of this class are not intended to be created by application        *
  148. * programmers.                                                                 *
  149. *******************************************************************************/
  150. public:
  151. /*------------------- Constructor ----------------------------------------------
  152. | Instances of this class are created from an IEvent.                          |
  153. ------------------------------------------------------------------------------*/
  154.   IDDEAcknowledgeEvent  ( const IEvent& ddeEvent );
  155.  
  156.   ~IDDEAcknowledgeEvent ( );
  157.  
  158. /*-------------------------------- Accessors -----------------------------------
  159. | Use the following functions to get the accessible attributes of instances    |
  160. | of this class:                                                               |
  161. |   isApplicationBusy       - Returns true if the application busy flag is on; |
  162. |                             otherwise, it returns false. This will only be   |
  163. |                             set for a negative acknowledgement.              |
  164. |   isAckPositive           - Returns true if the acknowledgement is positive; |
  165. |                             otherwise, it returns false.                     |
  166. |   isMessageUnderstood     - Returns false if the message not understood flag |
  167. |                             is on; otherwise, it returns true.  This is      |
  168. |                             only set for a negative acknowledgement.         |
  169. |   applicationSpecificData - Returns any application-specific data that has   |
  170. |                             been provided by the conversing application.     |
  171. ------------------------------------------------------------------------------*/
  172. Boolean
  173.   isApplicationBusy   ( ) const,
  174.   isAckPositive       ( ) const,
  175.   isMessageUnderstood ( ) const;
  176.  
  177. unsigned char
  178.   applicationSpecificData ( ) const;
  179.  
  180. protected:
  181. /*------------------------------ Implementation --------------------------------
  182. | The following function allows a subclass to get the accessible attribute     |
  183. | of instances of this class:                                                  |
  184. |   transactionType - Returns the event ID.                                    |
  185. ------------------------------------------------------------------------------*/
  186. unsigned short
  187.   transactionType ( ) const;
  188.  
  189. private:
  190. /*--------------------------------- PRIVATE ----------------------------------*/
  191. friend class IDDEClientConversation;
  192. friend class IDDETopicServer;
  193.  
  194. }; // IDDEAcknowledgeEvent
  195.  
  196. class IDDESetAcknowledgeInfoEvent : public IDDEEvent {
  197. typedef IDDEEvent
  198.   Inherited;
  199. /*******************************************************************************
  200. * The IDDESetAcknowledgeInfoEvent class is the base class for dynamic data     *
  201. * exchange (DDE) event information classes that need to set acknowledgement    *
  202. * information.                                                                 *
  203. *                                                                              *
  204. * An instance of a subclass of IDDESetAcknowledgeInfoEvent is only created     *
  205. * for events that the application can respond to with a negative               *
  206. * acknowledgement.  Instances of this class are not typically created and are  *
  207. * not intended to be created by application programmers.                       *
  208. *******************************************************************************/
  209. public:
  210. /*------------------- Constructor ----------------------------------------------
  211. | Instances of this class are created from an IEvent.                          |
  212. ------------------------------------------------------------------------------*/
  213.   IDDESetAcknowledgeInfoEvent  ( const IEvent&                      ddeEvent );
  214.   IDDESetAcknowledgeInfoEvent  ( const IDDESetAcknowledgeInfoEvent& ddeEvent );
  215.  
  216.   ~IDDESetAcknowledgeInfoEvent ( );
  217.  
  218. /*-------------------------------- Accessors -----------------------------------
  219. | Use the following functions to set the accessible attributes of instances    |
  220. | of this class:                                                               |
  221. |   setApplicationBusy         - Sets the application busy flag.  This is      |
  222. |                                used by a client or server application to     |
  223. |                                indicate why a request or response to a       |
  224. |                                request cannot be processed.                  |
  225. |   setMessageNotUnderstood    - Sets the message not understood flag.  This   |
  226. |                                is used by a client or server application to  |
  227. |                                indicate why a request or response to a       |
  228. |                                request cannot be processed.                  |
  229. |   setApplicationSpecificData - Sets application-specific information.  This  |
  230. |                                can be used when a client and server          |
  231. |                                application have a pre-defined protocol for   |
  232. |                                exchanging information.                       |
  233. ------------------------------------------------------------------------------*/
  234. IDDESetAcknowledgeInfoEvent
  235.  &setApplicationBusy         ( ),
  236.  &setMessageNotUnderstood    ( ),
  237.  &setApplicationSpecificData ( unsigned char applicationData );
  238.  
  239. }; // IDDESetAcknowledgeInfoEvent
  240.  
  241. class IDDEClientAcknowledgeEvent : public IDDEAcknowledgeEvent {
  242. typedef IDDEAcknowledgeEvent
  243.   Inherited;
  244. /*******************************************************************************
  245. * The IDDEClientAcknowledgeEvent class provides event information to a         *
  246. * client application regarding an acknowledgement from a server.               *
  247. *                                                                              *
  248. * An instance of this class or one of its subclasses is created when an        *
  249. * instance of IDDEClientConversation needs to pass information about an        *
  250. * acknowledgement to the client application.  Instances of this class are not  *
  251. * intended to be created by application programmers.                           *
  252. *******************************************************************************/
  253. public:
  254. /*------------------------- Constructor ----------------------------------------
  255. | Instances of this class are created from an IEvent.                          |
  256. ------------------------------------------------------------------------------*/
  257.   IDDEClientAcknowledgeEvent  ( const IEvent& ddeEvent );
  258.  
  259.   ~IDDEClientAcknowledgeEvent ( );
  260.  
  261. /*-------------------------------- Accessors -----------------------------------
  262. | Use the following functions to get the accessible attributes of instances    |
  263. | of this class:                                                               |
  264. |   isAckToRequestData  - Returns true if the acknowledgement is in response   |
  265. |                         to requestData being invoked; otherwise, it returns  |
  266. |                         false.                                               |
  267. |   isAckToBeginHotLink - Returns true if the acknowledgement is in response   |
  268. |                         to beginHotLink being invoked; otherwise, it         |
  269. |                         returns false.                                       |
  270. |   isAckToEndHotLink   - Returns true if the acknowledgement is in response   |
  271. |                         to endHotLink being invoked; otherwise, it returns   |
  272. |                         false.                                               |
  273. ------------------------------------------------------------------------------*/
  274. Boolean
  275.   isAckToRequestData  ( ) const,
  276.   isAckToBeginHotLink ( ) const,
  277.   isAckToEndHotLink   ( ) const;
  278.  
  279. }; // IDDEClientAcknowledgeEvent
  280.  
  281. class IDDEServerAcknowledgeEvent : public IDDEAcknowledgeEvent {
  282. typedef IDDEAcknowledgeEvent
  283.   Inherited;
  284. /*******************************************************************************
  285. * The IDDEServerAcknowledgeEvent class provides event information to a         *
  286. * server application regarding an acknowledgement from a client.               *
  287. *                                                                              *
  288. * An instance of this class is created when an instance of IDDETopicServer     *
  289. * needs to pass information about an acknowledgement to the server             *
  290. * application.  Instances of this class are not intended to be created by      *
  291. * application programmers.                                                     *
  292. *******************************************************************************/
  293. public:
  294. /*---------------------- Constructor -------------------------------------------
  295. | Instances of this class are created from an IEvent.                          |
  296. ------------------------------------------------------------------------------*/
  297.   IDDEServerAcknowledgeEvent  ( const IEvent& ddeEvent );
  298.  
  299.   ~IDDEServerAcknowledgeEvent ( );
  300.  
  301. /*-------------------------------- Accessors -----------------------------------
  302. | Use the following functions to get the accessible attributes                 |
  303. | of instances of this class:                                                  |
  304. |   isAckToHotLinkUpdate - Returns true if the acknowledgement is in response  |
  305. |                          to a hotLinkUpdate being invoked.  It returns       |
  306. |                          false if it is in response to data being provided   |
  307. |                          for a requestData request.                          |
  308. |   data                 - Returns the data the server provided to the client. |
  309. |                          NOTE:  The data function's IString is constructed   |
  310. |                                 from a void* and length.  For character      |
  311. |                                 strings, if the terminating NULL was         |
  312. |                                 included in the length, it will be in the    |
  313. |                                 buffer.  Before performing string            |
  314. |                                 operations such as concatenation on this     |
  315. |                                 string, strip any trailing NULL.             |
  316. |                                 (See IString::stripTrailing.)                |
  317. ------------------------------------------------------------------------------*/
  318. Boolean
  319.   isAckToHotLinkUpdate ( ) const;
  320.  
  321. IString
  322.   data ( ) const;
  323.  
  324. }; // IDDEServerAcknowledgeEvent
  325.  
  326. class IDDEAcknowledgePokeEvent : public IDDEClientAcknowledgeEvent {
  327. typedef IDDEClientAcknowledgeEvent
  328.   Inherited;
  329. /*******************************************************************************
  330. * The IDDEAcknowledgePokeEvent class provides event information to a client    *
  331. * application regarding an acknowledgement to a pokeData request.              *
  332. *                                                                              *
  333. * An instance of this class is created when an instance of                     *
  334. * IDDEClientConversation needs to pass information to the client application   *
  335. * about an acknowledgement resulting from a pokeData request.  Instances of    *
  336. * this class are not intended to be created by application programmers.        *
  337. *******************************************************************************/
  338. public:
  339. /*-------------------- Constructor --------------------------------------------
  340. | Instances of this class are created from an IEvent.                          |
  341. ------------------------------------------------------------------------------*/
  342.   IDDEAcknowledgePokeEvent  ( const IEvent& ddeEvent );
  343.  
  344.   ~IDDEAcknowledgePokeEvent ( );
  345.  
  346. /*-------------------------------- Accessor ------------------------------------
  347. | Use the following function to get the accessible attribute of instances of   |
  348. | this class:                                                                  |
  349. |   pokedData - Returns the data that the client asked the server application  |
  350. |               to set.                                                        |
  351. |               NOTE:  The pokedData function's IString is constructed from a  |
  352. |                      void* and length.  For character strings, if the        |
  353. |                      terminating NULL was included in the length it will     |
  354. |                      be in the buffer.  Before performing string             |
  355. |                      operations such as concatenation on this string,        |
  356. |                      strip any trailing NULL.  (See IString::stripTrailing.) |
  357. -------------------------------------------------------------------------------*/
  358. IString
  359.   pokedData ( ) const;
  360.  
  361. }; // IDDEAcknowledgePokeEvent
  362.  
  363. class IDDEAcknowledgeExecuteEvent : public IDDEClientAcknowledgeEvent {
  364. typedef IDDEClientAcknowledgeEvent
  365.   Inherited;
  366. /*******************************************************************************
  367. * The IDDEAcknowledgeExecuteEvent class provides event information to a        *
  368. * client application regarding an acknowledgement to an executeCommands        *
  369. * request.                                                                     *
  370. *                                                                              *
  371. * An instance of this class is created when an instance of                     *
  372. * IDDEClientConversation needs to pass information to the client application   *
  373. * about an acknowledgement resulting from an executeCommands request.          *
  374. * Instances of this class are not intended to be created by application        *
  375. * programmers.                                                                 *
  376. *******************************************************************************/
  377. public:
  378. /*--------------------- Constructor --------------------------------------------
  379. | Instances of this class are created from an IEvent.                          |
  380. ------------------------------------------------------------------------------*/
  381.   IDDEAcknowledgeExecuteEvent  ( const IEvent& ddeEvent );
  382.  
  383.   ~IDDEAcknowledgeExecuteEvent ( );
  384.  
  385. /*-------------------------------- Accessor ------------------------------------
  386. | Use the following function to get the accessible attribute of instances of   |
  387. | this class:                                                                  |
  388. |   commands - Returns the command string that the client asked the server     |
  389. |              application to execute.                                         |
  390. |              NOTE:  The commands function's IString is constructed from a    |
  391. |                     void* and length.  For character strings, if the         |
  392. |                     terminating NULL was included in the length it will be   |
  393. |                     in the buffer.  Before performing string operations      |
  394. |                     such as concatenation on this string, strip any          |
  395. |                     trailing NULL.  (See IString::stripTrailing.)            |
  396. ------------------------------------------------------------------------------*/
  397. IString
  398.   commands ( ) const;
  399.  
  400. }; // IDDEAcknowledgeExecuteEvent
  401.  
  402. class IDDEDataEvent : public IDDESetAcknowledgeInfoEvent {
  403. typedef IDDESetAcknowledgeInfoEvent
  404.   Inherited;
  405. /*******************************************************************************
  406. * The IDDEDataEvent class provides event information and data to a client      *
  407. * application.                                                                 *
  408. *                                                                              *
  409. * An instance of this class is created when an instance of                     *
  410. * IDDEClientConversation needs to pass data sent from a server to the client   *
  411. * application.  This can result from a requestData request or from an active   *
  412. * hot link.  Instances of this class are not intended to be created by         *
  413. * application programmers.                                                     *
  414. *******************************************************************************/
  415. public:
  416. /*-------------------- Constructor ---------------------------------------------
  417. | Instances of this class are created from an IEvent.                          |
  418. ------------------------------------------------------------------------------*/
  419.   IDDEDataEvent  ( const IEvent& ddeEvent );
  420.  
  421.   ~IDDEDataEvent ( );
  422.  
  423. /*-------------------------------- Accessors -----------------------------------
  424. | Use the following functions to get accessible attributes of instances of     |
  425. | this class:                                                                  |
  426. |   data              - Returns the data provided by the server.               |
  427. |                       NOTE:  The data function's IString is constructed      |
  428. |                              from a void* and length.  For character         |
  429. |                              strings, if the terminating NULL was included   |
  430. |                              in the length, it will be in the buffer.        |
  431. |                              Before performing string operations such as     |
  432. |                              concatenation on this string, strip any         |
  433. |                              trailing NULL.  (See IString::stripTrailing.)   |
  434. |   isAckRequested    - Returns true if the server has requested an            |
  435. |                       acknowledgement of receipt of the data.  The           |
  436. |                       IDDEClientConversation instance will automatically     |
  437. |                       send the acknowledgement when it is requested.         |
  438. |   isDataFromHotLink - Returns true if the data is being sent as the result   |
  439. |                       of an active hot link. Returns false if the data is    |
  440. |                       sent in response to a requestData request.             |
  441. ------------------------------------------------------------------------------*/
  442. IString
  443.   data ( ) const;
  444.  
  445. Boolean
  446.   isAckRequested    ( ) const,
  447.   isDataFromHotLink ( ) const;
  448.  
  449. }; // IDDEDataEvent
  450.  
  451. class IDDEClientHotLinkEvent : public IDDESetAcknowledgeInfoEvent {
  452. typedef IDDESetAcknowledgeInfoEvent
  453.   Inherited;
  454. /*******************************************************************************
  455. * The IDDEClientHotLinkEvent class provides information to a client            *
  456. * application when a hot link item change notification is sent by a server     *
  457. * application.                                                                 *
  458. *                                                                              *
  459. * An instance of this class is created when an instance of                     *
  460. * IDDEClientConversation needs to pass a hot line notification to the client   *
  461. * application. An instance of this class for each active hot link is also      *
  462. * kept in a set by IDDEClientConversation instances to keep track of active    *
  463. * hot links.  Instances of this class are not intended to be created by        *
  464. * application programmers.                                                     *
  465. *******************************************************************************/
  466. public:
  467. /*------------------------- Constructor ----------------------------------------
  468. | Instances of this class are created from an IEvent.                          |
  469. ------------------------------------------------------------------------------*/
  470.   IDDEClientHotLinkEvent  ( const IEvent&                 ddeEvent );
  471.   IDDEClientHotLinkEvent  ( const IDDEClientHotLinkEvent& ddeEvent );
  472.  
  473.   ~IDDEClientHotLinkEvent ( );
  474.  
  475. /*-------------------------------- Accessors -----------------------------------
  476. | Use the following functions to get the the accessible attributes             |
  477. | of instances of this class:                                                  |
  478. |   isAckRequested  - Returns true if the server has requested an              |
  479. |                     acknowledgement of receipt of the notification.          |
  480. |                     The IDDEClientConversation instance will automatically   |
  481. |                     send the acknowledgement when it is requested.           |
  482. |   isDataRequested - Returns true if the hot link is a data hot link.         |
  483. |                     False is returned if it is a notification hot link.      |
  484. |                     This function is only pertinent for instances of this    |
  485. |                     class used to keep track of active hot links (contained  |
  486. |                     in an IDDEClientHotLinkSet instance).  All other         |
  487. |                     instances of this class will be created for              |
  488. |                     notifications sent by non-data hot links.                |
  489. ------------------------------------------------------------------------------*/
  490. Boolean
  491.   isAckRequested  ( ) const,
  492.   isDataRequested ( ) const;
  493.  
  494. }; // IDDEClientHotLinkEvent
  495.  
  496. class IDDERequestDataEvent : public IDDESetAcknowledgeInfoEvent {
  497. typedef IDDESetAcknowledgeInfoEvent
  498.   Inherited;
  499. /*******************************************************************************
  500. * The IDDERequestDataEvent class provides event information to a server        *
  501. * application when a client has requested data.                                *
  502. *                                                                              *
  503. * An instance of this class is created when an instance of IDDETopicServer     *
  504. * needs to pass requests for data to the server application.  Instances of     *
  505. * this class are not intended to be created by application programmers.        *
  506. *******************************************************************************/
  507. public:
  508. /*------------------------- Constructor ----------------------------------------
  509. | Instances of this class are created from an IEvent.                          |
  510. ------------------------------------------------------------------------------*/
  511.   IDDERequestDataEvent  ( const IEvent& ddeEvent );
  512.  
  513.   ~IDDERequestDataEvent ( );
  514.  
  515. /*-------------------------------- Accessors -----------------------------------
  516. | Use the following functions to get and set the accessible attributes of      |
  517. | instances of this class:                                                     |
  518. |   requestAck - Sets the request acknowledgement flag.                        |
  519. |   setData    - Provides the requested data so it can be sent to the client.  |
  520. |                This function is overloaded so that either buffers of data    |
  521. |                or character strings can be easily sent.                      |
  522. ------------------------------------------------------------------------------*/
  523. IDDERequestDataEvent
  524.  &requestAck ( ),
  525.  &setData    ( const char*   dataString ),
  526.  &setData    ( const void*   dataBuffer,
  527.                unsigned long dataLength );
  528.  
  529. }; // IDDERequestDataEvent
  530.  
  531. class IDDEPokeEvent : public IDDESetAcknowledgeInfoEvent {
  532. typedef IDDESetAcknowledgeInfoEvent
  533.   Inherited;
  534. /*******************************************************************************
  535. * The IDDEPokeEvent class provides event information to a server application
  536. * when a client has asked the server to set an item to a new value.                          *
  537. *                                                                              *
  538. * An instance of this class is created when an instance of IDDETopicServer     *
  539. * needs to pass a pokeData request to the server application.  Instances of    *
  540. * this class are not intended to be created by application programmers.        *
  541. *******************************************************************************/
  542. public:
  543. /*------------------------- Constructor ----------------------------------------
  544. | Instances of this class are created from an IEvent.                          |
  545. ------------------------------------------------------------------------------*/
  546.   IDDEPokeEvent  ( const IEvent& ddeEvent );
  547.  
  548.   ~IDDEPokeEvent ( );
  549.  
  550. /*-------------------------------- Accessor ------------------------------------
  551. | Use the following function to get the accessible attribute of instances of   |
  552. | this class:                                                                  |
  553. |   pokedData - Returns the data that the client asked the server to set       |
  554. |               an item's value to.                                            |
  555. |               NOTE:  The pokedData function's IString is constructed from    |
  556. |                      a void* and length.  For character strings, if the      |
  557. |                      terminating NULL was included in the length, it will    |
  558. |                      be in the buffer.  Before performing string             |
  559. |                      operations such as concatenation on this string,        |
  560. |                      strip any trailing NULL.  (See IString::stripTrailing.) |
  561. ------------------------------------------------------------------------------*/
  562. IString
  563.   pokedData ( ) const;
  564.  
  565. }; // IDDEPokeEvent
  566.  
  567. class IDDEExecuteEvent : public IDDESetAcknowledgeInfoEvent {
  568. typedef IDDESetAcknowledgeInfoEvent
  569.   Inherited;
  570. /*******************************************************************************
  571. * The IDDEExecuteEvent class provides event information to a server            *
  572. * application when a client has asked the server to execute a command string.  *
  573. *                                                                              *
  574. * An instance of this class is created when an instance of IDDETopicServer     *
  575. * needs to pass an executeCommands request to the server application.          *
  576. * Instances of this class are not intended to be created by application        *
  577. * programmers.                                                                 *
  578. *******************************************************************************/
  579. public:
  580. /*------------------------- Constructor ---------------------------------------
  581. | There is one way to create instances of this class:                          |
  582. ------------------------------------------------------------------------------*/
  583.   IDDEExecuteEvent  ( const IEvent& ddeEvent );
  584.  
  585.   ~IDDEExecuteEvent ( );
  586.  
  587. /*-------------------------------- Accessor ------------------------------------
  588. | Use the following function to get the accessible attribute of instances of   |
  589. | this class:                                                                  |
  590. |   commands - Returns the command string that the client has asked the        |
  591. |              server to execute.                                              |
  592. |              NOTE:  The commands function's IString is constructed from a    |
  593. |                     void* and length.  For character strings, if the         |
  594. |                     terminating NULL was included in the length, it will     |
  595. |                     be in the buffer.  Before performing string operations   |
  596. |                     such as concatenation on this string, strip any          |
  597. |                     trailing NULL. (See IString::stripTrailing.)             |
  598. ------------------------------------------------------------------------------*/
  599. IString
  600.   commands ( ) const;
  601.  
  602. }; // IDDEExecuteEvent
  603.  
  604. class IDDEServerHotLinkEvent : public IDDESetAcknowledgeInfoEvent {
  605. typedef IDDESetAcknowledgeInfoEvent
  606.   Inherited;
  607. /*******************************************************************************
  608. * The IDDEServerHotLinkEvent class provides event information to a server      *
  609. * application when a client has asked the server to begin a hot link.          *
  610. *                                                                              *
  611. * An instance of this class is created when an instance of IDDETopicServer     *
  612. * needs to pass a beginHotLink request to the server application.  Instances   *
  613. * of this class are not intended to be created by application programmers.     *
  614. *******************************************************************************/
  615. public:
  616. /*------------------------- Constructor ----------------------------------------
  617. | Instances of this class are created from IEvent.                             |
  618. ------------------------------------------------------------------------------*/
  619.   IDDEServerHotLinkEvent  ( const IEvent& ddeEvent );
  620.  
  621.   ~IDDEServerHotLinkEvent ( );
  622.  
  623. /*-------------------------------- Accessors -----------------------------------
  624. | Use the following functions to get the accessible attributes of instances    |
  625. | of this class:                                                               |
  626. |   isPacingRequested - Returns true if the client application has requested   |
  627. |                       the server to request an acknowledgement from the      |
  628. |                       client whenever it sends data or a notification.       |
  629. |   isDataRequested   - Returns true if the client application has requested   |
  630. |                       a data hot link. Returns false if a notification       |
  631. |                       link has been requested.                               |
  632. ------------------------------------------------------------------------------*/
  633. Boolean
  634.   isPacingRequested ( ) const,
  635.   isDataRequested   ( ) const;
  636.  
  637. }; // IDDEServerHotLinkEvent
  638.  
  639. class IDDEEndEvent : protected IEvent {
  640. typedef IEvent
  641.   Inherited;
  642. /*******************************************************************************
  643. * The IDDEEndEvent class provides event information to a client or server      *
  644. * application when a conversation is ended or ending.                          *
  645. *                                                                              *
  646. * An instance of this class is created when an instance of IDDETopicServer     *
  647. * needs to notify the application that a conversation is ending or ended.      *
  648. * Instances of this class are not intended to be created by application        *
  649. * programmers.                                                                 *
  650. *******************************************************************************/
  651. public:
  652. /*------------------------------ Related Type ----------------------------------
  653. | The following enumeration type defines sources of conversation endings:      |
  654. |   Source   -  Used to defined the possible sources of an end to a            |
  655. |               conversation. The allowable values are:                        |
  656. |     client -  Indicates that the client initiated the conversation's end.    |
  657. |     server -  Indicates that the server initiated the conversation's end.    |
  658. |     error  -  Indicates that an error in a routine entered from the          |
  659. |               dispatcher would cause an exception to be thrown and the       |
  660. |               application would not have an opportunity to catch the         |
  661. |               exception.  Since this situation could cause this              |
  662. |               application and the application being conversed with to        |
  663. |               abnormally end, this application is called back with an        |
  664. |               instance of IDDEEndEvent.  The conversation is also            |
  665. |               terminated at this point.                                      |
  666. ------------------------------------------------------------------------------*/
  667. enum Source { client, server, error };
  668.  
  669. /*------------------------- Constructor ----------------------------------------
  670. | Instances of this class are created from IEvent.                             |
  671. ------------------------------------------------------------------------------*/
  672.   IDDEEndEvent  ( const IEvent& ddeEvent,
  673.                   Source        endSource );
  674.  
  675.   ~IDDEEndEvent ( );
  676.  
  677. /*-------------------------------- Accessor ------------------------------------
  678. | Use the following function to get the accessible attribute of instances of   |
  679. | this class:                                                                  |
  680. |   sourceOfEnd - Returns one of the values of the Source enumeration          |
  681. |                 indicating what the source of the conversation ending is.    |
  682. ------------------------------------------------------------------------------*/
  683. Source
  684.   sourceOfEnd ( ) const;
  685.  
  686. private:
  687. /*--------------------------------- PRIVATE ----------------------------------*/
  688. Source
  689.   sourceCl;
  690.  
  691. }; // IDDEEndEvent
  692.  
  693. class IDDEClientEndEvent : public IDDEEndEvent {
  694. typedef IDDEEndEvent
  695.   Inherited;
  696. /*******************************************************************************
  697. * The IDDEClientEndEvent class provides event information to a client          *
  698. * application when a conversation is ended or ending.                          *
  699. *                                                                              *
  700. * An instance of this class is created when an instance of                     *
  701. * IDDEClientConversation needs to notify the application that a conversation   *
  702. * is ending or ended.  Instances of this class are not intended to be created  *
  703. * by application programmers.                                                  *
  704. *******************************************************************************/
  705. public:
  706. /*------------------------- Constructor ----------------------------------------
  707. | Instances of this class are created from IEvent.                             |
  708. ------------------------------------------------------------------------------*/
  709.   IDDEClientEndEvent  ( const IEvent&  ddeEvent,
  710.                         Source         endSource,
  711.                         IString        application,
  712.                         IString        topic );
  713.  
  714.   ~IDDEClientEndEvent ( );
  715.  
  716. /*-------------------------------- Accessors -----------------------------------
  717. | Use the following function to get the accessible attributes of this class:   |
  718. |   application - Returns the name of the server application for the           |
  719. |                 conversation that is ending or ended.                        |
  720. |   topic       - Returns the name of the topic supported by the conversation  |
  721. |                 that is ending or ended.                                     |
  722. ------------------------------------------------------------------------------*/
  723. IString
  724.   application ( ) const,
  725.   topic       ( ) const;
  726.  
  727. private:
  728. /*--------------------------------- PRIVATE ----------------------------------*/
  729. IString
  730.   strClApp,
  731.   strClTopic;
  732.  
  733. }; // IDDEClientEndEvent
  734.  
  735. class IDDEBeginEvent : protected IEvent {
  736. typedef IEvent
  737.   Inherited;
  738. /*******************************************************************************
  739. * The IDDEBeginEvent class provides event information to a server              *
  740. * application when a client has asked the server to begin a conversation.      *
  741. *                                                                              *
  742. * An instance of this class is created when an instance of                     *
  743. * IDDETopicServer needs to pass an acceptConversation request to the server    *
  744. * application.  Instances of this class are not intended to be created by      *
  745. * application programmers.                                                     *
  746. *******************************************************************************/
  747. public:
  748. /*------------------------- Constructor ----------------------------------------
  749. | Instances of this class are created from an IEvent.                          |
  750. ------------------------------------------------------------------------------*/
  751.   IDDEBeginEvent  ( const IEvent& ddeBeginEvent );
  752.  
  753.   ~IDDEBeginEvent ( );
  754.  
  755. /*-------------------------------- Accessors -----------------------------------
  756. | Use the following functions to get and set the                               |
  757. | accessible attributes of instances of this class:                            |
  758. |   application      - Returns the name of the requested application.          |
  759. |   topic            - Returns the name of the requested topic.                |
  760. |   setCaseSensitive - Sets the case-sensitive flag to true.  The server       |
  761. |                      application should set this flag if it enforces case    |
  762. |                      sensitivity.                                            |
  763. ------------------------------------------------------------------------------*/
  764. IString
  765.   application ( ) const,
  766.   topic       ( ) const;
  767.  
  768. IDDEBeginEvent
  769.  &setCaseSensitive ( Boolean caseSensitive );
  770.  
  771. private:
  772. /*--------------------------------- PRIVATE ----------------------------------*/
  773. friend class IDDEClientConversation;
  774. friend class IDDETopicServer;
  775.  
  776.   IDDEBeginEvent ( const IDDEBeginEvent& rhs );
  777. IDDEBeginEvent&
  778.   operator= ( const IDDEBeginEvent& rhs );
  779. Boolean
  780.   isCaseSensitive ( ) const;
  781.  
  782. IString
  783.   strClApp,
  784.   strClTopic;
  785. Boolean
  786.   bClCaseSens;
  787.  
  788. }; // IDDEBeginEvent
  789.  
  790. /*----------------------------------------------------------------------------*/
  791. /* Resume compiler default packing.                                           */
  792. /*----------------------------------------------------------------------------*/
  793. #pragma pack()
  794.  
  795. /*--------------------------------- INLINES ----------------------------------*/
  796. #ifndef I_NO_INLINES
  797.   #include <iddeevt.inl>
  798. #endif
  799.  
  800. #endif /* _IDDEEVT_ */
  801.