home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / DRAFTWN.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  5KB  |  166 lines

  1. /* @(#)Z 1.17 com/src/docshell/DraftWn.h, odshell, od96os2, odos29646d 96/11/15 15:25:02 (96/10/29 09:24:02) */
  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.  
  81.  
  82. //==============================================================================
  83. // constants used in functions
  84. //==============================================================================
  85. const ODULong kODNameLength = 15; // Length of name in draft history entry
  86. const ODULong kODNumLength  = 5;  // Length of draft in draft history entry
  87. const ODULong kODDateLength = 29; // Length of date in draft history entry
  88. const ODULong kODCmntLength = 30; // Length of comment in draft history entry
  89. const ODULong kODTotalTabs  = 3;  // Number of tab stops used in list box.
  90.  
  91. const ODULong kODMaxLength  = 256;// Max length of text fields in draft info
  92. const size_t  kODWcsLength  = sizeof(wchar_t);
  93. //==============================================================================
  94. // Classes defined in this interface
  95. //==============================================================================
  96.  
  97. class DraftWindow;    
  98.  
  99. //==============================================================================
  100. // DraftWindow definition
  101. //==============================================================================
  102.  
  103. class DraftWindow
  104. {    
  105.  
  106.   public:
  107.         // Constructor
  108.     DraftWindow(DocumentManager*, WindowSystemData*, ODPlatformWindow);
  109.  
  110.         // Destructor
  111.     ~DraftWindow();
  112.  
  113.         // Produces and controls Draft History Dialog
  114.         void          DraftHistory();
  115.  
  116.         // Builds text string of draf info for dialog entry.
  117.         char*          BuildEntry(DraftInfoRec*);
  118.  
  119.         // Opens selected draft
  120.         ODBoolean     OpenDraft(int);
  121.  
  122.         // Deletes selected draft
  123.         ODBoolean     RemoveDraft(int);
  124.  
  125.     // Accessors for fActiveDocumentManager
  126.     void             SetActiveDocumentManager(DocumentManager*);
  127.     DocumentManager* GetActiveDocumentManager();
  128.  
  129.     // Accessors for fDraftInfoList
  130.     void             SetDraftInfoList(DraftInfoRec*);
  131.         DraftInfoRec*    GetDraftInfoList();
  132.  
  133.     // Accessors for fWindow
  134.     void             SetWindow(ODPlatformWindow);
  135.         ODPlatformWindow GetWindow();
  136.  
  137.   private:
  138.         // pointer to currently active document manager associated 
  139.         // with this document.
  140.     DocumentManager*    fActiveDocumentManager;
  141.  
  142.         // List of draft info records
  143.     DraftInfoRec*        fDraftInfoList;
  144.         
  145.         // Resource file instance
  146. #if defined (_PLATFORM_WIN32_) 
  147.     HINSTANCE           fInstance;
  148. #elif defined (_PLATFORM_OS2_)
  149.     HMODULE                   fInstance;
  150. #elif defined (_PLATFORM_UNIX_)
  151.     Widget                   fInstance;
  152. #endif
  153.  
  154.         // Handle to document window.
  155.     ODPlatformWindow        fWindow;
  156.  
  157.         // pointer to currently selected draft for purposes of 
  158.         // incrementing and decrementing ref count.
  159.     ODDraft*        fSelectedDraft;
  160.  
  161.         // Finds a specific info rec in DraftInfoList
  162.         DraftInfoRec* FindDraftInList(int);
  163. };
  164.  
  165. #endif    // _DRAFTWIN_
  166.