home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / AVSSHELL.H < prev    next >
Text File  |  1997-02-28  |  8KB  |  239 lines

  1. /* @(#)Z 1.3 os2/src/avsshell/avsshell.h, oddataxfer, od96os2, odos29646d 96/11/15 15:50:01 (96/08/23 01:40:34) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: oddataxfer
  6.  *
  7.  *   CLASSES:   AvsShell
  8.  *
  9.  *   ORIGINS: 82,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. // Copyright (C) Apple Computer, Inc., 1994
  30. //
  31. //******************************************************************
  32.  
  33. #ifndef _AVSSHELL_
  34. #define _AVSSHELL_
  35.  
  36. //#include <OSAEvent.h>
  37.  
  38. #ifndef _PLFMDEF_
  39. #include "PlfmDef.h"
  40. #endif
  41.  
  42. #ifndef _ODTYPES_
  43. #include <ODTypes.h>
  44. #endif
  45.  
  46. #ifdef _PLATFORM_OS2_
  47. #ifndef _ODTYPESP_
  48. #include <ODTypesP.h>
  49. #endif
  50. #endif // _PLATFORM_OS2_
  51.  
  52. #ifndef SOM_ODDraft_xh
  53. #include <Draft.xh>      // for ODDraftPermissions
  54. #endif
  55.  
  56. #ifndef _PLFMFILE_
  57. #include <PlfmFile.h>    /* for ODFileSpec */
  58. #endif
  59.  
  60. #ifndef _PLATFORM_OS2_
  61. #ifndef __PROCESSES__
  62. #include <Processes.h>    /* For ProcessSerialNumber */
  63. #endif
  64. #endif
  65.  
  66. //=============================================================================
  67. // Theory of Operation
  68. //=============================================================================
  69.  
  70. /*
  71.   The Shell contains all code which interfaces a particular platform's
  72.   user interface with the OpenDoc parts underneath.
  73.   Each document is run in its own process.
  74.  
  75. */
  76.  
  77. //=============================================================================
  78. // Constants
  79. //=============================================================================
  80.  
  81. //-----------------------------------------------------------------------------
  82. // OSType constants
  83. //-----------------------------------------------------------------------------
  84.  
  85. const DescType kRealShellPropAccessor     = 0x73706163;  // 'spac';
  86. const DescType kRealShellSelfPropAccessor  = 0x7368656C;  // 'shel';
  87. const  OSType kOpenDocLetterType     = 0x626C7472;  // 'bltr';
  88.  
  89. //=============================================================================
  90. // Scalar Types
  91. //=============================================================================
  92.  
  93. typedef  ODSShort  ODResNumber;
  94.  
  95. //=============================================================================
  96. // Classes defined in this interface
  97. //=============================================================================
  98.  
  99. class AvsShell;
  100.  
  101. //=============================================================================
  102. // Classes used by this interface
  103. //=============================================================================
  104.  
  105. class AVSShellSession;
  106. class ODSession;
  107. class ODDispatcher;
  108. class ODWindowState;
  109. class ODArbitrator;
  110. class ODDraft;
  111. class ODDocument;
  112. class ODContainer;
  113. class ODMenuBar;
  114. class ODPopup;
  115. class ShellSI;
  116. class PlatformFile;
  117. class StandardFileReply;
  118. class OrderedCollection;
  119. class ODAppleEvent;
  120. class ODDesc;
  121. class IODAvailServer;
  122.  
  123. //=============================================================================
  124. // RealShell
  125. //=============================================================================
  126. #define SM_SETCLIENTFOCUS      (WM_USER + 0)
  127.  
  128. #define kRealShellID "appl:RealShell$class,1.0.0"
  129. #ifdef _PLATFORM_OS2_
  130. extern "C" {
  131.    MRESULT EXPENTRY ODShellWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  132.    MRESULT EXPENTRY ODPartWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  133. }
  134. #endif
  135.  
  136. class AvsShell
  137. {
  138. public:
  139.    friend MRESULT ODShellWndProc(HWND, ULONG, MPARAM, MPARAM);
  140.    friend MRESULT ODPartWndProc(HWND, ULONG, MPARAM, MPARAM);
  141.  
  142. //-----------------------------------------------------------------------------
  143. // Constructor/Destructor
  144. //-----------------------------------------------------------------------------
  145.  
  146.   AvsShell();
  147.   ODVMethod ~AvsShell();
  148.  
  149. //-----------------------------------------------------------------------------
  150. // Main Entry Point
  151. //-----------------------------------------------------------------------------
  152.  
  153.   ODVMethod void go( int argc, char *argv[] );
  154.  
  155. //-----------------------------------------------------------------------------
  156. // Availability Server access
  157. //-----------------------------------------------------------------------------
  158.  
  159.   // CloneLinkSource:
  160.   // Called by availability server when a linkID needs to be opened.
  161.   // The pathName is used to find the document.  The
  162.   // document is opened read-only.  The linkservice is
  163.   // asked to find the SU of the LinkSource corresponding to this linkID.
  164.   // This LinkSource is then cloned into the surrogateDraft,
  165.   // and the SUID of that clone is returned.
  166.  ODMethod  ODStorageUnitID  CloneLinkSource(ODLinkID linkID,
  167.                                              ODISOStr pathName);
  168.  
  169.  ODMethod void SetDocListHWND(HWND docListHWND);
  170.  ODMethod void UpdateDocList(ULONG docID, char* pathName, char flag);
  171.  ODMethod void SetLinkListHWND(HWND linkListHWND);
  172.  ODMethod void UpdateLinkList(ULONG linkID, ULONG docID, ULONG flag);
  173.  
  174. //-----------------------------------------------------------------------------
  175. // public for OSAEvent handlers, but private by convention
  176. //-----------------------------------------------------------------------------
  177. //- crs - 2/1/95 - made these public for the bento browser...
  178.   ODMethod void SaveDraft();
  179.  
  180. protected:
  181.  
  182. //-----------------------------------------------------------------------------
  183. // Initialization
  184. //-----------------------------------------------------------------------------
  185.  
  186.   ODMethod void Initialize(char* name /* filename of doc and alias of server */);
  187.  
  188. //-----------------------------------------------------------------------------
  189. // New
  190. //-----------------------------------------------------------------------------
  191.  
  192.   ODMethod ODFileSpec  CreateNamedContainer(ODDocument** documentPtr,
  193.         ODContainer** containerPtr, PlatformFile* currentFile, const char * basename);
  194.  
  195. //-----------------------------------------------------------------------------
  196. // Open
  197. //-----------------------------------------------------------------------------
  198.  
  199.   ODMethod void OpenFile(PlatformFile* file);
  200.  
  201.   ODMethod void Open();
  202.  
  203.   ODMethod void OpenDraft(ODDraft* draft);
  204.   ODMethod PlatformFile*   AvsShell::OpenUntitled( const char *);
  205.  
  206. //-----------------------------------------------------------------------------
  207. // Drafts
  208. //-----------------------------------------------------------------------------
  209.  
  210.   ODMethod  ODBoolean  HasWriteAccess();
  211.  
  212. //-----------------------------------------------------------------------------
  213. // private fields
  214. //-----------------------------------------------------------------------------
  215.  
  216.   Environment*    fSOMEnvironment;
  217.   AVSShellSession*   fSession;
  218.   ODContainer*    fContainer;
  219.   ODDocument*     fDocument;
  220.   ODDraft*        fDraft;
  221.   ODContainer*    fSurrogateContainer;
  222.   ODDocument*     fSurrogateDocument;
  223.   ODDraft*        fSurrogateDraft;
  224.   ODHandle       fSurrogateContainerHandle;
  225.   IODAvailServer* fAvailabilityServer;
  226.   ODDraftPermissions fPermissions;
  227.   ODPlatformWindow   fPlatformWindow; /* in streamlined version of AS */
  228.   ODBoolean  fIsNew;
  229.   ODBoolean fDraftIsSaved;
  230.  
  231.   HWND fDocListHWND;
  232.   HWND fLinkListHWND;
  233.  
  234. };
  235.  
  236.  
  237.  
  238. #endif  // _SHELLM_
  239.