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

ap_Win32FrameImpl.h

Go to the documentation of this file.
00001 /* AbiWord
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 #ifndef AP_WIN32FRAMEIMPL_H
00022 #define AP_WIN32FRAMEIMPL_H
00023 
00024 #include "ap_Frame.h"
00025 #include "xap_Win32FrameImpl.h"
00026 #include "ap_FrameData.h"
00027 #include "gr_Win32Graphics.h"
00028 #include <wchar.h>
00029 
00030 class AP_Win32Frame;
00031 
00032 class ABI_EXPORT AP_Win32FrameImpl : public XAP_Win32FrameImpl
00033 {
00034  public:
00035     AP_Win32FrameImpl(AP_Frame *pFrame);
00036     ~AP_Win32FrameImpl(void);
00037     virtual XAP_FrameImpl * createInstance(XAP_Frame *pFrame);
00038 
00039     virtual UT_RGBColor getColorSelBackground () const;
00040 
00041     HWND                        getHwndDocument(void)  {  return m_hwndDocument;  }
00042 
00043     GR_Win32Graphics *          createDocWndGraphics(void);
00044 
00045  protected:
00046     friend class AP_Win32Frame;
00047 
00048     virtual void _initialize(void);
00049 
00050     virtual void _refillToolbarsInFrameData();
00051     virtual void _rebuildToolbar(UT_uint32 ibar);
00052     virtual void _bindToolbars(AV_View *pView);
00053 
00054     virtual void                _toggleBar(UT_uint32 iBarNb, bool bBarOn);
00055 
00056     void                        _showOrHideToolbars(void);
00057     void                        _showOrHideStatusbar(void);
00058 
00059     virtual void                _hideMenuScroll(bool bHideMenuScroll);
00060 
00061     virtual void                _toggleTopRuler(AP_Win32Frame *pFrame, bool bRulerOn);
00062     virtual void                _toggleLeftRuler(AP_Win32Frame *pFrame, bool bRulerOn);
00063 
00064     void _translateDocumentToScreen(UT_sint32 &x, UT_sint32 &y);
00065 
00066     virtual void                _setXScrollRange(AP_FrameData * pData, AV_View *pView);
00067     virtual void                _setYScrollRange(AP_FrameData * pData, AV_View *pView);
00068     virtual void                _scrollFuncX(UT_sint32 xoff, UT_sint32 xlimit);
00069     virtual void                _scrollFuncY(UT_sint32 yoff, UT_sint32 ylimit);
00070 
00071     static bool _RegisterClass(XAP_Win32App * app);
00072 
00073 
00074     HWND                        _getHwndContainer(void) {  return m_hwndContainer; }
00075     HWND                        _getHwndTopRuler(void)  {  return m_hwndTopRuler;  }
00076     HWND                        _getHwndLeftRuler(void) {  return m_hwndLeftRuler; }
00077     //  HWND                    _getHwndDocument(void)  {  return m_hwndDocument;  } now public
00078     HWND                        _getHwndHScroll(void)   {  return m_hWndHScroll;   }
00079     HWND                        _getHwndVScroll(void)   {  return m_hWndVScroll;   }
00080 
00081     void                        _updateContainerWindow(void) { UpdateWindow(_getHwndContainer()); }
00082 
00083     void                        _setVerticalScrollInfo(const SCROLLINFO * psi);
00084     void                        _getVerticalScrollInfo(SCROLLINFO * psi);
00085 
00086     //void                      _createRulers(XAP_Frame *pFrame) {  _createTopRuler(pFrame); _createLeftRuler(pFrame);  }
00087 
00088     HWND                        _createDocumentWindow(XAP_Frame *pFrame, HWND hwndParent,
00089                                                       UT_uint32 iLeft, UT_uint32 iTop,
00090                                                       UT_uint32 iWidth, UT_uint32 iHeight);
00091     HWND                        _createStatusBarWindow(XAP_Frame *pFrame, HWND hwndParent,
00092                                                        UT_uint32 iLeft, UT_uint32 iTop,
00093                                                        UT_uint32 iWidth);
00094 
00095     // helper methods for helper methods for _showDocument (meta-helper-methods?) :-)
00096     void                        _getDocumentArea(RECT &r);
00097     virtual                     UT_sint32 _getDocumentAreaWidth(void);
00098     virtual                     UT_sint32 _getDocumentAreaHeight(void);
00099 
00100 /***************************************/
00101 
00102  private:
00103     void                        _createTopRuler(XAP_Frame *pFrame);
00104     void                        _createLeftRuler(XAP_Frame *pFrame);
00105     void                        _getRulerSizes(AP_FrameData * pData, int &yTopRulerHeight, int &xLeftRulerWidth);
00106     void                        _onSize(AP_FrameData * pData, int nWidth, int nHeight);
00107 
00108     static int                  _getMouseWheelLines();
00109 
00110     void                        _startTracking(UT_sint32 x, UT_sint32 y);
00111     void                        _endTracking(UT_sint32 x, UT_sint32 y);
00112     void                        _track(UT_sint32 x, UT_sint32 y);
00113     bool                        _isTracking() const { return m_bMouseWheelTrack; }
00114 
00116     static LRESULT CALLBACK         _ContainerWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00117     static LRESULT CALLBACK         _DocumentWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00118     //static LRESULT CALLBACK       _LeftRulerWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
00119 
00120  private:
00121     HWND                        m_hwndContainer;
00122     HWND                        m_hwndTopRuler;
00123     HWND                        m_hwndLeftRuler;
00124     HWND                        m_hwndDocument; /* the actual document window */
00125 
00126     HWND                        m_hWndHScroll;
00127     HWND                        m_hWndVScroll;
00128     HWND                        m_hWndGripperHack;
00129 
00130     UT_uint32                   m_vScale; /* vertical scroll scaling to get around 16-bit scrollbar problems */
00131 
00132     bool                        m_bMouseWheelTrack;
00133     UT_sint32                   m_startMouseWheelY;
00134     UT_sint32                   m_startScrollPosition;
00135     bool                        m_bMouseActivateReceived;
00136 
00137     #define MAXDOCWNDCLSNMSIZE 256
00138     #define MAXCNTWNDCLSNMSIZE 256
00139     static wchar_t s_ContainerWndClassName[MAXCNTWNDCLSNMSIZE];
00140     static wchar_t s_DocumentWndClassName[MAXDOCWNDCLSNMSIZE];
00141 };
00142 
00143 #endif /* AP_WIN32FRAMEIMPL_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1