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
00021
00022 #ifndef __gr_AbiGOComponentManager_h__
00023 #define __gr_AbiGOComponentManager_h__
00024 #include "gr_EmbedManager.h"
00025 #include <goffice/component/goffice-component.h>
00026 #include <goffice/component/go-component.h>
00027
00028
00029 class GR_Graphics;
00030 class PD_Document;
00031 class AD_Document;
00032 class GOComponentView;
00033 class GR_AbiGOComponentItems;
00034
00035 class GR_AbiGOComponentItems
00036 {
00037 public:
00038 GR_AbiGOComponentItems();
00039 virtual ~GR_AbiGOComponentItems();
00040 UT_uint32 m_iAPI;
00041 bool m_bHasSnapshot;
00042 };
00043
00044 class GR_GOComponentManager : public GR_EmbedManager
00045 {
00046 public:
00047 GR_GOComponentManager(GR_Graphics * pG);
00048 virtual ~GR_GOComponentManager();
00049 virtual GR_EmbedManager * create(GR_Graphics * pG);
00050 virtual const char * getObjectType(void) const;
00051 virtual void initialize(void);
00052 virtual UT_sint32 makeEmbedView(AD_Document * pDoc, UT_uint32 api, const char * szDataID) ;
00053 virtual void setColor(UT_sint32 uid, UT_RGBColor c);
00054 virtual UT_sint32 getWidth(UT_sint32 uid);
00055 virtual UT_sint32 getAscent(UT_sint32 uid) ;
00056 virtual UT_sint32 getDescent(UT_sint32 uid) ;
00057 virtual void loadEmbedData(UT_sint32 uid);
00058 virtual void setDefaultFontSize(UT_sint32 uid, UT_sint32 iSize);
00059 virtual void render(UT_sint32 uid, UT_Rect & rec);
00060 virtual void releaseEmbedView(UT_sint32 uid);
00061 virtual void initializeEmbedView(UT_sint32 uid);
00062 virtual void makeSnapShot(UT_sint32 uid, UT_Rect & rec);
00063 virtual bool isDefault(void);
00064 virtual bool modify(UT_sint32 uid);
00065 virtual bool convert(UT_uint32 iConv, UT_ByteBuf & From, UT_ByteBuf & To);
00066 virtual bool isEdittable(UT_sint32 uid);
00067 virtual bool isResizeable(UT_sint32 uid);
00068 virtual void setRun (UT_sint32 uid, fp_Run * run);
00069 virtual void updateData(UT_sint32 uid, UT_sint32 api);
00070
00071 private:
00072 UT_sint32 _makeGOComponentView(void);
00073 UT_sint32 _getNextUID(void);
00074 UT_sint32 m_CurrentUID;
00075 UT_GenericVector<GOComponentView *> m_vecGOComponentView;
00076 UT_GenericVector<GR_AbiGOComponentItems *> m_vecItems;
00077 PD_Document * m_pDoc;
00078 };
00079
00080
00081 class GOComponentView
00082 {
00083 friend class GR_GOComponentManager;
00084 public:
00085 GOComponentView(GR_GOComponentManager * pGOMan);
00086 virtual ~GOComponentView(void);
00087 void render(UT_Rect & rec);
00088 void loadBuffer(UT_ByteBuf const *sGOComponentData, const char *_mime_type);
00089 void setDefaultFontSize(UT_sint32 iSize);
00090 void modify(void);
00091 void update (void);
00092 GOComponent *getComponent (void) {return component;}
00093 bool IsEdittable () {return go_component_is_editable (component);}
00094 bool IsResizable () {return go_component_is_resizable (component);}
00095 UT_ByteBuf *getSnapShot (std::string &mime_type);
00096 void SetRun (fp_Run *pRun) {m_pRun = pRun;}
00097
00098 private:
00099 GR_GOComponentManager * m_pGOMan;
00100 GOComponent *component;
00101 std::string mime_type;
00102 GR_Image *m_Image;
00103 UT_sint32 width, ascent, descent;
00104 UT_sint32 pix_width, pix_height;
00105 GdkPixbuf *pixbuf;
00106 GdkWindowAttr attributes;
00107 fp_Run *m_pRun;
00108 };
00109
00110 bool AbiGOComponent_FileInsert(AV_View* v, EV_EditMethodCallData *d);
00111 bool AbiGOComponent_Create(AV_View* v, EV_EditMethodCallData *d);
00112
00113 #endif // __gr_AbiGOComponentManager_h__