1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <uifactory/menubarfactory.hxx>
21 #include <uielement/statusbarwrapper.hxx>
23 #include <cppuhelper/supportsservice.hxx>
25 using namespace com::sun::star::uno
;
26 using namespace com::sun::star::beans
;
27 using namespace ::com::sun::star::ui
;
29 using namespace framework
;
33 class StatusBarFactory
: public MenuBarFactory
36 explicit StatusBarFactory( const css::uno::Reference
< css::uno::XComponentContext
>& xContext
);
38 virtual OUString SAL_CALL
getImplementationName() override
40 return u
"com.sun.star.comp.framework.StatusBarFactory"_ustr
;
43 virtual sal_Bool SAL_CALL
supportsService(OUString
const & ServiceName
) override
45 return cppu::supportsService(this, ServiceName
);
48 virtual css::uno::Sequence
<OUString
> SAL_CALL
getSupportedServiceNames() override
50 return {u
"com.sun.star.ui.StatusBarFactory"_ustr
};
54 virtual css::uno::Reference
< css::ui::XUIElement
> SAL_CALL
createUIElement( const OUString
& ResourceURL
, const css::uno::Sequence
< css::beans::PropertyValue
>& Args
) override
;
57 StatusBarFactory::StatusBarFactory( const css::uno::Reference
< css::uno::XComponentContext
>& xContext
) :
58 MenuBarFactory( xContext
)
63 Reference
< XUIElement
> SAL_CALL
StatusBarFactory::createUIElement(
64 const OUString
& ResourceURL
,
65 const Sequence
< PropertyValue
>& Args
)
67 Reference
< css::ui::XUIElement
> xStatusBar
= new StatusBarWrapper(m_xContext
);
68 MenuBarFactory::CreateUIElement(ResourceURL
, Args
, u
"private:resource/statusbar/", xStatusBar
, m_xContext
);
74 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
75 com_sun_star_comp_framework_StatusBarFactory_get_implementation(
76 css::uno::XComponentContext
*context
,
77 css::uno::Sequence
<css::uno::Any
> const &)
79 return cppu::acquire(new StatusBarFactory(context
));
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */