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

fv_VisualDragText.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_VISUALDRAGTEXT_H
00021 #define FV_VISUALDRAGTEXT_H
00022 
00023 #include "pt_Types.h"
00024 #include "fl_FrameLayout.h"
00025 
00026 typedef enum _FV_VisualDragMode
00027 {
00028     FV_VisualDrag_NOT_ACTIVE,
00029     FV_VisualDrag_WAIT_FOR_MOUSE_CLICK,
00030     FV_VisualDrag_WAIT_FOR_MOUSE_DRAG,
00031     FV_VisualDrag_DRAGGING,
00032     FV_VisualDrag_START_DRAGGING
00033 } FV_VisualDragMode;
00034 
00035 class GR_Graphics;
00036 class GR_Image;
00037 class FV_View;
00038 
00039 class ABI_EXPORT FV_VisualDragText
00040 {
00041     friend class fv_View;
00042 
00043 public:
00044 
00045     FV_VisualDragText (FV_View * pView);
00046     virtual ~FV_VisualDragText();
00047     GR_Graphics *         getGraphics(void) const ;
00048     bool                  isActive(void) const;
00049     void                  setMode(FV_VisualDragMode iVisualDragMode);
00050     FV_VisualDragMode      getVisualDragMode(void) const
00051         { return m_iVisualDragMode;}
00052     virtual void          mouseDrag(UT_sint32 x, UT_sint32 y);
00053     void                  mouseCut(UT_sint32 x, UT_sint32 y);
00054     void                  mouseCopy(UT_sint32 x, UT_sint32 y);
00055     void                  mouseRelease(UT_sint32 x, UT_sint32 y);
00056     void                  drawImage(void);
00057     void                  getImageFromSelection(UT_sint32 x, UT_sint32 y);
00058     bool                  reposOffsets(UT_sint32 x, UT_sint32 y);
00059     PT_DocPosition        getPosFromXY(UT_sint32 x, UT_sint32 y);
00060     void                  drawCursor(PT_DocPosition newPos);
00061     static void           _actuallyScroll(UT_Worker * pTimer);
00062     static void           _autoScroll(UT_Worker * pTimer);
00063     void                  clearCursor(void);
00064     void                  abortDrag(void);
00065     bool                  isNotdraggingImage(void)
00066       { return m_bNotDraggingImage;}
00067     bool                  isDoingCopy(void)
00068       { return m_bDoingCopy;}
00069     UT_Rect *             getCurFrame(void)
00070       { return &m_recCurFrame;}
00071  protected:
00072     void                  _mouseDrag(UT_sint32 x, UT_sint32 y);
00073     FV_View *             m_pView;
00074 private:
00075     FV_VisualDragMode     m_iVisualDragMode;
00076     GR_Image *            m_pDragImage;
00077     UT_sint32             m_iLastX;
00078     UT_sint32             m_iLastY;
00079     UT_Rect               m_recCurFrame;
00080     UT_sint32             m_iInitialOffX;
00081     UT_sint32             m_iInitialOffY;
00082     UT_Rect               m_recOrigLeft;
00083     UT_Rect               m_recOrigRight;
00084     bool                  m_bTextCut;
00085     GR_Image *            m_pDocUnderCursor;
00086     bool                  m_bCursorDrawn;
00087     UT_Rect               m_recCursor;
00088     UT_Rect               m_recDoc;
00089 
00090     // autoscroll stuff
00091     UT_Timer *            m_pAutoScrollTimer;
00092     UT_sint32             m_xLastMouse;
00093     UT_sint32             m_yLastMouse;
00094 
00095     bool                  m_bDoingCopy;
00096     bool                  m_bNotDraggingImage;
00097     bool                  m_bSelectedRow;
00098 };
00099 
00100 #endif /* FV_VISUALDRAGTEXT_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1