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

Generated on Sun May 27 2012 for AbiWord by  doxygen 1.7.1