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 <string>
00024
00025 #include "pt_Types.h"
00026 #include "fl_FrameLayout.h"
00027 #include "fv_FrameEdit.h"
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;
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
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