1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
33 #include <svtools/ehdl.hxx>
34 #include <unotools/startoptions.hxx>
35 #include <svl/itempool.hxx>
36 #include <svl/urihelper.hxx>
37 #include <svtools/helpopt.hxx>
38 #include <framework/sfxhelperfunctions.hxx>
39 #include <rtl/ustring.hxx>
40 #include <com/sun/star/uno/Exception.hpp>
41 #include <com/sun/star/uno/RuntimeException.hpp>
42 #include <com/sun/star/uno/Reference.hxx>
44 #include "sfxtypes.hxx"
45 #include "appdata.hxx"
46 #include <sfx2/docfac.hxx>
47 #include <sfx2/app.hxx>
48 #include "arrdecl.hxx"
49 #include <sfx2/dispatch.hxx>
50 #include "sfx2/sfxresid.hxx"
51 #include <sfx2/fcontnr.hxx>
52 #include <sfx2/viewsh.hxx>
53 #include <sfx2/msgpool.hxx>
54 #include <sfx2/mnumgr.hxx>
55 #include <sfx2/appuno.hxx>
57 #include <sfx2/docfile.hxx>
58 #include "workwin.hxx"
60 DBG_NAME(SfxAppMainNewMenu
)
61 DBG_NAME(SfxAppMainBmkMenu
)
62 DBG_NAME(SfxAppMainWizMenu
)
63 DBG_NAME(SfxAppMainOLEReg
)
64 DBG_NAME(SfxAppMainCHAOSReg
)
66 //===================================================================
68 TYPEINIT2(SfxApplication
,SfxShell
,SfxBroadcaster
);
70 //--------------------------------------------------------------------
71 void SfxApplication::Init
77 This virtual method is called from SFx through Application::Main(),
78 before Execute() is called and:
79 - the Intro is already displayed,
80 - the Applications window exists, but it is still hidden,
81 - the Bindings already exist (Controller can be registered),
82 - the Init and Config-Manager already exists,
83 - the Standard-Controller already exists,
84 - the SFx-Shells have alredy registered their Interfaces.
88 <SfxApplication::Exit()>
89 <SfxApplication::OpenClients()>
94 //--------------------------------------------------------------------
96 void SfxApplication::Exit()
100 This virtual method is called from SFx through Application::Main(),
101 after Execute() has finished and
102 - the configuration (SfxConfigManager) was already saved,
103 - the window postions etc. in the SfxIniManager were written,
104 - the Application widow still exists, but is hidden
105 - all Documents and their Views already are closed.
106 - Dispatcher, Bindings etc. already destroyed.
109 <SfxApplication::Init(int,char*[])>
115 //---------------------------------------------------------------------------
117 void SfxApplication::PreInit( )
121 //-------------------------------------------------------------------------
123 SfxFilterMatcher
& SfxApplication::GetFilterMatcher()
125 if( !pAppData_Impl
->pMatcher
)
127 pAppData_Impl
->pMatcher
= new SfxFilterMatcher();
128 URIHelper::SetMaybeFileHdl( STATIC_LINK(
129 pAppData_Impl
->pMatcher
, SfxFilterMatcher
, MaybeFileHdl_Impl
) );
131 return *pAppData_Impl
->pMatcher
;
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */