tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / framework / source / uifactory / toolbarfactory.cxx
blobc179839224145396a052610f18487cf821e72c20
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 <cppuhelper/supportsservice.hxx>
21 #include <vcl/svapp.hxx>
22 #include <uielement/toolbarwrapper.hxx>
23 #include <uifactory/menubarfactory.hxx>
25 using namespace com::sun::star::uno;
26 using namespace com::sun::star::lang;
27 using namespace com::sun::star::beans;
28 using namespace ::com::sun::star::ui;
29 using namespace framework;
31 namespace {
33 class ToolBarFactory : public MenuBarFactory
35 public:
36 explicit ToolBarFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext );
38 virtual OUString SAL_CALL getImplementationName() override
40 return u"com.sun.star.comp.framework.ToolBarFactory"_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.ToolBarFactory"_ustr};
53 // XUIElementFactory
54 virtual css::uno::Reference< css::ui::XUIElement > SAL_CALL createUIElement(
55 const OUString& ResourceURL, const css::uno::Sequence< css::beans::PropertyValue >& Args ) override;
58 ToolBarFactory::ToolBarFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ) :
59 MenuBarFactory( xContext )
63 // XUIElementFactory
64 Reference< XUIElement > SAL_CALL ToolBarFactory::createUIElement(
65 const OUString& ResourceURL,
66 const Sequence< PropertyValue >& Args )
68 Reference< css::ui::XUIElement > xToolBar = new ToolBarWrapper(m_xContext);
69 CreateUIElement(ResourceURL, Args, u"private:resource/toolbar/", xToolBar, m_xContext);
70 return xToolBar;
75 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
76 com_sun_star_comp_framework_ToolBarFactory_get_implementation(
77 css::uno::XComponentContext *context,
78 css::uno::Sequence<css::uno::Any> const &)
80 return cppu::acquire(new ToolBarFactory(context));
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */