1*6d739b60SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*6d739b60SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*6d739b60SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*6d739b60SAndrew Rist  * distributed with this work for additional information
6*6d739b60SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*6d739b60SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*6d739b60SAndrew Rist  * "License"); you may not use this file except in compliance
9*6d739b60SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*6d739b60SAndrew Rist  *
11*6d739b60SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*6d739b60SAndrew Rist  *
13*6d739b60SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*6d739b60SAndrew Rist  * software distributed under the License is distributed on an
15*6d739b60SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*6d739b60SAndrew Rist  * KIND, either express or implied.  See the License for the
17*6d739b60SAndrew Rist  * specific language governing permissions and limitations
18*6d739b60SAndrew Rist  * under the License.
19*6d739b60SAndrew Rist  *
20*6d739b60SAndrew Rist  *************************************************************/
21*6d739b60SAndrew Rist 
22*6d739b60SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_framework.hxx"
26cdf0e10cSrcweir #include <uifactory/statusbarfactory.hxx>
27cdf0e10cSrcweir #include <uifactory/menubarfactory.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir //_________________________________________________________________________________________________________________
30cdf0e10cSrcweir //	my own includes
31cdf0e10cSrcweir //_________________________________________________________________________________________________________________
32cdf0e10cSrcweir #include <uielement/statusbarwrapper.hxx>
33cdf0e10cSrcweir #include <threadhelp/resetableguard.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir //_________________________________________________________________________________________________________________
36cdf0e10cSrcweir //	interface includes
37cdf0e10cSrcweir //_________________________________________________________________________________________________________________
38cdf0e10cSrcweir #include <com/sun/star/util/XURLTransformer.hpp>
39cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
40cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
41cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
42cdf0e10cSrcweir #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
43cdf0e10cSrcweir 
44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UI_XUICONFIGURATIONMANAGERSUPLLIER_HPP_
45cdf0e10cSrcweir #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir 
48cdf0e10cSrcweir //_________________________________________________________________________________________________________________
49cdf0e10cSrcweir //	includes of other projects
50cdf0e10cSrcweir //_________________________________________________________________________________________________________________
51cdf0e10cSrcweir #include <vcl/svapp.hxx>
52cdf0e10cSrcweir #include <tools/urlobj.hxx>
53cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
54cdf0e10cSrcweir 
55cdf0e10cSrcweir //_________________________________________________________________________________________________________________
56cdf0e10cSrcweir //	Defines
57cdf0e10cSrcweir //_________________________________________________________________________________________________________________
58cdf0e10cSrcweir //
59cdf0e10cSrcweir 
60cdf0e10cSrcweir using namespace com::sun::star::uno;
61cdf0e10cSrcweir using namespace com::sun::star::lang;
62cdf0e10cSrcweir using namespace com::sun::star::frame;
63cdf0e10cSrcweir using namespace com::sun::star::beans;
64cdf0e10cSrcweir using namespace com::sun::star::util;
65cdf0e10cSrcweir using namespace ::com::sun::star::ui;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir namespace framework
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 
70cdf0e10cSrcweir //*****************************************************************************************************************
71cdf0e10cSrcweir //	XInterface, XTypeProvider, XServiceInfo
72cdf0e10cSrcweir //*****************************************************************************************************************
DEFINE_XSERVICEINFO_ONEINSTANCESERVICE(StatusBarFactory,::cppu::OWeakObject,SERVICENAME_STATUSBARFACTORY,IMPLEMENTATIONNAME_STATUSBARFACTORY)73cdf0e10cSrcweir DEFINE_XSERVICEINFO_ONEINSTANCESERVICE  (   StatusBarFactory				                ,
74cdf0e10cSrcweir                                             ::cppu::OWeakObject							    ,
75cdf0e10cSrcweir                                             SERVICENAME_STATUSBARFACTORY	                ,
76cdf0e10cSrcweir 											IMPLEMENTATIONNAME_STATUSBARFACTORY
77cdf0e10cSrcweir 										)
78cdf0e10cSrcweir 
79cdf0e10cSrcweir DEFINE_INIT_SERVICE                     (   StatusBarFactory, {} )
80cdf0e10cSrcweir 
81cdf0e10cSrcweir StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
82cdf0e10cSrcweir     MenuBarFactory( xServiceManager,true )
83cdf0e10cSrcweir {
84cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::StatusBarFactory" );
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir // XUIElementFactory
createUIElement(const::rtl::OUString & ResourceURL,const Sequence<PropertyValue> & Args)88cdf0e10cSrcweir Reference< XUIElement > SAL_CALL StatusBarFactory::createUIElement(
89cdf0e10cSrcweir     const ::rtl::OUString& ResourceURL,
90cdf0e10cSrcweir     const Sequence< PropertyValue >& Args )
91cdf0e10cSrcweir throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::createUIElement" );
94cdf0e10cSrcweir     // SAFE
95cdf0e10cSrcweir     ResetableGuard aLock( m_aLock );
96cdf0e10cSrcweir     StatusBarWrapper* pWrapper = new StatusBarWrapper( m_xServiceManager );
97cdf0e10cSrcweir     Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY );
98cdf0e10cSrcweir     Reference< ::com::sun::star::frame::XModuleManager > xModuleManager = m_xModuleManager;
99cdf0e10cSrcweir     aLock.unlock();
100cdf0e10cSrcweir     MenuBarFactory::CreateUIElement(ResourceURL,Args,NULL,"private:resource/statusbar/",xMenuBar,xModuleManager,m_xServiceManager);
101cdf0e10cSrcweir     return xMenuBar;
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir }
105cdf0e10cSrcweir 
106