home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / ioc / dde / ddeserv / aserver.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  5.8 KB  |  111 lines

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