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

AbiMathView.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., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 #ifndef __gr_AbiMathManager_h__
00022 #define __gr_AbiMathManager_h__
00023 #include "ut_string_class.h"
00024 #include "gr_EmbedManager.h"
00025 #include "mathview_proxy.h"
00026 #include "ut_types.h"
00027 #include "ut_vector.h"
00028 #include "ie_imp_MathML.h"
00029 
00030 class GR_Graphics;
00031 class GR_Abi_MathGraphicDevice;
00032 class GR_Abi_RenderingContext;
00033 class MathMLOperatorDictionary;
00034 class PD_Document;
00035 class AD_Document;
00036 typedef SmartPtr<libxml2_MathView> GR_AbiMathView;
00037 
00038 class GR_AbiMathItems
00039 {
00040  public:
00041   GR_AbiMathItems();
00042   virtual ~GR_AbiMathItems();
00043   UT_uint32 m_iAPI;
00044   bool m_bHasSnapshot;
00045 };
00046 
00047 class GR_MathManager : public GR_EmbedManager
00048 {
00049 public:
00050     GR_MathManager(GR_Graphics * pG);
00051     virtual ~GR_MathManager();
00052     virtual GR_EmbedManager *  create(GR_Graphics * pG);
00053     virtual const char *   getObjectType(void) const;
00054     virtual void           initialize(void);
00055     virtual UT_sint32      makeEmbedView(AD_Document * pDoc, UT_uint32  api, const char * szDataID) ;
00056     virtual void           setColor(UT_sint32 uid, UT_RGBColor c);
00057     virtual UT_sint32      getWidth(UT_sint32 uid);
00058     virtual UT_sint32      getAscent(UT_sint32 uid) ;
00059     virtual UT_sint32      getDescent(UT_sint32 uid) ;
00060     virtual void           loadEmbedData(UT_sint32 uid);
00061     virtual void           setDefaultFontSize(UT_sint32 uid, UT_sint32 iSize);
00062     virtual void           render(UT_sint32 uid, UT_Rect & rec);
00063     virtual void           releaseEmbedView(UT_sint32 uid);
00064     virtual void           initializeEmbedView(UT_sint32 uid);
00065     virtual void           makeSnapShot(UT_sint32 uid, UT_Rect & rec);
00066     virtual bool           isDefault(void);
00067     virtual bool           modify(UT_sint32 uid);
00068     virtual bool           convert(UT_uint32 iConv, UT_ByteBuf & From, UT_ByteBuf & To);
00069 
00070     bool           createPNGSnapshot(AD_Document * pDoc, UT_Rect & rec,
00071                        const char * szDataID);
00072     bool           updatePNGSnapshot(AD_Document * pDoc, UT_Rect & rec,
00073                        const char * szDataID);
00074 
00075     const IE_Imp_MathML_EntityTable & EntityTable() const { return m_EntityTable; }
00076 
00077 private:
00078     virtual UT_sint32      _makeMathView(void) ;
00079     virtual void           _loadMathML(UT_sint32 uid, UT_UTF8String & sMathBuf);
00080     //    bool           _addEntitiiesIfNeeded(UT_UTF8String & sInMath, UT_UTF8String & sOutMath);
00081 
00082     UT_sint32                              _getNextUID(void);
00083     UT_sint32                              m_CurrentUID;
00084     SmartPtr<AbstractLogger>               m_pLogger;
00085     SmartPtr<GR_Abi_MathGraphicDevice>     m_pMathGraphicDevice;
00086     GR_Abi_RenderingContext *              m_pAbiContext;
00087     SmartPtr<MathMLOperatorDictionary>     m_pOperatorDictionary;
00088     UT_GenericVector<GR_AbiMathView> m_vecMathView;
00089     UT_GenericVector<GR_AbiMathItems *>    m_vecItems;
00090     PD_Document *                          m_pDoc;
00091     IE_Imp_MathML_EntityTable              m_EntityTable;
00092 };
00093 
00094 #endif // __gr_AbiMathManager_h__

Generated on Wed Mar 5 2014 for AbiWord by  doxygen 1.7.1