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

gr_EmbedManager.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  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00018  * 02111-1307, USA.
00019  */
00020 
00021 #ifndef __gr_EmbedManager_h__
00022 #define __gr_EmbedManager_h__
00023 #include "ut_string_class.h"
00024 #include "ut_types.h"
00025 #include "ut_vector.h"
00026 #include "ev_EditBits.h"
00027 
00028 class GR_Graphics;
00029 class GR_Image;
00030 class UT_ByteBuf;
00031 class AD_Document;
00032 class UT_ByteBuf;
00033 class UT_RGBColor;
00034 class UT_Rect;
00035 
00036 class ABI_EXPORT GR_EmbedView
00037 {
00038 public:
00039   GR_EmbedView(AD_Document * pDoc, UT_uint32 api );
00040   virtual ~GR_EmbedView(void);
00041   bool                        getSnapShots(void);
00042   AD_Document *               m_pDoc;
00043   UT_uint32                   m_iAPI;
00044   bool                        m_bHasSVGSnapshot;
00045   bool                        m_bHasPNGSnapshot;
00046   UT_ByteBuf *                m_SVGBuf;
00047   UT_ByteBuf *                m_PNGBuf;
00048   GR_Image *                  m_pPreview;
00049   UT_UTF8String               m_sDataID;
00050   UT_uint32                   m_iZoom;
00051 };
00052 
00053 class fp_Run;
00054 class ABI_EXPORT GR_EmbedManager
00055 {
00056 public:
00057     GR_EmbedManager(GR_Graphics * pG);
00058     virtual ~GR_EmbedManager();
00059     virtual const char *   getObjectType(void) const;
00060     virtual const char *   getMimeType(void) const;
00061     virtual const char *   getMimeTypeDescription(void) const;
00062     virtual const char *   getMimeTypeSuffix(void) const;
00063     virtual GR_EmbedManager *  create(GR_Graphics * pG);
00064     virtual void           initialize(void);
00065     GR_Graphics *          getGraphics(void);
00066     virtual  void          setGraphics(GR_Graphics * pG);
00067     virtual UT_sint32      makeEmbedView(AD_Document * pDoc, UT_uint32  api, const char * szDataID) ;
00068     virtual void           setColor(UT_sint32 uid, const UT_RGBColor & c);
00069     virtual UT_sint32      getWidth(UT_sint32 uid);
00070     virtual UT_sint32      getAscent(UT_sint32 uid) ;
00071     virtual UT_sint32      getDescent(UT_sint32 uid) ;
00072     virtual void           loadEmbedData(UT_sint32 uid);
00073     virtual void           setDefaultFontSize(UT_sint32 uid, UT_sint32);
00074     virtual void           render(UT_sint32 uid, UT_Rect & rec);
00075     virtual void           releaseEmbedView(UT_sint32 uid);
00076     virtual void           initializeEmbedView(UT_sint32 uid);
00077     virtual void           makeSnapShot(UT_sint32 uid, UT_Rect & rec);
00078     virtual bool           isDefault(void);
00079     virtual bool           modify(UT_sint32 uid);
00080     virtual bool           changeAPI(UT_sint32 uid, UT_uint32 api);
00081     virtual bool           convert(UT_uint32 iConvType, UT_ByteBuf & pFrom, UT_ByteBuf & pTo);
00082     virtual bool           isEdittable(UT_sint32 uid);
00083     virtual bool           isResizeable(UT_sint32 uid);
00084     virtual void           setRun (UT_sint32 uid, fp_Run * run);
00085     virtual void           updateData(UT_sint32 uid, UT_sint32 api);
00086     virtual EV_EditMouseContext     getContextualMenu(void) const
00087         { return EV_EMC_EMBED; }
00088 
00089 private:
00090     GR_Graphics *               m_pG;
00091     UT_GenericVector<GR_EmbedView *>   m_vecSnapshots;
00092 };
00093 
00094 #endif // __gr_EmbedManager_h__

Generated on Mon May 28 2012 for AbiWord by  doxygen 1.7.1