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

fv_Base.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (c) 2003 Martin Sevior <msevior@physics.unimelb.edu.au>
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 FV_BASE_H
00021 #define FV_BASE_H
00022 
00023 typedef enum _FV_DragWhat
00024 {
00025     FV_DragNothing,
00026     FV_DragTopLeftCorner,
00027     FV_DragTopRightCorner,
00028     FV_DragBotLeftCorner,
00029     FV_DragBotRightCorner,
00030     FV_DragLeftEdge,
00031     FV_DragTopEdge,
00032     FV_DragRightEdge,
00033     FV_DragBotEdge,
00034     FV_DragWhole
00035 } FV_DragWhat;
00036 
00037 class FL_DocLayout;
00038 class PD_Document;
00039 class GR_Graphics;
00040 class FV_View;
00041 class GR_Image;
00042 class fp_Page;
00043 
00047 class ABI_EXPORT FV_Base
00048 {
00049 public:
00050     FV_Base( FV_View* pView );
00051     virtual ~FV_Base();
00052     PD_Document *           getDoc(void) const;
00053     FL_DocLayout *          getLayout(void) const;
00054     GR_Graphics *           getGraphics(void) const;
00055     inline FV_View *        getView(void) const
00056         { return m_pView;}
00057     UT_sint32               getGlobCount(void) const;
00058     void                    mouseDrag(UT_sint32 x, UT_sint32 y);    // non virtual calling virtual _mouseDrag
00059     FV_DragWhat             getDragWhat(void) const
00060         { return m_iDraggingWhat; }
00061     void                    setDragWhat( FV_DragWhat iDragWhat )
00062         { m_iDraggingWhat = iDragWhat; }
00063 
00064 protected:
00065     FV_View *               m_pView;
00066     UT_sint32               m_iGlobCount;
00067     UT_Rect                 m_recCurFrame;
00068     bool                    m_bFirstDragDone;
00069     UT_sint32               m_iFirstEverX;
00070     UT_sint32               m_iFirstEverY;
00071     UT_sint32               m_xLastMouse;
00072     UT_sint32               m_yLastMouse;
00073 
00074     void                    _beginGlob();
00075     void                    _endGlob();
00076     virtual void            _mouseDrag(UT_sint32 x, UT_sint32 y) = 0;
00077     void                    _doMouseDrag(UT_sint32 x, UT_sint32 y, UT_sint32& dx, UT_sint32& dy, UT_Rect& expX, UT_Rect& expY);
00078     void                    _checkDimensions();
00079 
00080 private:
00081     FV_DragWhat             m_iDraggingWhat;    // made private on purpose
00082 };
00083 
00084 #endif

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1