• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

xap_Win32FrameImpl.h

Go to the documentation of this file.
00001 /* AbiSource Application Framework
00002  * Copyright (C) 1998-2000 AbiSource, Inc.
00003  * Copyright (C) 2002
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 
00022 #ifndef XAP_WIN32FRAMEIMPL_H
00023 #define XAP_WIN32FRAMEIMPL_H
00024 
00025 #include <windows.h>
00026 #include <winuser.h>
00027 #include "xap_FrameImpl.h"
00028 #include "xap_Win32App.h"
00029 #include "xap_Win32DialogFactory.h"
00030 #include "xap_Win32DragAndDrop.h"
00031 
00032 #include "ev_Win32Keyboard.h"
00033 #include "ev_Win32Mouse.h"
00034 #include "ev_Win32Menu.h"
00035 #include "ev_Win32Toolbar.h"
00036 
00037 
00038 /********************************************************************
00039 *********************************************************************
00040 ** This file defines the Win32-platform-specific class for the
00041 ** cross-platform application frame helper.  This is used to hold all
00042 ** Win32-specific data.  One of these is created for each top-level
00043 ** document window.
00044 *********************************************************************
00045 ********************************************************************/
00046 
00047 class ABI_EXPORT XAP_Win32FrameImpl : public XAP_FrameImpl
00048 {
00049  public:
00050     XAP_Win32FrameImpl(XAP_Frame *pFrame);
00051     virtual ~XAP_Win32FrameImpl(void);
00052 
00053     virtual XAP_FrameImpl * createInstance(XAP_Frame *pFrame) = 0;
00054 
00055     inline HWND getTopLevelWindow(void) const   {  return _getTopLevelWindow();  }
00056     inline HWND getToolbarWindow(void) const        {  return m_hwndRebar;  }
00057 
00058 protected:
00059     friend class XAP_Frame;
00060 
00061     virtual UT_RGBColor getColorSelBackground () const;
00062     virtual UT_RGBColor getColorSelForeground () const;
00063 
00064 #if 0
00065     void _startViewAutoUpdater(void);
00066     static void viewAutoUpdater(UT_Worker *wkr);
00067 #endif
00068 
00069     virtual bool _updateTitle(void);
00070 
00071     virtual void _initialize(void);
00072     virtual bool _close(void);
00073     virtual bool _raise(void);
00074     virtual bool _show(void);
00075 
00076     virtual XAP_DialogFactory * _getDialogFactory(void);
00077     virtual EV_Toolbar * _newToolbar(XAP_Frame *frame, const char *szLayout, const char *szLanguage);
00078     virtual EV_Menu* _getMainMenu(void);
00079     virtual void _rebuildMenus(void);
00080 
00081     // Useful to refresh the size of the Frame.  For instance,
00082     // when the user selects hide statusbar, the Frame has to be
00083     // resized in order to fill the gap leaved by the statusbar
00084     virtual void _queue_resize(void);
00085 
00086     virtual bool _runModalContextMenu(AV_View * pView, const char * szMenuName,
00087                                       UT_sint32 x, UT_sint32 y);
00088     virtual void _setFullScreen(bool isFullScreen);
00089     virtual void _nullUpdate (void) const;
00090     virtual void _setCursor(GR_Graphics::Cursor cursor);
00091 
00092     static bool _RegisterClass(XAP_Win32App * app);
00093 
00094     /*** Win32 help functions ***/
00095     virtual void                _translateDocumentToScreen(UT_sint32 &x, UT_sint32 &y) = 0;
00096     virtual HWND                _getTopLevelWindow(void) const {  return m_hwndFrame;  }
00097 
00098     virtual HWND                _createDocumentWindow(XAP_Frame *pFrame, HWND hwndParent,
00099                                 UT_uint32 iLeft, UT_uint32 iTop, UT_uint32 iWidth, UT_uint32 iHeight) = 0;
00100     virtual HWND                _createStatusBarWindow(XAP_Frame *pFrame, HWND hwndParent,
00101                                 UT_uint32 iLeft, UT_uint32 iTop, UT_uint32 iWidth) = 0;
00102     void                        _createTopLevelWindow(void);
00103 
00104     void                        _setHwndRebar(HWND hWnd)     {  m_hwndRebar = hWnd;  }
00105     HWND                        _getHwndRebar(void)          {  return m_hwndRebar;  }
00106     void                        _setHwndContainer(HWND hWnd) {  m_hwndContainer = hWnd;  }
00107     HWND                        _getHwndContainer(void)      {  return m_hwndContainer;  }
00108     void                        _setHwndStatusBar(HWND hWnd) {  m_hwndStatusBar = hWnd;  }
00109     HWND                        _getHwndStatusBar(void)      {  return m_hwndStatusBar;  }
00110 
00111     UT_uint32                   _getBarHeight(void) { return m_iBarHeight; }
00112     void                        _setBarHeight(UT_uint32 iBarHeight) { m_iBarHeight = iBarHeight; }
00113     UT_uint32                   _getSizeWidth(void) { return m_iSizeWidth; }
00114     UT_uint32                   _getSizeHeight(void) { return m_iSizeHeight; }
00115 
00117     static LRESULT CALLBACK         _FrameWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00118 
00119 private:
00120     HWND                        m_hwndFrame; /* the entire window, menu, toolbar, document, etc. */
00121     HWND                        m_hwndRebar;
00122     HWND                        m_hwndContainer; /* the document and all rulers and scroll bars */
00123     HWND                        m_hwndStatusBar;
00124 
00125     AP_Win32DialogFactory           m_dialogFactory;    /* class defined[.h] in XAP, implemented[.cpp] in AP */
00126 
00127     EV_Win32MenuBar *               m_pWin32Menu;
00128     EV_Win32MenuPopup *         m_pWin32Popup; /* only valid while a context popup is up */
00129     UT_uint32                   m_iBarHeight;
00130     UT_uint32                   m_iStatusBarHeight;
00131     UT_uint32                   m_iRealSizeHeight;
00132     UT_uint32                   m_iRealSizeWidth;
00133     UT_uint32                   m_iWindowStateBeforeFS; /* was Abi maximized/normal/minimized before we went full-screen */
00134     UT_uint32                   m_iWindowXBeforeFS;
00135     UT_uint32                   m_iWindowYBeforeFS;
00136     UT_uint32                   m_iWindowHeightBeforeFS;
00137     UT_uint32                   m_iWindowWidthBeforeFS;
00138 
00139     UINT                        m_mouseWheelMessage;
00140     XAP_Win32DropTarget         m_dropTarget;
00141 
00142     /* These 2 variables are used in the frame
00143     ** to remember the last values we used to set
00144     ** the size of client area of the frame (on
00145     ** a resize of the frame window).  That is,
00146     ** the values we used to calculate the layout
00147     ** of the various toolbars, view, and anything
00148     ** else that goes in the frame window.  We do
00149     ** this because Win32 plays funny games with
00150     ** window sizes (NonClient vs Client coordinates).
00151     ** We do this so that we can short-circuit some
00152     ** of the resizing and the resulting flashing.
00153     */
00154     UT_uint32                   m_iSizeWidth;
00155     UT_uint32                   m_iSizeHeight;
00156 
00157 public:
00158 
00159     UT_UTF8String               m_sColorBack;
00160     UT_UTF8String               m_sColorFore;
00161 
00162 };
00163 
00164 #endif /* XAP_WIN32FRAME_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1