home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / iguibndl.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  7.8 KB  |  217 lines

  1. /*******************************************************************************
  2. * FILE NAME: iguibndl.hpp                                                      *
  3. *                                                                              *
  4. * DESCRIPTION:                                                                 *
  5. *   Declaration of the classes:                                                *
  6. *     IGUIBundle                                                               *
  7. *                                                                              *
  8. * COPYRIGHT:                                                                   *
  9. *   IBM Open Class Library                                                     *
  10. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  11. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  12. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  13. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  14. *                                                                              *
  15. *   Portions or this component are based on work originating from Taligent.    *
  16. *   (C) Copyright Taligent, Inc. 1996 - All rights reserved.                   *
  17. *                                                                              *
  18. *******************************************************************************/
  19. #ifndef _IGUIBNDL_
  20. #define _IGUIBNDL_
  21.  
  22. // forward references
  23. class IComponentFrameWindow;
  24. class IComponent;
  25. class IView;
  26. class IMainMenuHandler;
  27. class IWindow;
  28. class IMenuBar;
  29. class IToolBar;
  30. class IFrameWindow;
  31.  
  32. #include <icmdhdr.hpp>
  33. #include <icconst.h>
  34.  
  35.  
  36. // classes defined in this module
  37. class IGUIBundle;
  38.  
  39.  
  40. #pragma pack(4)
  41.  
  42.  
  43. /*------------------------ Resource Constants --------------------------------*/
  44.  
  45. enum EMenuBar {
  46.     kFileMenu =         IC_ID_FILE,
  47.     kEditMenu =         IC_ID_EDIT,
  48.     kViewMenu =         IC_ID_VIEW,
  49.     kHelpMenu =         IC_ID_HELP
  50. };
  51.  
  52. enum EMenus {
  53.     kFileNew =          IC_ID_NEW,
  54.     kFileOpen =         IC_ID_OPEN,
  55.     kFileSave =         IC_ID_SAVE,
  56.     kFileSaveAs =       IC_ID_SAVE_AS,
  57.     kFileExit =         IC_ID_EXIT,
  58.     kFileUpdate =       IC_ID_UPDATE,
  59.     kFileSaveCopyAs =   IC_ID_SAVE_COPY_AS,
  60.  
  61.     kEditUndo =         IC_ID_UNDO,
  62.     kEditCut =          IC_ID_CUT,
  63.     kEditCopy =         IC_ID_COPY,
  64.     kEditPaste =        IC_ID_PASTE,
  65.     kEditPasteSpecial = IC_ID_PASTESPECIAL,
  66.     kEditPasteLink =    IC_ID_PASTELINK,
  67.     kEditDelete =       IC_ID_DELETE,
  68.     kEditSelectAll =    IC_ID_SELECTALL,
  69.     kEditInsertObject = IC_ID_INSERT,
  70.     kEditLinks =        IC_ID_EDITLINKS,
  71.  
  72.     kVerb0 =            IC_ID_VERB0,
  73.     kVerbMin =          kVerb0,
  74.     kVerb1 =            IC_ID_VERB1,
  75.     kVerb2 =            IC_ID_VERB2,
  76.     kVerb3 =            IC_ID_VERB3,
  77.     kVerb4 =            IC_ID_VERB4,
  78.     kVerb5 =            IC_ID_VERB5,
  79.     kVerb6 =            IC_ID_VERB6,
  80.     kVerb7 =            IC_ID_VERB7,
  81.     kVerb8 =            IC_ID_VERB8,
  82.     kVerb9 =            IC_ID_VERB9,
  83.     kVerb10 =           IC_ID_VERB10,
  84.     kVerb11 =           IC_ID_VERB11,
  85.     kVerb12 =           IC_ID_VERB12,
  86.     kVerb13 =           IC_ID_VERB13,
  87.     kVerb14 =           IC_ID_VERB14,
  88.     kVerb15 =           IC_ID_VERB15,
  89.     kVerb16 =           IC_ID_VERB16,
  90.     kVerb17 =           IC_ID_VERB17,
  91.     kVerb18 =           IC_ID_VERB18,
  92.     kVerb19 =           IC_ID_VERB19,
  93.     kVerbMax =          kVerb19,
  94.  
  95.     kConvert =          IC_ID_CONVERT,
  96.  
  97.     kViewToolbar =      IC_ID_TOOLBAR,
  98.  
  99.     kHelpAbout =        IC_ID_ABOUT
  100. };
  101.  
  102. enum EWindowID {
  103.     kDefaultView =      IC_CDF_DEFAULT_VIEW_ID,
  104.     kStandaloneMenu =   IC_CDF_STANDALONE_MENU_ID,
  105.     kEmbeddedMenu =     IC_CDF_EMBEDDED_MENU_ID,
  106.     kInplaceMenu =      IC_CDF_INPLACE_MENU_ID,
  107.     kToolBar =          IC_CDF_TOOLBAR_ID,
  108.     kPopupMenu =        IC_CDF_POPUP_MENU_ID
  109. };
  110.  
  111.  
  112. /*******************************************************************************
  113. *                                                                              *
  114. *   Class IGUIBundle                                                           *
  115. *                                                                              *
  116. *   Object that controls Models, Views and windows                             *
  117. *                                                                              *
  118. *******************************************************************************/
  119.  
  120. class IGUIBundle
  121. {
  122. public:
  123.  
  124. /*----------------------- Construction/Destruction ---------------------------*/
  125.  
  126.                                 IGUIBundle();
  127.                                 ~IGUIBundle();
  128.  
  129.  
  130. /*---------------------------- Informational ---------------------------------*/
  131.  
  132.     IComponent&                 component() const;
  133.     IFrameWindow&               frameWindow() const;
  134.     IView&                      view() const;
  135. #ifdef IC_LIBRARYUSEONLY    
  136.     IFrameWindow&               inPlaceFrame() const;
  137.     IView&                      inPlaceView() const;
  138.     IFrameWindow&               objectFrame() const;
  139. #endif    
  140.     IView&                      objectView() const;
  141.     IMenuBar&                   objectMenuBar();
  142.     IToolBar&                   objectToolBar();
  143.  
  144.  
  145. /*----------------------------- Adopt/orphan ---------------------------------*/
  146.  
  147.     virtual Boolean             adoptComponent( IComponent* );
  148.     virtual Boolean             adoptFrameWindow( IComponentFrameWindow* );
  149.     virtual Boolean             adoptView( IView* );
  150.  
  151.  
  152. /*--------------------------- Command Handlers -------------------------------*/
  153.  
  154.     virtual Boolean             handleDefaultMenuCommands( ICommandEvent& );
  155.     virtual void                handleFileNew();
  156.     virtual void                handleFileOpen();
  157.     virtual void                handleFileSave();
  158.     virtual void                handleFileSaveAs( Boolean copy = false );
  159.     virtual void                handleCut();
  160.     virtual void                handleCopy();
  161.     virtual void                handlePaste();
  162.     virtual void                handlePasteSpecial();
  163.     virtual void                handlePasteLink();
  164.     virtual void                handleExit( Boolean close = false );
  165.     virtual void                handleInsertObject();
  166.     virtual void                handleEditLinks();
  167.     virtual void                handleDoVerb( unsigned iVerb );
  168.     virtual void                handleConvert();
  169.     virtual void                handleDelete();
  170.     virtual void                handleSelectAll( Boolean );
  171.  
  172.  
  173. /*------------------------------ Helper Methods ------------------------------*/
  174.  
  175. #ifdef IC_LIBRARYUSEONLY    
  176.     virtual void                createInPlaceWindows();
  177.     virtual Boolean             destroyInPlaceWindows();
  178. #endif    
  179.  
  180. protected:
  181.     virtual Boolean             okToDiscardFile();
  182. #ifdef IC_LIBRARYUSEONLY    
  183.     void                        useInPlaceWindows( Boolean use = true );
  184. #endif    
  185.  
  186. private:
  187. // Private members
  188.     IComponent*                 fpComponent;
  189.     IComponentFrameWindow*      fpFrameWindow;
  190.     IView*                      fpView;
  191.  
  192.     IView*                      fpInPlaceView;
  193.     IFrameWindow*               fpInPlaceFrame;
  194.  
  195.     // for menus and tools
  196.     IMenuBar*                   fpInPlaceBar;
  197.     IToolBar*                   fpInPlaceTools;
  198.  
  199.     ICommandConnectionTo<IGUIBundle>* fpMenuHandler;
  200.     IMainMenuHandler*           fpMainMenuHandler;
  201.  
  202.     Boolean                     fbSelectAll;
  203.     Boolean                     fbUsingInPlace;
  204.  
  205. friend class IComponentImp;
  206. friend class IMainMenuHandler;
  207. }; // class IGUIBundle
  208.  
  209.   #include <iguibndl.inl>
  210.  
  211.  
  212. #pragma pack()
  213.  
  214.  
  215. #endif // _IGUIBNDL_
  216.  
  217.