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

  1. /******************************************************************************
  2. * .FILE:         aclient.hpp                                                  *
  3. *                                                                             *
  4. * .DESCRIPTION:  Dynamic Data Exchange Client Program: Class Definitions      *
  5. *                                                                             *
  6. * .CLASSES:      AClientWindow                                                *
  7. *                AConversation                                                *
  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 ACLIENTWINDOW_HPP
  26. #define ACLIENTWINDOW_HPP
  27.  
  28. #include <iframe.hpp>                             //IFrameWindow
  29. #include <icmdhdr.hpp>                            //ICommandHandler
  30. #include <iddetsrv.hpp>                           //IDDEServer Classes
  31. #include <iddeccnv.hpp>
  32. #include <ireslib.hpp>
  33.  
  34. class IMenuBar;
  35. class ISplitCanvas;
  36. class IStaticText;
  37. class IInfoArea;
  38. class AConversation;
  39.  
  40. /**********************************************************/
  41. /* Define our Customer DDE Client Window                  */
  42. /**********************************************************/
  43. class AClientWindow : public IFrameWindow, public ICommandHandler
  44. {
  45. public:
  46.   AClientWindow     (unsigned long windowId);     //Constructor
  47.   ~AClientWindow    ();                           //Destructor
  48.   virtual Boolean   log(const char *);            //Log message to window
  49.   virtual Boolean   log(IResourceId id);          //Log message to window
  50.   virtual Boolean   setWorkItem(char * message);  //Set new work item
  51.   virtual IString   workItem();                   //Get work item
  52.   virtual Boolean   workItemDone();               //Set work item done
  53.   virtual Boolean   updateStatus();               //Update status line
  54.   virtual Boolean   updateTodo(char * newCount);  //Update todo count
  55.   virtual Boolean   updateWork(char * newCount);  //Update work count
  56.   virtual Boolean   updateDone(char * newCount);  //Update done count
  57.  
  58. protected:
  59.   virtual Boolean   command(ICommandEvent& cmdevt);
  60.  
  61. private:
  62.   IMenuBar          menuBar;                      //Menu Bar
  63.   ISplitCanvas      statusLine;                   //Status line
  64.   IStaticText       todoStatus;                   //Todo list status
  65.   IStaticText       workStatus;                   //Work list status
  66.   IStaticText       doneStatus;                   //Done list status
  67.   ISplitCanvas      cArea;                        //Client area canvas
  68.   IStaticText       workWindow;                   //Work static window
  69.   IMultiLineEdit    mle;                          //MLE to log status
  70.   IInfoArea         infoArea;                     //Information Area
  71.   AConversation *   conversation;
  72.   long              todoCount;
  73.   long              workCount;
  74.   long              doneCount;
  75.   IResourceLibrary  resLib;
  76. };
  77.  
  78. class AConversation : public IDDEClientConversation
  79. {
  80. public:
  81.  
  82.   AConversation(AClientWindow* frameWin);
  83.  
  84.   void              conversationEnded(IDDEClientEndEvent& conv);
  85.   void              acknowledged(IDDEClientAcknowledgeEvent& event);
  86.   Boolean           data(IDDEDataEvent& event);
  87.   AClientWindow *   mainWindow() { return clientWindow; }
  88.  
  89. private:
  90.   AClientWindow *   clientWindow;
  91.   IResourceLibrary  resLib;
  92. };  // end AConversation
  93. #endif
  94.