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

fg_GraphicVector.h

Go to the documentation of this file.
00001 /* AbiWord -- Embedded graphics for layout
00002  * Copyright (C) 1999 Matt Kimball
00003  * Copyright (C) 2009 Hubert Figuiere
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., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 #ifndef FG_GRAPHICVECTOR_H
00022 #define FG_GRAPHICVECTOR_H
00023 
00024 #include "fg_Graphic.h"
00025 #include "ut_types.h"
00026 
00027 class UT_ByteBuf;
00028 
00029 //  An implementation of the FG_Graphic interface for vector files.  The
00030 //  internal file format happens to be SVG.
00031 class ABI_EXPORT FG_GraphicVector : public FG_Graphic
00032 {
00033 public:
00034     static FG_GraphicPtr createFromChangeRecord(const fl_ContainerLayout *pFL,
00035                                                const PX_ChangeRecord_Object* pcro);
00036     static FG_GraphicPtr createFromStrux(const fl_ContainerLayout *pFL);
00037 
00038     FG_GraphicVector();
00039     virtual ~FG_GraphicVector();
00040 
00041     virtual FGType      getType(void) const;
00042     virtual const std::string & getMimeType(void) const;
00043     virtual FG_ConstGraphicPtr clone(void) const;
00044     virtual double      getWidth(void) const;
00045     virtual double      getHeight(void) const;
00046     virtual const char * getDataId(void) const { return m_pszDataID;}
00047     virtual const char * createDataItem(PD_Document *pDoc, const char * szName) const;
00048     virtual GR_Image*   generateImage(GR_Graphics* pG,
00049                                       const PP_AttrProp * pSpanAP,
00050                                       UT_sint32 maxW, UT_sint32 maxH);
00051     virtual GR_Image*   regenerateImage(GR_Graphics* pG);
00052 
00053     virtual UT_Error    insertIntoDocument(PD_Document* pDoc, UT_uint32 res,
00054                                            UT_uint32 iPos, const char* szName) const;
00055 
00056     virtual UT_Error    insertAtStrux(PD_Document* pDoc,
00057                                       UT_uint32 res,
00058                                       UT_uint32 iPos,
00059                                       PTStruxType iStruxType,
00060                                       const char* szName) const;
00061 
00062     bool                setVector_SVG(const UT_ConstByteBufPtr & pBB);
00063     const UT_ConstByteBufPtr & getBuffer(void) const;
00064 
00065     virtual const char * getWidthProp(void);
00066     virtual const char * getHeightProp(void);
00067 
00068 protected:
00069     UT_ConstByteBufPtr m_pbbSVG;
00070 
00071     UT_sint32 m_iWidth, m_iHeight;
00072     UT_sint32 m_iMaxW;
00073     UT_sint32 m_iMaxH;
00074     const PP_AttrProp* m_pSpanAP;
00075     const gchar* m_pszDataID;
00076 };
00077 
00078 typedef std::unique_ptr<FG_GraphicVector> FG_GraphicVectorPtr;
00079 // no Const since we use FG_ConstGraphicPtr.
00080 
00081 #endif /* FG_GRAPHICVECTOR_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1