Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #include <uifactory/statusbarfactory.hxx>
21 : : #include <uifactory/menubarfactory.hxx>
22 : :
23 : : #include <uielement/statusbarwrapper.hxx>
24 : : #include <threadhelp/resetableguard.hxx>
25 : :
26 : : #include <com/sun/star/util/XURLTransformer.hpp>
27 : : #include <com/sun/star/frame/XFrame.hpp>
28 : : #include <com/sun/star/frame/XModel.hpp>
29 : : #include <com/sun/star/lang/XInitialization.hpp>
30 : : #include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp>
31 : :
32 : : #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
33 : :
34 : : #include <vcl/svapp.hxx>
35 : : #include <rtl/ustrbuf.hxx>
36 : :
37 : : //_________________________________________________________________________________________________________________
38 : : // Defines
39 : : //_________________________________________________________________________________________________________________
40 : :
41 : : using namespace com::sun::star::uno;
42 : : using namespace com::sun::star::lang;
43 : : using namespace com::sun::star::frame;
44 : : using namespace com::sun::star::beans;
45 : : using namespace com::sun::star::util;
46 : : using namespace ::com::sun::star::ui;
47 : :
48 : : namespace framework
49 : : {
50 : :
51 : : //*****************************************************************************************************************
52 : : // XInterface, XTypeProvider, XServiceInfo
53 : : //*****************************************************************************************************************
54 [ + - ][ + - ]: 1285 : DEFINE_XSERVICEINFO_ONEINSTANCESERVICE ( StatusBarFactory ,
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ # # ]
[ # # ]
55 : : ::cppu::OWeakObject ,
56 : : SERVICENAME_STATUSBARFACTORY ,
57 : : IMPLEMENTATIONNAME_STATUSBARFACTORY
58 : : )
59 : :
60 : 111 : DEFINE_INIT_SERVICE ( StatusBarFactory, {} )
61 : :
62 : 111 : StatusBarFactory::StatusBarFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceManager ) :
63 : 111 : MenuBarFactory( xServiceManager,true )
64 : : {
65 : : RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::StatusBarFactory" );
66 : 111 : }
67 : :
68 : : // XUIElementFactory
69 : 1741 : Reference< XUIElement > SAL_CALL StatusBarFactory::createUIElement(
70 : : const ::rtl::OUString& ResourceURL,
71 : : const Sequence< PropertyValue >& Args )
72 : : throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException )
73 : : {
74 : : RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "framework", "Ocke.Janssen@sun.com", "StatusBarFactory::createUIElement" );
75 : : // SAFE
76 [ + - ]: 1741 : ResetableGuard aLock( m_aLock );
77 [ + - ]: 1741 : StatusBarWrapper* pWrapper = new StatusBarWrapper( m_xServiceManager );
78 [ + - ][ + - ]: 1741 : Reference< ::com::sun::star::ui::XUIElement > xMenuBar( (OWeakObject *)pWrapper, UNO_QUERY );
79 : 1741 : Reference< ::com::sun::star::frame::XModuleManager > xModuleManager = m_xModuleManager;
80 [ + - ]: 1741 : aLock.unlock();
81 [ + - ]: 1741 : MenuBarFactory::CreateUIElement(ResourceURL,Args,NULL,"private:resource/statusbar/",xMenuBar,xModuleManager,m_xServiceManager);
82 [ + - ]: 1741 : return xMenuBar;
83 : : }
84 : :
85 : : }
86 : :
87 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|