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

ap_Frame.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2002 Dom Lachowicz and others
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef AP_FRAME_H
00021 #define AP_FRAME_H
00022 
00023 #include <vector>
00024 #include "ut_types.h"
00025 #include "xap_Frame.h"
00026 #include "ie_types.h"
00027 #include "ap_FrameListener.h"
00028 
00029 class AV_View;
00030 class ap_Scrollbar_ViewListener;
00031 class ap_ViewListener;
00032 class FL_DocLayout;
00033 
00034 class ABI_EXPORT AP_Frame : public XAP_Frame
00035 {
00036  public:
00037   AP_Frame(XAP_FrameImpl *pFrameImpl) : XAP_Frame(pFrameImpl),m_bShowMargin(false),m_bWordSelections(false) {}
00038     AP_Frame(AP_Frame *pFrame) : XAP_Frame(static_cast<XAP_Frame *>(pFrame)),m_bShowMargin(false){}
00039     virtual ~AP_Frame();
00040 
00041     virtual bool                initialize(XAP_FrameMode frameMode=XAP_NormalFrame) = 0;
00042     virtual XAP_Frame *         buildFrame(XAP_Frame * pFrame);
00043     virtual UT_Error            loadDocument(AD_Document* pDoc);
00044     virtual UT_Error            loadDocument(const char * szFilename, int ieft);
00045     virtual UT_Error            loadDocument(const char * szFilename, int ieft, bool createNew);
00046     virtual UT_Error            loadDocument(GsfInput * input, int ieft);
00047     virtual UT_Error            importDocument(const char * szFilename, int ieft, bool markClean);
00048     virtual bool                initFrameData(void);
00049     virtual void                killFrameData(void);
00050     UT_uint32                   getNewZoom(XAP_Frame::tZoomType * tZoom);
00051     virtual void                setZoomPercentage(UT_uint32 iZoom);
00052     virtual UT_uint32           getZoomPercentage(void);
00053     virtual void                quickZoom(UT_uint32 iZoom);
00054     bool                        isShowMargin(void) const
00055     { return m_bShowMargin;}
00056     void                        setShowMargin(bool b)
00057     { m_bShowMargin = b;}
00058     void                        setDoWordSelections(bool b)
00059     { m_bWordSelections = b;}
00060     bool                        getDoWordSelections(void) const
00061     { return m_bWordSelections;}
00062 
00063     UT_sint32                   registerListener(AP_FrameListener* pListener);
00064     void                        unregisterListener(UT_sint32 iListenerId);
00065 
00066  protected:
00067 
00068     UT_Error _loadDocument(const char * szFilename, IEFileType ieft, bool createNew);
00069     UT_Error _loadDocument(GsfInput * input, IEFileType ieft);
00070     virtual UT_Error _importDocument(const char * szFilename, int ieft, bool markClean);
00071     UT_Error _replaceDocument(AD_Document * pDoc);
00072     virtual UT_Error _showDocument(UT_uint32 iZoom = 100);
00073 
00074     // helper methods for _showDocument
00075     virtual bool _createViewGraphics(GR_Graphics *& pG, UT_uint32 iZoom) = 0;
00076     virtual void _replaceView(GR_Graphics * pG, FL_DocLayout *pDocLayout,
00077               AV_View *pView, AV_ScrollObj * pScrollObj,
00078               ap_ViewListener *pViewListener, AD_Document *pOldDoc,
00079               ap_Scrollbar_ViewListener *pScrollbarViewListener,
00080               AV_ListenerId lid, AV_ListenerId lidScrollbarViewListener,
00081               UT_uint32 iZoom);
00082     virtual bool _createScrollBarListeners(AV_View * pView, AV_ScrollObj *& pScrollObj,
00083                        ap_ViewListener *& pViewListener,
00084                        ap_Scrollbar_ViewListener *& pScrollbarViewListener,
00085                        AV_ListenerId &lid,
00086                        AV_ListenerId &lidScrollbarViewListener) = 0;
00087     virtual void _bindToolbars(AV_View *pView) = 0;
00088     virtual void _setViewFocus(AV_View *pView) = 0;
00089 
00090     // helper methods for helper methods for _showDocument (meta-helper-methods?) :-)
00091     virtual UT_sint32 _getDocumentAreaWidth() = 0;
00092     virtual UT_sint32 _getDocumentAreaHeight() = 0;
00093 
00094     void _signal(AP_FrameSignal sig);
00095 
00096  private:
00097     bool    m_bShowMargin;
00098     bool    m_bWordSelections;
00099     std::vector<AP_FrameListener*> m_listeners;
00100 };
00101 #endif // AP_FRAME_H

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1