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