home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osr1.exe / src / DraftWn.h < prev    next >
C/C++ Source or Header  |  1997-04-02  |  6KB  |  182 lines

  1. /* @(#)Z 1.20 com/src/docshell/DraftWn.h, odshell, od96os2, odos29714c 97/04/02 17:19:55 (97/03/24 12:40:24) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odshell
  6.  *
  7.  *   CLASSES:   DraftWindow
  8.  *
  9.  *   ORIGINS: 27
  10.  *
  11.  *
  12.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13.  *   All Rights Reserved
  14.  *   Licensed Materials - Property of IBM
  15.  *   US Government Users Restricted Rights - Use, duplication or
  16.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17.  *       
  18.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24.  *   OR PERFORMANCE OF THIS SOFTWARE.
  25.  */
  26. /*====END_GENERATED_PROLOG========================================
  27.  */
  28.  
  29. /*
  30.  
  31.     File:        DraftWn.h
  32.  
  33.     Contains:    definition of the DraftWn classes
  34.  
  35. */
  36.  
  37. #ifndef _DRAFTWN_
  38. #define _DRAFTWN_
  39.  
  40. #if defined (_PLATFORM_WIN32_)
  41. #include <windows.h>
  42. #elif defined (_PLATFORM_OS2_)
  43. #include "ODos2.h"
  44. #endif
  45.  
  46. #include <DocMgr.xh>
  47. #include <AppShell.xh>
  48. #include <Draft.xh>
  49. #include <WinStat.xh>
  50. #include <Window.xh>
  51.  
  52. #include <ISOStr.h>
  53. #include <ODTypes.h>
  54. #include <ODUtils.h>
  55.  
  56. #if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_)
  57. #include <ODRes.h>
  58. #ifndef SOM_ODSession_xh
  59. #include <ODSessn.xh>
  60. #endif
  61. #ifndef SOM_ODHelp_xh
  62. #include <ODHelp.xh>
  63. #endif
  64. #ifndef _HLPPANELS_
  65. #include <hlppanls.h>
  66. #endif
  67. #endif //defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_) 
  68.  
  69. #include <IText.h>
  70. #include <DraftRec.h>
  71.  
  72. //moved these includes below the ones above 
  73. //to avoid conflict with odnltyps.h
  74. #include <time.h>
  75. #include <langinfo.h>
  76. #include <string.h>
  77. #include <stdio.h>
  78. #include <iostream.h>
  79. #include <wchar.h>
  80. #include <locale.h>
  81.  
  82.  
  83. //==============================================================================
  84. // constants used in functions
  85. //==============================================================================
  86. const ODULong kODNameLength = 15; // Length of name in draft history entry
  87. const ODULong kODNumLength  = 5;  // Length of draft in draft history entry
  88. const ODULong kODDateLength = 40; // Length of date in draft history entry
  89. const ODULong kODCmntLength = 30; // Length of comment in draft history entry
  90. const ODULong kODTotalTabs  = 3;  // Number of tab stops used in list box.
  91.  
  92. const ODULong kODMaxNameLength = 80;// Max length of creator name. 
  93. const ODULong kODMaxLength  = 256;// Max length of text fields in draft info
  94. const size_t  kODWcsLength  = sizeof(wchar_t);
  95. //==============================================================================
  96. // Classes defined in this interface
  97. //==============================================================================
  98.  
  99. class DraftWindow;    
  100.  
  101. //==============================================================================
  102. // DraftWindow definition
  103. //==============================================================================
  104.  
  105. class DraftWindow
  106. {    
  107.  
  108.   public:
  109.         // Constructor
  110.     DraftWindow(DocumentManager*, WindowSystemData*, ODPlatformWindow);
  111.  
  112.         // Destructor
  113.     ODVMethod ~DraftWindow();
  114.  
  115.         // Produces and controls Draft History Dialog
  116.         ODMethod  void          DraftHistory();
  117.  
  118.         // Opens selected draft
  119.         ODMethod  ODBoolean     OpenDraft(int, DraftInfoRec*);
  120.  
  121.         // Deletes selected draft
  122.         ODMethod  ODBoolean     RemoveDraft(int, DraftInfoRec*);
  123.  
  124.     // Accessors for fActiveDocumentManager
  125.     ODMethod  void          SetActiveDocumentManager(DocumentManager* dmgr) 
  126.                                                {fActiveDocumentManager = dmgr;}
  127.     ODMethod  DocumentManager* GetActiveDocumentManager() 
  128.                                                {return fActiveDocumentManager;}
  129.  
  130.     // Accessors for fDraftInfoList
  131.     ODMethod  void          SetDraftInfoList(DraftInfoRec* dhInfo) 
  132.                                                    {fDraftInfoList = dhInfo;}
  133.         ODMethod  DraftInfoRec* GetDraftInfoList() {return fDraftInfoList;}
  134.  
  135.     // Accessors for fInstance
  136. #if defined (_PLATFORM_WIN32_) 
  137.     ODMethod void SetInstance(HINSTANCE instance) {fInstance = instance;}
  138.         ODMethod HINSTANCE GetInstance()              {return fInstance;}
  139. #elif defined (_PLATFORM_OS2_)
  140.     ODMethod void SetInstance(HMODULE instance)   {fInstance = instance;}
  141.         ODMethod HMODULE GetInstance()                {return fInstance;}
  142. #elif defined (_PLATFORM_UNIX_)
  143.     ODMethod void SetInstance(Widget instance)    {fInstance = instance;}
  144.         ODMethod Widget GetInstance()                 {return fInstance;}
  145. #endif
  146.  
  147.     // Accessors for fWindow
  148.     ODMethod void           SetWindow(ODPlatformWindow window) 
  149.                                                             {fWindow = window;}
  150.         ODMethod ODPlatformWindow GetWindow() {return fWindow;}
  151.  
  152.   private:
  153.         // Finds a specific info rec in DraftInfoList
  154.         DraftInfoRec* FindDraftInList(int);
  155.  
  156.         // pointer to currently active document manager associated 
  157.         // with this document.
  158.     DocumentManager*    fActiveDocumentManager;
  159.  
  160.         // List of draft info records
  161.     DraftInfoRec*        fDraftInfoList;
  162.         
  163.         // Resource file instance
  164. #if defined (_PLATFORM_WIN32_) 
  165.     HINSTANCE           fInstance;
  166. #elif defined (_PLATFORM_OS2_)
  167.     HMODULE                   fInstance;
  168. #elif defined (_PLATFORM_UNIX_)
  169.     Widget                   fInstance;
  170. #endif
  171.  
  172.         // Handle to document window.
  173.     ODPlatformWindow        fWindow;
  174.  
  175.         // pointer to currently selected draft for purposes of incrementing 
  176.         // and decrementing ref count.
  177.     ODDraft*        fSelectedDraft;
  178.  
  179. };
  180.  
  181. #endif    // _DRAFTWIN_
  182.