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

AbiGOChart.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2004 Luca Padovani <lpadovan@cs.unibo.it>
00003  * Copyright (C) 2005 Martin Sevior <msevior@physics.unimelb.edu.au>
00004  * Copyright (C) 2005 Jean Brefort <jean.brefort@normalesup.org>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00019  * USA
00020  */
00021 
00022 #ifndef __gr_AbiGOChartManager_h__
00023 #define __gr_AbiGOChartManager_h__
00024 #include "ut_string_class.h"
00025 #include "gr_EmbedManager.h"
00026 #include "ut_types.h"
00027 #include "ut_vector.h"
00028 #include <goffice/goffice.h>
00029 
00030 
00031 class GR_Graphics;
00032 class PD_Document;
00033 class AD_Document;
00034 class GOChartView;
00035 class GR_AbiGOChartItems;
00036 
00037 class GR_AbiGOChartItems
00038 {
00039  public:
00040   GR_AbiGOChartItems();
00041   virtual ~GR_AbiGOChartItems();
00042   UT_uint32 m_iAPI;
00043   bool m_bHasSnapshot;
00044 };
00045 
00046 class GR_GOChartManager : public GR_EmbedManager
00047 {
00048 public:
00049     GR_GOChartManager(GR_Graphics * pG);
00050     virtual ~GR_GOChartManager();
00051     virtual GR_EmbedManager *  create(GR_Graphics * pG);
00052     virtual const char *   getObjectType(void) const;
00053     virtual void           initialize(void);
00054     virtual UT_sint32      makeEmbedView(AD_Document * pDoc, UT_uint32  api, const char * szDataID) ;
00055     virtual void           setColor(UT_sint32 uid, UT_RGBColor c);
00056     virtual UT_sint32      getWidth(UT_sint32 uid);
00057     virtual UT_sint32      getAscent(UT_sint32 uid) ;
00058     virtual UT_sint32      getDescent(UT_sint32 uid) ;
00059     virtual void           loadEmbedData(UT_sint32 uid);
00060     virtual void           setDefaultFontSize(UT_sint32 uid, UT_sint32 iSize);
00061     virtual void           render(UT_sint32 uid, UT_Rect & rec);
00062     virtual void           releaseEmbedView(UT_sint32 uid);
00063     virtual void           initializeEmbedView(UT_sint32 uid);
00064     virtual void           makeSnapShot(UT_sint32 uid, UT_Rect & rec);
00065     virtual bool           isDefault(void);
00066     virtual bool           modify(UT_sint32 uid);
00067     virtual bool           convert(UT_uint32 iConv, UT_ByteBuf & From, UT_ByteBuf & To);
00068     virtual void           updateData(UT_sint32 uid, UT_sint32 api);
00069 
00070     virtual bool           isEdittable(UT_sint32 uid);
00071     virtual void           setRun (UT_sint32 uid, fp_Run * run);
00072     EV_EditMouseContext     getContextualMenu(void) const
00073         { return ChartMenuID; }
00074     static void             buildContextualMenu ();
00075     static void             removeContextualMenu ();
00076 
00077     static GOChartView * last_created_view;
00078 
00079 private:
00080     UT_sint32                              _makeGOChartView(void);
00081     void                                    _loadGOChartXML(UT_sint32 uid, UT_UTF8String & sGOChartBuf);
00082     UT_sint32                              _getNextUID(void);
00083     UT_sint32                              m_CurrentUID;
00084     UT_GenericVector<GOChartView *>        m_vecGOChartView;
00085     UT_GenericVector<GR_AbiGOChartItems *>    m_vecItems;
00086     PD_Document *                          m_pDoc;
00087     static EV_EditMouseContext ChartMenuID;
00088 };
00089 
00090 // FIXME wrapper for libGNOMEOFFICEChart object
00091 class GOChartView
00092 {
00093 public:
00094     GOChartView(GR_GOChartManager  * pGOMan);
00095     virtual ~GOChartView(void);
00096     void render(UT_Rect & rec);
00097     void loadBuffer(UT_UTF8String & sGOChartXM);
00098     void setDefaultFontSize(UT_sint32 iSize);
00099     void modify(void);
00100     void SetRun (fp_Run *pRun) {m_pRun = pRun;}
00101     fp_Run *getRun () {return m_pRun;}
00102     void SetGuru (GtkWidget *guru) {m_Guru = guru;}
00103     UT_ByteBuf *exportToPNG ();
00104     UT_ByteBuf *exportToSVG ();
00105     UT_sint32 getWidth() {return width;}
00106     UT_sint32 getHeight() {return height;}
00107 private:
00108     GR_GOChartManager  * m_pGOMan;
00109     GogGraph *m_Graph;
00110     GogRenderer *m_Renderer;
00111     GR_Image *m_Image;
00112     UT_sint32 width, height;
00113     UT_sint32 pix_width;
00114     UT_sint32 pix_height;
00115     fp_Run *m_pRun;
00116     GtkWidget *m_Guru;
00117 };
00118 
00119 bool AbiGOChart_Create(AV_View* v, EV_EditMethodCallData *d);
00120 
00121 #endif // __gr_AbiGOChartManager_h__

Generated on Sat May 26 2012 for AbiWord by  doxygen 1.7.1