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

fv_FrameEdit.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_FRAME_EDIT_H
00021 #define FV_FRAME_EDIT_H
00022 
00023 #include "pt_Types.h"
00024 #include "fl_FrameLayout.h"
00025 #include "fv_Base.h"
00026 
00027 typedef enum _FV_FrameEditMode
00028 {
00029     FV_FrameEdit_NOT_ACTIVE,
00030     FV_FrameEdit_WAIT_FOR_FIRST_CLICK_INSERT,
00031     FV_FrameEdit_RESIZE_INSERT,
00032     FV_FrameEdit_RESIZE_SELECTED_EXISTING,
00033     FV_FrameEdit_RESIZE_EXISTING,
00034     FV_FrameEdit_DRAG_EXISTING,
00035     FV_FrameEdit_EXISTING_SELECTED
00036 } FV_FrameEditMode;
00037 
00038 struct fv_FrameStrings
00039 {
00040     UT_String sXpos;
00041     UT_String sYpos;
00042     UT_String sColXpos;
00043     UT_String sColYpos;
00044     UT_String sPageXpos;
00045     UT_String sPageYpos;
00046     UT_String sWidth;
00047     UT_String sHeight;
00048     UT_String sPrefPage;
00049     UT_String sPrefColumn;
00050 };
00051 
00052 
00053 class ABI_EXPORT FV_FrameEdit : public FV_Base
00054 {
00055     friend class fv_View;
00056 
00057 public:
00058 
00059     FV_FrameEdit (FV_View * pView);
00060     ~FV_FrameEdit ();
00061     bool                  isActive(void) const;
00062     void                  abortDrag(void);
00063     UT_sint32             haveDragged(void) const;
00064     void                  setMode(FV_FrameEditMode iEditMode);
00065     FV_FrameEditMode      getFrameEditMode(void) const
00066         { return m_iFrameEditMode;}
00067     void                  mouseLeftPress(UT_sint32 x, UT_sint32 y);
00068     void                  mouseRelease(UT_sint32 x, UT_sint32 y);
00069     FV_DragWhat           mouseMotion(UT_sint32 x, UT_sint32 y);
00070     void                  drawFrame(bool bWithHandles);
00071     void                  deleteFrame(fl_FrameLayout * pFL = NULL);
00072     void                  setDragType(UT_sint32 x,UT_sint32 y, bool bDrawFrame);
00073     bool                  getFrameStrings(UT_sint32 x, UT_sint32 y,
00074                           fv_FrameStrings &FS,
00075                           fl_BlockLayout ** pCloseBL,
00076                           fp_Page ** pPage);
00077     fl_FrameLayout *      getFrameLayout(void) const
00078         { return m_pFrameLayout;}
00079     const char *          getPNGImage(UT_ConstByteBufPtr & ppByteBuf);
00080     void                  setPointInside(void);
00081     fp_FrameContainer *   getFrameContainer(void) { return m_pFrameContainer;}
00082     static void           _actuallyScroll(UT_Worker * pTimer);
00083     static void           _autoScroll(UT_Worker * pTimer);
00084     bool                  isImageWrapper(void) const;
00085 
00086 protected:
00087     virtual void          _mouseDrag(UT_sint32 x, UT_sint32 y);
00088 
00089 private:
00090     FV_FrameEditMode      m_iFrameEditMode;
00091     fl_FrameLayout *      m_pFrameLayout;
00092     fp_FrameContainer *   m_pFrameContainer;
00093     UT_sint32             m_iLastX;
00094     UT_sint32             m_iLastY;
00095     UT_sint32             m_iInitialDragX;
00096     UT_sint32             m_iInitialDragY;
00097     bool                  m_bInitialClick;
00098     GR_Image *            m_pFrameImage;
00099 
00100     // autoscroll stuff
00101     UT_Timer *            m_pAutoScrollTimer;
00102 
00103     //
00104     UT_sint32             m_iInitialFrameX;
00105     UT_sint32             m_iInitialFrameY;
00106 
00107     UT_String             m_sRelWidth;
00108     UT_String             m_sMinHeight;
00109     UT_String             m_sExpandHeight;
00110 };
00111 
00112 
00113 #endif /* FV_FRAME_EDIT_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1