Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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"
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;
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
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