1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_sfx2.hxx" 30 31 //#define TF_NEWDESKTOP 32 33 #define _SDINTERN_HXX 34 35 #include <stdio.h> 36 #include <tools/urlobj.hxx> 37 #include <tools/config.hxx> 38 #include <svtools/ehdl.hxx> 39 #include <unotools/startoptions.hxx> 40 #include <svl/itempool.hxx> 41 #include <svl/urihelper.hxx> 42 #include <svtools/helpopt.hxx> 43 #include <vos/process.hxx> 44 #include <framework/sfxhelperfunctions.hxx> 45 #include <rtl/ustring.hxx> 46 #include <com/sun/star/uno/Exception.hpp> 47 #include <com/sun/star/uno/RuntimeException.hpp> 48 #include <com/sun/star/uno/Reference.hxx> 49 50 #include "sfxtypes.hxx" 51 #include "appdata.hxx" 52 #include <sfx2/docfac.hxx> 53 #include <sfx2/app.hxx> 54 #include "arrdecl.hxx" 55 #include <sfx2/dispatch.hxx> 56 #include "sfx2/sfxresid.hxx" 57 #include <sfx2/fcontnr.hxx> 58 #include <sfx2/viewsh.hxx> 59 #include "intro.hxx" 60 #include <sfx2/msgpool.hxx> 61 #include <sfx2/mnumgr.hxx> 62 #include <sfx2/appuno.hxx> 63 #include "app.hrc" 64 #include <sfx2/docfile.hxx> 65 #include "workwin.hxx" 66 67 #ifdef UNX 68 #define stricmp(a,b) strcmp(a,b) 69 #endif 70 71 72 //=================================================================== 73 74 DBG_NAME(SfxAppMainNewMenu) 75 DBG_NAME(SfxAppMainBmkMenu) 76 DBG_NAME(SfxAppMainWizMenu) 77 DBG_NAME(SfxAppMainOLEReg) 78 DBG_NAME(SfxAppMainCHAOSReg) 79 80 //=================================================================== 81 82 #define SFX_TEMPNAMEBASE_DIR "soffice.tmp" 83 #define SFX_KEY_TEMPNAMEBASE "Temp-Dir" 84 85 //=================================================================== 86 87 #ifdef TF_POOLABLE 88 static SfxItemInfo __READONLY_DATA aItemInfos[] = 89 { 90 { 0, 0 } 91 }; 92 #endif 93 94 //=================================================================== 95 96 TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster); 97 98 //-------------------------------------------------------------------- 99 void SfxApplication::Init 100 ( 101 ) 102 103 /* [Beschreibung] 104 105 Diese virtuelle Methode wird vom SFx aus Application:a:Main() gerufen, 106 bevor Execute() ausgef"uhrt wird und 107 - das Intro bereits angezeigt ist, 108 - das Applikationsfenster exisitiert, aber noch hidden ist, 109 - die Bindings bereits existieren (Controller sind anmeldbar), 110 - der Ini- und Config-Manager bereits existiert, 111 - die Standard-Controller bereits exisitieren, 112 - die SFx-Shells ihre Interfaces bereits registriert haben. 113 114 [Querverweise] 115 <SfxApplication::Exit()> 116 <SfxApplication::OpenClients()> 117 */ 118 { 119 } 120 121 //-------------------------------------------------------------------- 122 123 void SfxApplication::Exit() 124 125 /* [Beschreibung] 126 127 Diese virtuelle Methode wird vom SFx aus Application::Main() gerufen, 128 nachdem Execute() beendet ist und 129 - die Konfiguration (SfxConfigManager) bereits gespeichert wurde, 130 - die Fensterpostionen etc. in den SfxIniManager geschrieben wurden, 131 - das Applikationsfenster noch existiert, aber hidden ist 132 - s"amtliche Dokumente und deren Views bereits geschlossen sind. 133 - Dispatcher, Bindings etc. bereits zerst"ort sind 134 135 [Querverweise] 136 <SfxApplication::Init(int,char*[])> 137 */ 138 139 { 140 } 141 142 //--------------------------------------------------------------------------- 143 144 void SfxApplication::PreInit( ) 145 { 146 } 147 148 void SfxApplication::Main( ) 149 { 150 } 151 152 //------------------------------------------------------------------------- 153 154 SfxFilterMatcher& SfxApplication::GetFilterMatcher() 155 { 156 if( !pAppData_Impl->pMatcher ) 157 { 158 pAppData_Impl->pMatcher = new SfxFilterMatcher(); 159 URIHelper::SetMaybeFileHdl( STATIC_LINK( 160 pAppData_Impl->pMatcher, SfxFilterMatcher, MaybeFileHdl_Impl ) ); 161 } 162 return *pAppData_Impl->pMatcher; 163 } 164