home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / IOC / DDE / ASERVER.HPP < prev    next >
Text File  |  1995-05-09  |  5KB  |  98 lines

  1. #ifndef ASERVERWINDOW_HPP
  2. #define ASERVERWINDOW_HPP
  3. /******************************************************************************/
  4. /* DDE SERVER SAMPLE PROGRAM: Class Header (ASERVER.HPP)                      */
  5. /*                                                                            */
  6. /* COPYRIGHT: Copyright (C) International Business Machines Corp., 1992,1993. */
  7. /*                                                                            */
  8. /* DISCLAIMER OF WARRANTIES:                                                  */
  9. /*   The following [enclosed] code is sample code created by IBM              */
  10. /*   Corporation.  This sample code is not part of any standard IBM product   */
  11. /*   and is provided to you solely for the purpose of assisting you in the    */
  12. /*   development of your applications.  The code is provided "AS IS",         */
  13. /*   without warranty of any kind.  IBM shall not be liable for any damages   */
  14. /*   arising out of your use of the sample code, even if they have been       */
  15. /*   advised of the possibility of such damages.                              */
  16. /******************************************************************************/
  17. // NOTE: WE RECOMMEND USING A FIXED SPACE FONT TO LOOK AT THE SOURCE
  18.  
  19. #include <iframe.hpp>                             //IFrameWindow
  20. #include <iddetsrv.hpp>                           //IDDEServer Classes
  21.  
  22. class ISplitCanvas;
  23. class IStaticText;
  24. class IListBox;
  25. class IMultiLineEdit;
  26. class IInfoArea;
  27. class AServerWindow;
  28.  
  29. class ATopicServer : public IDDETopicServer {
  30. public:
  31.   ATopicServer(const char* app,                   //ATopicServer Constructor
  32.           const char* topic,
  33.           AServerWindow* mainWin) ;
  34.  
  35.   Boolean           acceptConversation(           //Start conversation
  36.                       unsigned long conversationId,
  37.                       IDDEBeginEvent& event);
  38.   Boolean           beginHotLink(
  39.                        unsigned long conversationId,
  40.                        IDDEServerHotLinkEvent& event);
  41.   Boolean           pokeData(                     //Poke Data
  42.                       unsigned long conversationId,
  43.                       IDDEPokeEvent& event);
  44.   Boolean           requestData(                  //Client requesting data
  45.                       unsigned long conversationId,
  46.                       IDDERequestDataEvent& event);
  47.   void              requestHotLinkData(           //Client requesting hot link
  48.                       IDDERequestDataEvent& event);
  49.   void              hotLinkEnded(
  50.                       unsigned long conversationId,
  51.                       IDDEEvent& event);
  52.   void              conversationEnded(           //End conversation
  53.                       unsigned long conversationId,
  54.                       IDDEEndEvent& conv);
  55.  
  56.   AServerWindow *   mainWindow() const { return serverWindow;}
  57.  
  58. private:
  59.   AServerWindow *   serverWindow;
  60. }; /* End of ATopicServer */
  61.  
  62. /**********************************************************/
  63. /* Define our DDE Server Active conversation Window       */
  64. /**********************************************************/
  65. class AServerWindow : public IFrameWindow
  66. {
  67. public:
  68.   AServerWindow     (unsigned long windowId);     //Constructor
  69.   virtual Boolean   log(char * message);          //Log message to window
  70.   virtual Boolean   addDone(char * newDone);      //Add item to done list
  71.   virtual Boolean   addTodo(char * newTodo);      //Add item to todo list
  72.   virtual Boolean   moreTodo();                   //Add more to todo list
  73.   virtual Boolean   addHot();                     //Set hot link active flag
  74.   virtual Boolean   removeHot();                  //Set hot link active flag
  75.   virtual IString   nextTodo();                   //Get next todo
  76.   virtual IString   todo();                       //Get todo count
  77.   virtual IString   work();                       //Get work count
  78.   virtual IString   done();                       //Get done count
  79.   virtual Boolean   updateStatus();               //Update status line
  80.  
  81. private:
  82.   ISplitCanvas      statusLine;                   //Status line
  83.   IStaticText       todoStatus;                   //Todo list status
  84.   IStaticText       workStatus;                   //Work list status
  85.   IStaticText       doneStatus;                   //Done list status
  86.   ISplitCanvas      cArea;                        //Client area canvas
  87.   ISplitCanvas      dArea;                        //Data area canvas
  88.   IListBox          todoList;                     //Todo list
  89.   IListBox          workList;                     //Work list
  90.   IListBox          doneList;                     //Done list
  91.   IMultiLineEdit    mle;                          //MLE to log status
  92.   IInfoArea         infoArea;                     //Information Area
  93.   ATopicServer      server;                       //DDE Topic Server
  94.   int               hot;                          //true=hot link active
  95. }; /* End of AServerWindow */
  96.  
  97. #endif
  98.