1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: statusbarfactory.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_framework.hxx"
33 #include <uifactory/statusbarfactory.hxx>
34 #include <uifactory/menubarfactory.hxx>
36 //_________________________________________________________________________________________________________________
38 //_________________________________________________________________________________________________________________
39 #include <uielement/statusbarwrapper.hxx>
40 #include <threadhelp/resetableguard.hxx>
42 //_________________________________________________________________________________________________________________
44 //_________________________________________________________________________________________________________________
45 #include <com/sun/star/util/XURLTransformer.hpp>
46 #include <com/sun/star/frame/XFrame.hpp>
47 #include <com/sun/star/frame/XModel.hpp>
48 #include <com/sun/star/lang/XInitialization.hpp>
49 #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
51 #ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGERSUPLLIER_HPP_
52 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
55 //_________________________________________________________________________________________________________________
56 // includes of other projects
57 //_________________________________________________________________________________________________________________
58 #include <vcl/svapp.hxx>
59 #include <tools/urlobj.hxx>
60 #include <rtl/ustrbuf.hxx>
62 //_________________________________________________________________________________________________________________
64 //_________________________________________________________________________________________________________________
67 using namespace com::sun::star::uno
;
68 using namespace com::sun::star::lang
;
69 using namespace com::sun::star::frame
;
70 using namespace com::sun::star::beans
;
71 using namespace com::sun::star::util
;
72 using namespace ::com::sun::star::ui
;
77 //*****************************************************************************************************************
78 // XInterface, XTypeProvider, XServiceInfo
79 //*****************************************************************************************************************
80 DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusBarFactory
,
82 SERVICENAME_STATUSBARFACTORY
,
83 IMPLEMENTATIONNAME_STATUSBARFACTORY
86 DEFINE_INIT_SERVICE ( StatusBarFactory
, {} )
88 StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& xServiceManager
) :
89 MenuBarFactory( xServiceManager
,true )
91 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::StatusBarFactory" );
95 Reference
< XUIElement
> SAL_CALL
StatusBarFactory::createUIElement(
96 const ::rtl::OUString
& ResourceURL
,
97 const Sequence
< PropertyValue
>& Args
)
98 throw ( ::com::sun::star::container::NoSuchElementException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
)
100 RTL_LOGFILE_CONTEXT_AUTHOR( aLogger
, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::createUIElement" );
102 ResetableGuard
aLock( m_aLock
);
103 StatusBarWrapper
* pWrapper
= new StatusBarWrapper( m_xServiceManager
);
104 Reference
< ::com::sun::star::ui::XUIElement
> xMenuBar( (OWeakObject
*)pWrapper
, UNO_QUERY
);
105 Reference
< ::com::sun::star::frame::XModuleManager
> xModuleManager
= m_xModuleManager
;
107 MenuBarFactory::CreateUIElement(ResourceURL
,Args
,NULL
,"private:resource/statusbar/",xMenuBar
,xModuleManager
,m_xServiceManager
);