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

fv_InlineImage.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (c) 2005 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_VISUALINLINEIMAGE_H
00021 #define FV_VISUALINLINEIMAGE_H
00022 
00023 #include <string>
00024 
00025 #include "pt_Types.h"
00026 #include "fl_FrameLayout.h"
00027 #include "fv_FrameEdit.h" // for FV_Base
00028 
00029 
00030 typedef enum _FV_InlineDragMode
00031 {
00032     FV_InlineDrag_NOT_ACTIVE,
00033     FV_InlineDrag_WAIT_FOR_MOUSE_CLICK,
00034     FV_InlineDrag_WAIT_FOR_MOUSE_DRAG,
00035     FV_InlineDrag_DRAGGING,
00036     FV_InlineDrag_RESIZE,
00037     FV_InlineDrag_START_DRAGGING
00038 } FV_InlineDragMode;
00039 
00040 class GR_Graphics;
00041 class GR_Image;
00042 class FV_View;
00043 class PP_AttrProp;
00044 class UT_ByteBuf;
00045 
00046 class ABI_EXPORT FV_VisualInlineImage : public FV_Base
00047 {
00048     friend class fv_View;
00049 
00050 public:
00051 
00052     FV_VisualInlineImage (FV_View * pView);
00053     ~FV_VisualInlineImage();
00054     bool                  isActive(void) const;
00055     void                      setMode(FV_InlineDragMode iInlineDragMode);
00056     FV_InlineDragMode     getInlineDragMode(void) const
00057         { return m_iInlineDragMode;}
00058     void                  setDragType(UT_sint32 x,UT_sint32 y, bool bDrawImage);
00059     FV_DragWhat           mouseMotion(UT_sint32 x, UT_sint32 y);
00060     void                  mouseLeftPress(UT_sint32 x, UT_sint32 y);
00061     void                  mouseCut(UT_sint32 x, UT_sint32 y);
00062     void                  mouseCopy(UT_sint32 x, UT_sint32 y);
00063     void                  mouseRelease(UT_sint32 x, UT_sint32 y);
00064     bool                  drawImage(void);
00065     void                  getImageFromSelection(UT_sint32 x, UT_sint32 y,PP_AttrProp ** pAP = NULL );
00066     PP_AttrProp *         getImageAPFromXY(UT_sint32 x, UT_sint32 y);
00067     PT_DocPosition        getPosFromXY(UT_sint32 x, UT_sint32 y) const;
00068     void                  drawCursor(PT_DocPosition newPos);
00069     static void           _actuallyScroll(UT_Worker * pTimer);
00070     static void           _autoScroll(UT_Worker * pTimer);
00071     void                  clearCursor(void);
00072     void                  cleanUP(void);
00073     void                  abortDrag(void);
00074     const char *          getPNGImage(UT_ConstByteBufPtr & pBuf) const;
00075     UT_sint32             getImageSelBoxSize() const; // in device units!
00076     void                  setSelectionDrawn(bool bSelectionDrawn);
00077 protected:
00078     virtual void          _mouseDrag(UT_sint32 x, UT_sint32 y);
00079 private:
00080     FV_InlineDragMode     m_iInlineDragMode;
00081     GR_Image *            m_pDragImage;
00082     UT_sint32             m_iLastX;
00083     UT_sint32             m_iLastY;
00084     UT_sint32             m_iInitialOffX;
00085     UT_sint32             m_iInitialOffY;
00086     bool                  m_bTextCut;
00087     GR_Image *            m_pDocUnderCursor;
00088     bool                  m_bCursorDrawn;
00089     UT_Rect               m_recCursor;
00090 
00091     // autoscroll stuff
00092     UT_Timer *            m_pAutoScrollTimer;
00093 
00094     bool                  m_bDoingCopy;
00095     PP_AttrProp *         m_pImageAP;
00096     GR_Image *            m_screenCache;
00097     std::string           m_sCopyName;
00098     bool                  m_bIsEmbedded;
00099     bool                  m_bEmbedCanResize;
00100     std::string           m_sDataId;
00101     bool                  m_bSelectionDrawn;
00102 };
00103 
00104 #endif /* FV_VISUALINLINEIMAGE_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1