1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_sfx2.hxx" 26 27 //#define TF_NEWDESKTOP 28 29 #define _SDINTERN_HXX 30 31 #include <stdio.h> 32 #include <tools/urlobj.hxx> 33 #include <tools/config.hxx> 34 #include <svtools/ehdl.hxx> 35 #include <unotools/startoptions.hxx> 36 #include <svl/itempool.hxx> 37 #include <svl/urihelper.hxx> 38 #include <svtools/helpopt.hxx> 39 #include <vos/process.hxx> 40 #include <framework/sfxhelperfunctions.hxx> 41 #include <rtl/ustring.hxx> 42 #include <com/sun/star/uno/Exception.hpp> 43 #include <com/sun/star/uno/RuntimeException.hpp> 44 #include <com/sun/star/uno/Reference.hxx> 45 46 #include "sfxtypes.hxx" 47 #include "appdata.hxx" 48 #include <sfx2/docfac.hxx> 49 #include <sfx2/app.hxx> 50 #include "arrdecl.hxx" 51 #include <sfx2/dispatch.hxx> 52 #include "sfx2/sfxresid.hxx" 53 #include <sfx2/fcontnr.hxx> 54 #include <sfx2/viewsh.hxx> 55 #include "intro.hxx" 56 #include <sfx2/msgpool.hxx> 57 #include <sfx2/mnumgr.hxx> 58 #include <sfx2/appuno.hxx> 59 #include "app.hrc" 60 #include <sfx2/docfile.hxx> 61 #include "workwin.hxx" 62 63 #ifdef UNX 64 #define stricmp(a,b) strcmp(a,b) 65 #endif 66 67 68 //=================================================================== 69 70 DBG_NAME(SfxAppMainNewMenu) 71 DBG_NAME(SfxAppMainBmkMenu) 72 DBG_NAME(SfxAppMainWizMenu) 73 DBG_NAME(SfxAppMainOLEReg) 74 DBG_NAME(SfxAppMainCHAOSReg) 75 76 //=================================================================== 77 78 #define SFX_TEMPNAMEBASE_DIR "soffice.tmp" 79 #define SFX_KEY_TEMPNAMEBASE "Temp-Dir" 80 81 //=================================================================== 82 83 #ifdef TF_POOLABLE 84 static SfxItemInfo __READONLY_DATA aItemInfos[] = 85 { 86 { 0, 0 } 87 }; 88 #endif 89 90 //=================================================================== 91 92 TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster); 93 94 //-------------------------------------------------------------------- 95 void SfxApplication::Init 96 ( 97 ) 98 99 /* [Beschreibung] 100 101 Diese virtuelle Methode wird vom SFx aus Application:a:Main() gerufen, 102 bevor Execute() ausgef"uhrt wird und 103 - das Intro bereits angezeigt ist, 104 - das Applikationsfenster exisitiert, aber noch hidden ist, 105 - die Bindings bereits existieren (Controller sind anmeldbar), 106 - der Ini- und Config-Manager bereits existiert, 107 - die Standard-Controller bereits exisitieren, 108 - die SFx-Shells ihre Interfaces bereits registriert haben. 109 110 [Querverweise] 111 <SfxApplication::Exit()> 112 <SfxApplication::OpenClients()> 113 */ 114 { 115 } 116 117 //-------------------------------------------------------------------- 118 119 void SfxApplication::Exit() 120 121 /* [Beschreibung] 122 123 Diese virtuelle Methode wird vom SFx aus Application::Main() gerufen, 124 nachdem Execute() beendet ist und 125 - die Konfiguration (SfxConfigManager) bereits gespeichert wurde, 126 - die Fensterpostionen etc. in den SfxIniManager geschrieben wurden, 127 - das Applikationsfenster noch existiert, aber hidden ist 128 - s"amtliche Dokumente und deren Views bereits geschlossen sind. 129 - Dispatcher, Bindings etc. bereits zerst"ort sind 130 131 [Querverweise] 132 <SfxApplication::Init(int,char*[])> 133 */ 134 135 { 136 } 137 138 //--------------------------------------------------------------------------- 139 140 void SfxApplication::PreInit( ) 141 { 142 } 143 144 void SfxApplication::Main( ) 145 { 146 } 147 148 //------------------------------------------------------------------------- 149 150 SfxFilterMatcher& SfxApplication::GetFilterMatcher() 151 { 152 if( !pAppData_Impl->pMatcher ) 153 { 154 pAppData_Impl->pMatcher = new SfxFilterMatcher(); 155 URIHelper::SetMaybeFileHdl( STATIC_LINK( 156 pAppData_Impl->pMatcher, SfxFilterMatcher, MaybeFileHdl_Impl ) ); 157 } 158 return *pAppData_Impl->pMatcher; 159 } 160