/Users/ericb/Desktop/SRC680_m247/starmath/inc/document.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: document.hxx,v $
00006  *
00007  *  $Revision: 1.32 $
00008  *
00009  *  last change: $Author: hr $ $Date: 2007/06/27 12:39:43 $
00010  *
00011  *  The Contents of this file are made available subject to
00012  *  the terms of GNU Lesser General Public License Version 2.1.
00013  *
00014  *
00015  *    GNU Lesser General Public License Version 2.1
00016  *    =============================================
00017  *    Copyright 2005 by Sun Microsystems, Inc.
00018  *    901 San Antonio Road, Palo Alto, CA 94303, USA
00019  *
00020  *    This library is free software; you can redistribute it and/or
00021  *    modify it under the terms of the GNU Lesser General Public
00022  *    License version 2.1, as published by the Free Software Foundation.
00023  *
00024  *    This library is distributed in the hope that it will be useful,
00025  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  *    Lesser General Public License for more details.
00028  *
00029  *    You should have received a copy of the GNU Lesser General Public
00030  *    License along with this library; if not, write to the Free Software
00031  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00032  *    MA  02111-1307  USA
00033  *
00034  ************************************************************************/
00035 #ifndef DOCUMENT_HXX
00036 #define DOCUMENT_HXX
00037 
00038 #define SMDLL   1
00039 
00040 #ifndef _SOT_STORAGE_HXX
00041 #include <sot/storage.hxx>
00042 #endif
00043 #ifndef _SOT_SOTREF_HXX //autogen
00044 #include <sot/sotref.hxx>
00045 #endif
00046 #ifndef _SFX_OBJSH_HXX //autogen
00047 #include <sfx2/objsh.hxx>
00048 #endif
00049 #ifndef _SFXLSTNER_HXX //autogen
00050 #include <svtools/lstner.hxx>
00051 #endif
00052 #ifndef _SFX_OBJFAC_HXX //autogen
00053 #include <sfx2/docfac.hxx>
00054 #endif
00055 #ifndef _SV_VIRDEV_HXX //autogen
00056 #include <vcl/virdev.hxx>
00057 #endif
00058 
00059 #ifndef _FORMAT_HXX
00060 #include "format.hxx"
00061 #endif
00062 #ifndef PARSE_HXX
00063 #include "parse.hxx"
00064 #endif
00065 #ifndef SMMOD_HXX
00066 #include "smmod.hxx"
00067 #endif
00068 
00069 #include <vcl/jobset.hxx>
00070 
00071 class SmNode;
00072 class SfxMenuBarManager;
00073 class SfxPrinter;
00074 class Printer;
00075 
00076 #define HINT_DATACHANGED        1004
00077 
00078 #define SM30BIDENT       ((ULONG)0x534D3033L)
00079 #define SM30IDENT        ((ULONG)0x30334d53L)
00080 #define SM304AIDENT  ((ULONG)0x34303330L)
00081 #define SM30VERSION  ((ULONG)0x00010000L)
00082 #define SM50VERSION      ((ULONG)0x00010001L)   //Unterschied zur SM30VERSION ist
00083                                                                                         //der neue Border im Format.
00084 
00085 #define FRMIDENT        ((ULONG)0x03031963L)
00086 #define FRMVERSION      ((ULONG)0x00010001L)
00087 
00088 #define STAROFFICE_XML  "StarOffice XML (Math)"
00089 #define MATHML_XML              "MathML XML (Math)"
00090 
00091 /* Zugriff auf den Drucker sollte ausschliesslich ueber diese Klasse erfolgen
00092  * ==========================================================================
00093  *
00094  * Der Drucker kann dem Dokument oder auch dem OLE-Container gehoeren. Wenn
00095  * das Dokument also eine OLE-Dokument ist, so gehoert der Drucker auch
00096  * grundsaetzlich dem Container. Der Container arbeitet aber eventuell mit
00097  * einer anderen MapUnit als der Server. Der Drucker wird bezueglich des MapMode
00098  * im Konstruktor entsprechend eingestellt und im Destruktor wieder restauriert.
00099  * Das bedingt natuerlich, das diese Klasse immer nur kurze Zeit existieren darf
00100  * (etwa waehrend des Paints).
00101  * Die Kontrolle darueber ob der Drucker selbst angelegt, vom Server besorgt
00102  * oder dann auch NULL ist, uebernimmt die DocShell in der Methode GetPrt(),
00103  * fuer die der Access auch Friend der DocShell ist.
00104 */
00105 
00106 class SmDocShell;
00107 class EditEngine;
00108 
00109 class SmPrinterAccess
00110 {
00111     Printer* pPrinter;
00112     OutputDevice* pRefDev;
00113 public:
00114         SmPrinterAccess( SmDocShell &rDocShell );
00115         ~SmPrinterAccess();
00116     Printer* GetPrinter()  { return pPrinter; }
00117     OutputDevice* GetRefDev()  { return pRefDev; }
00118 };
00119 
00120 
00122 
00123 void SetEditEngineDefaultFonts(
00124         EditEngine &rEditEngine,
00125         SfxItemPool &rEditEngineItemPool );
00126 
00128 
00129 class SmDocShell : public SfxObjectShell, public SfxListener
00130 {
00131         friend class SmPrinterAccess;
00132     friend class SmModel;
00133 
00134         String                          aText;
00135         SmFormat                        aFormat;
00136         SmParser                        aInterpreter;
00137     String              aAccText;
00138         SmNode                     *pTree;
00139         SfxMenuBarManager  *pMenuMgr;
00140         SfxItemPool                *pEditEngineItemPool;
00141         EditEngine                 *pEditEngine;
00142         SfxPrinter                 *pPrinter;           //Siehe Kommentar zum SmPrinter Access!
00143         Printer                    *pTmpPrinter;        //ebenfalls
00144         long                            nLeftBorder,
00145                                                 nRightBorder,
00146                                                 nTopBorder,
00147                                                 nBottomBorder;
00148         USHORT                          nModifyCount;
00149         BOOL                            bIsFormulaArranged;
00150 
00151 
00152 
00153         virtual void SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType,
00154                                                 const SfxHint& rHint, const TypeId& rHintType);
00155 
00156     BOOL        WriteAsMathType3( SfxMedium& );
00157 
00158         virtual void            Draw(OutputDevice *pDevice,
00159                                                          const JobSetup & rSetup,
00160                                                          USHORT nAspect = ASPECT_CONTENT);
00161 
00162         virtual void            FillClass(SvGlobalName* pClassName,
00163                                                                   sal_uInt32*  pFormat,
00164                                                                   String* pAppName,
00165                                                                   String* pFullTypeName,
00166                                   String* pShortTypeName,
00167                                                                   sal_Int32 nFileFormat ) const;
00168 
00169         virtual BOOL            SetData( const String& rData );
00170         virtual ULONG           GetMiscStatus() const;
00171         virtual void            OnDocumentPrinterChanged( Printer * );
00172     virtual sal_Bool    InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
00173     virtual BOOL        Load( SfxMedium& rMedium );
00174                         void            ImplSave(  SvStorageStreamRef xStrm  );
00175         virtual BOOL            Save();
00176     virtual BOOL        SaveAs( SfxMedium& rMedium );
00177         virtual BOOL        ConvertTo( SfxMedium &rMedium );
00178     virtual BOOL        SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage );
00179 
00180     Printer             *GetPrt();
00181     OutputDevice*       GetRefDev();
00182 
00183         BOOL                            IsFormulaArranged() const { return bIsFormulaArranged; }
00184         void                            SetFormulaArranged(BOOL bVal) { bIsFormulaArranged = bVal; }
00185 
00186         virtual BOOL            ConvertFrom(SfxMedium &rMedium);
00187 
00188 public:
00189         TYPEINFO();
00190     SFX_DECL_INTERFACE(SFX_INTERFACE_SMA_START+1)
00191     using SotObject::GetInterface;
00192     SFX_DECL_OBJECTFACTORY();
00193 
00194                                 SmDocShell(SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED);
00195         virtual         ~SmDocShell();
00196 
00197         void            LoadSymbols();
00198         void            SaveSymbols();
00199 
00200     void        ArrangeFormula();
00201 
00202         //Zugriff fuer die View. Diese Zugriffe sind nur fuer den nicht OLE-Fall!
00203         //und fuer die Kommunikation mit dem SFX!
00204         //Alle internen Verwendungen des Printers sollten ausschlieslich uber
00205         //den SmPrinterAccess funktionieren.
00206         BOOL            HasPrinter()    { return 0 != pPrinter; }
00207         SfxPrinter *GetPrinter()        { GetPrt(); return pPrinter; }
00208         void        SetPrinter( SfxPrinter * );
00209 
00210         const String &GetComment() const;
00211 
00212     // to replace chars that can not be saved with the document...
00213     sal_Bool    ReplaceBadChars();
00214 
00215     void        UpdateText();
00216         void            SetText(const String& rBuffer);
00217         String&         GetText() { return (aText); }
00218         void            SetFormat(SmFormat& rFormat);
00219     const SmFormat&  GetFormat() { return (aFormat); }
00220 
00221         void                    Parse();
00222         SmParser &              GetParser() { return aInterpreter; }
00223         const SmNode *  GetFormulaTree() const  { return pTree; }
00224         void                    SetFormulaTree(SmNode *&rTree) { pTree = rTree; }
00225 
00226     String          GetAccessibleText();
00227 
00228         EditEngine &    GetEditEngine();
00229         SfxItemPool &   GetEditEngineItemPool();
00230 
00231         void            Draw(OutputDevice &rDev, Point &rPosition);
00232         Size            GetSize();
00233 
00234     void        Repaint();
00235 
00236         virtual         SfxUndoManager *GetUndoManager ();
00237 
00238     virtual     SfxItemPool& GetPool() const;
00239 
00240         void            Execute( SfxRequest& rReq );
00241         void            GetState(SfxItemSet &);
00242 
00243         virtual void SetVisArea (const Rectangle & rVisArea);
00244         virtual void SetModified(BOOL bModified);
00245 };
00246 
00247 
00248 #endif
00249 

Generated on Wed Feb 20 17:21:56 2008 for maths by  doxygen 1.5.1