00001 /* -*- mode: C++; tab-width: 4; c-basic-offset: 4; -*- */ 00002 00003 /* AbiSource Application Framework 00004 * Copyright (C) 1998 AbiSource, Inc. 00005 * Copyright (C) 2002 William Lachance 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00020 * 02110-1301 USA. 00021 */ 00022 00023 #ifndef XAP_FrameImpl_H 00024 #define XAP_FrameImpl_H 00025 00026 #include "ut_types.h" 00027 #include "ut_vector.h" 00028 #include "gr_Graphics.h" 00029 00030 #define MAX_TITLE_LENGTH 256 00031 00032 class XAP_Frame; 00033 class XAP_App; 00034 class XAP_DialogFactory; 00035 class EV_Menu; 00036 class EV_Toolbar; 00037 class EV_Mouse; 00038 class EV_Keyboard; 00039 class UT_Timer; 00040 class UT_Worker; 00041 class GR_Graphics; 00042 class AV_View; 00043 00044 typedef enum _FrameModes 00045 { 00046 XAP_NormalFrame, // Normal Frame 00047 XAP_NoMenusWindowLess, // No toplevel window or menus 00048 XAP_WindowLess // No toplevel window but menus are OK. 00049 } XAP_FrameMode; 00050 00051 class ABI_EXPORT XAP_FrameImpl 00052 { 00053 public: 00054 XAP_Frame* getFrame() { return m_pFrame; }; /* needed for Obj-C access */ 00055 virtual XAP_FrameImpl * createInstance(XAP_Frame *pFrame) = 0; 00056 const UT_GenericVector<EV_Toolbar*> & _getToolbars() const 00057 { return m_vecToolbars; }; 00058 00059 virtual void notifyViewChanged(AV_View * pView); // default dows nothing 00060 00061 virtual void _createTopLevelWindow() = 0; 00062 protected: 00063 XAP_FrameImpl(XAP_Frame *pFrame); 00064 virtual ~XAP_FrameImpl(void); 00065 00066 friend class XAP_Frame; 00067 00068 void _startViewAutoUpdater(void); 00069 static void viewAutoUpdater(UT_Worker *wkr); 00070 00071 virtual bool _updateTitle(); 00072 00073 virtual void _initialize() = 0; 00074 virtual bool _close() = 0; 00075 virtual bool _raise() = 0; 00076 virtual bool _show() = 0; 00077 00078 virtual XAP_DialogFactory * _getDialogFactory() = 0; 00079 virtual EV_Toolbar * _newToolbar(XAP_Frame *frame, const char *szLayout, const char *szLanguage) = 0; 00080 virtual EV_Menu* _getMainMenu() = 0; 00081 virtual void _rebuildMenus(void)= 0; 00082 virtual void _createToolbars(); 00083 virtual void _refillToolbarsInFrameData() = 0; 00084 virtual void _rebuildToolbar(UT_uint32 ibar) = 0; 00085 // Useful to refresh the size of the Frame. For instance, 00086 // when the user selects hide statusbar, the Frame has to be 00087 // resized in order to fill the gap leaved by the statusbar 00088 virtual void _queue_resize() = 0; 00089 00090 virtual bool _runModalContextMenu(AV_View * pView, const char * szMenuName, 00091 UT_sint32 x, UT_sint32 y) = 0; 00092 virtual void _setFullScreen(bool isFullScreen) = 0; 00093 virtual void _hideMenuScroll(bool bHideMenuScroll) = 0; 00094 virtual void _nullUpdate () const = 0; 00095 virtual void _setCursor(GR_Graphics::Cursor cursor) = 0; 00096 00097 virtual UT_RGBColor getColorSelBackground () const; 00098 virtual UT_RGBColor getColorSelForeground () const; 00099 00100 EV_Mouse * m_pMouse; 00101 EV_Keyboard * m_pKeyboard; 00102 XAP_FrameMode m_iFrameMode; 00103 00104 UT_uint32 m_ViewAutoUpdaterID; 00105 UT_Timer * m_ViewAutoUpdater; 00106 00107 UT_Vector m_vecToolbarLayoutNames; 00108 const char * m_szToolbarLabelSetName; /* language for toolbars */ 00109 const char * m_szToolbarAppearance; 00110 UT_GenericVector<EV_Toolbar*> m_vecToolbars; 00111 00112 const char * m_szMenuLayoutName; 00113 const char * m_szMenuLabelSetName; /* language for menus */ 00114 00115 virtual void dragText() {} 00116 00117 private: 00118 XAP_Frame * m_pFrame; 00119 }; 00120 00121 #endif