LibreOffice Module framework (master) 1
statusbarfactory.cxx
Go to the documentation of this file.
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
22
24
25using namespace com::sun::star::uno;
26using namespace com::sun::star::lang;
27using namespace com::sun::star::beans;
28using namespace com::sun::star::util;
29using namespace ::com::sun::star::ui;
30
31using namespace framework;
32
33namespace {
34
35class StatusBarFactory : public MenuBarFactory
36{
37public:
38 explicit StatusBarFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
39
40 virtual OUString SAL_CALL getImplementationName() override
41 {
42 return "com.sun.star.comp.framework.StatusBarFactory";
43 }
44
45 virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override
46 {
47 return cppu::supportsService(this, ServiceName);
48 }
49
50 virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override
51 {
52 return {"com.sun.star.ui.StatusBarFactory"};
53 }
54
55 // XUIElementFactory
56 virtual css::uno::Reference< css::ui::XUIElement > SAL_CALL createUIElement( const OUString& ResourceURL, const css::uno::Sequence< css::beans::PropertyValue >& Args ) override;
57};
58
59StatusBarFactory::StatusBarFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ) :
60 MenuBarFactory( xContext )
61{
62}
63
64// XUIElementFactory
65Reference< XUIElement > SAL_CALL StatusBarFactory::createUIElement(
66 const OUString& ResourceURL,
67 const Sequence< PropertyValue >& Args )
68{
70 MenuBarFactory::CreateUIElement(ResourceURL, Args, u"private:resource/statusbar/", xStatusBar, m_xContext);
71 return xStatusBar;
72}
73
74}
75
76extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
78 css::uno::XComponentContext *context,
79 css::uno::Sequence<css::uno::Any> const &)
80{
81 return cppu::acquire(new StatusBarFactory(context));
82}
83
84/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::ui::XUIElement > SAL_CALL createUIElement(const OUString &ResourceURL, const css::uno::Sequence< css::beans::PropertyValue > &Args) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
virtual OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_framework_StatusBarFactory_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
unsigned char sal_Bool