/Users/ericb/Desktop/SRC680_m247/starmath/source/smdll.cxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: smdll.cxx,v $
00006  *
00007  *  $Revision: 1.12 $
00008  *
00009  *  last change: $Author: obo $ $Date: 2006/09/17 07:55:08 $
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 
00036 // MARKER(update_precomp.py): autogen include statement, do not remove
00037 #include "precompiled_starmath.hxx"
00038 
00039 
00040 #ifndef _SOT_FACTORY_HXX //autogen
00041 #include <sot/factory.hxx>
00042 #endif
00043 #ifndef _SVX_SVXIDS_HRC //autogen
00044 #include <svx/svxids.hrc>
00045 #endif
00046 #ifndef _SVX_MODCTRL_HXX //autogen
00047 #include <svx/modctrl.hxx>
00048 #endif
00049 #ifndef _SVX_ZOOMCTRL_HXX //autogen
00050 #include <svx/zoomctrl.hxx>
00051 #endif
00052 #ifndef _SFX_OBJFAC_HXX
00053 #include <sfx2/docfac.hxx>
00054 #endif
00055 #ifndef _SVX_LBOXCTRL_HXX_
00056 #include <svx/lboxctrl.hxx>
00057 #endif
00058 #ifndef _SFXDOCFILE_HXX //autogen
00059 #include <sfx2/docfile.hxx>
00060 #endif
00061 #ifndef _SFX_DOCFILT_HACK_HXX //autogen
00062 #include <sfx2/docfilt.hxx>
00063 #endif
00064 #ifndef _SFXAPP_HXX //autogen
00065 #include <sfx2/app.hxx>
00066 #endif
00067 
00068 #ifndef _SMDLL_HXX
00069 #include <smdll.hxx>
00070 #endif
00071 #ifndef DOCUMENT_HXX
00072 #include <document.hxx>
00073 #endif
00074 #ifndef TOOLBOX_HXX
00075 #include <toolbox.hxx>
00076 #endif
00077 #ifndef VIEW_HXX
00078 #include <view.hxx>
00079 #endif
00080 
00081 #ifndef _STARMATH_HRC
00082 #include <starmath.hrc>
00083 #endif
00084 
00085 #include <svx/xmlsecctrl.hxx>
00086 
00087 
00088 
00089 BOOL SmDLL::bInitialized = FALSE;
00090 
00091 /*************************************************************************
00092 |*
00093 |* Initialisierung
00094 |*
00095 \************************************************************************/
00096 void SmDLL::Init()
00097 {
00098     if ( bInitialized )
00099         return;
00100 
00101     bInitialized = TRUE;
00102 
00103     SfxObjectFactory& rFactory = SmDocShell::Factory();
00104 
00105         SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
00106     *ppShlPtr = new SmModule( &rFactory );
00107 
00108         SfxModule *p = SM_MOD1();
00109         SmModule *pp = (SmModule *) p;
00110 
00111     rFactory.SetDocumentServiceName( String::CreateFromAscii("com.sun.star.formula.FormulaProperties") );
00112 
00113         SmModule::RegisterInterface(pp);
00114     SmDocShell::RegisterInterface(pp);
00115         SmViewShell::RegisterInterface(pp);
00116 
00117         SmViewShell::RegisterFactory(1);
00118 
00119         SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pp );
00120         SvxModifyControl::RegisterControl( SID_TEXTSTATUS, pp );
00121         SvxUndoRedoControl::RegisterControl( SID_UNDO, pp );
00122         SvxUndoRedoControl::RegisterControl( SID_REDO, pp );
00123         XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pp );
00124 
00125         SmToolBoxWrapper::RegisterChildWindow(TRUE);
00126         SmCmdBoxWrapper::RegisterChildWindow(TRUE);
00127 }
00128 
00129 /*************************************************************************
00130 |*
00131 |* Deinitialisierung
00132 |*
00133 \************************************************************************/
00134 void SmDLL::Exit()
00135 {
00136         // the SdModule must be destroyed
00137         SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
00138         delete (*ppShlPtr);
00139         (*ppShlPtr) = NULL;
00140 
00141         *GetAppData(SHL_SM) = 0;
00142 }

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