LibreOffice Module vbahelper (master) 1
vbacommandbarcontrol.hxx
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#ifndef INCLUDED_VBAHELPER_SOURCE_VBAHELPER_VBACOMMANDBARCONTROL_HXX
20#define INCLUDED_VBAHELPER_SOURCE_VBAHELPER_VBACOMMANDBARCONTROL_HXX
21
22#include <ooo/vba/XCommandBarControl.hpp>
23#include <ooo/vba/XCommandBarPopup.hpp>
24#include <ooo/vba/XCommandBarButton.hpp>
25#include <ooo/vba/office/MsoControlType.hpp>
26#include <com/sun/star/awt/XMenu.hpp>
30
32
34{
35protected:
38 css::uno::Reference< css::container::XIndexAccess > m_xCurrentSettings;
39 css::uno::Reference< css::container::XIndexAccess > m_xBarSettings;
40 css::uno::Sequence< css::beans::PropertyValue > m_aPropertyValues;
41
42 sal_Int32 m_nPosition;
43
44private:
46 void ApplyChange();
47
48public:
50 ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::container::XIndexAccess > xSettings, VbaCommandBarHelperRef pHelper, css::uno::Reference< css::container::XIndexAccess > xBarSettings, OUString sResourceUrl );
51
52 // Attributes
53 virtual OUString SAL_CALL getCaption() override;
54 virtual void SAL_CALL setCaption( const OUString& _caption ) override;
55 virtual OUString SAL_CALL getOnAction() override;
56 virtual void SAL_CALL setOnAction( const OUString& _onaction ) override;
57 virtual sal_Bool SAL_CALL getVisible() override;
58 virtual void SAL_CALL setVisible( sal_Bool _visible ) override;
59 virtual sal_Bool SAL_CALL getEnabled() override;
60 virtual void SAL_CALL setEnabled( sal_Bool _enabled ) override;
61 virtual sal_Bool SAL_CALL getBeginGroup() override;
62 virtual void SAL_CALL setBeginGroup( sal_Bool _begin ) override;
63 virtual sal_Int32 SAL_CALL getType() override
64 {
65 return ov::office::MsoControlType::msoControlButton;
66 }
67
68 // Methods
69 virtual void SAL_CALL Delete( ) override;
70 virtual css::uno::Any SAL_CALL Controls( const css::uno::Any& aIndex ) override;
71
72 // XHelperInterface
73 virtual OUString getServiceImplName() override;
74 virtual css::uno::Sequence<OUString> getServiceNames() override;
75};
76
77typedef cppu::ImplInheritanceHelper< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE;
79{
80public:
82 ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition );
83
84 virtual sal_Int32 SAL_CALL getType() override
85 {
86 return ov::office::MsoControlType::msoControlPopup;
87 }
88 // XHelperInterface
89 virtual OUString getServiceImplName() override;
90 virtual css::uno::Sequence<OUString> getServiceNames() override;
91};
92
93typedef cppu::ImplInheritanceHelper< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE;
95{
96public:
98 ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition );
99
100 virtual sal_Int32 SAL_CALL getType() override
101 {
102 return ov::office::MsoControlType::msoControlButton;
103 }
104 // XHelperInterface
105 virtual OUString getServiceImplName() override;
106 virtual css::uno::Sequence<OUString> getServiceNames() override;
107};
108
109#endif // INCLUDED_VBAHELPER_SOURCE_VBAHELPER_VBACOMMANDBARCONTROL_HXX
110
111/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScVbaCommandBarButton(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::container::XIndexAccess > &xSettings, const VbaCommandBarHelperRef &pHelper, const css::uno::Reference< css::container::XIndexAccess > &xBarSettings, const OUString &sResourceUrl, sal_Int32 nPosition)
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual sal_Int32 SAL_CALL getType() override
css::uno::Sequence< css::beans::PropertyValue > m_aPropertyValues
css::uno::Reference< css::container::XIndexAccess > m_xBarSettings
virtual css::uno::Any SAL_CALL Controls(const css::uno::Any &aIndex) override
virtual void SAL_CALL setCaption(const OUString &_caption) override
virtual OUString SAL_CALL getOnAction() override
virtual OUString getServiceImplName() override
virtual OUString SAL_CALL getCaption() override
virtual void SAL_CALL setVisible(sal_Bool _visible) override
VbaCommandBarHelperRef pCBarHelper
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual void SAL_CALL Delete() override
virtual void SAL_CALL setEnabled(sal_Bool _enabled) override
virtual sal_Int32 SAL_CALL getType() override
css::uno::Reference< css::container::XIndexAccess > m_xCurrentSettings
virtual void SAL_CALL setOnAction(const OUString &_onaction) override
ScVbaCommandBarControl(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::container::XIndexAccess > xSettings, VbaCommandBarHelperRef pHelper, css::uno::Reference< css::container::XIndexAccess > xBarSettings, OUString sResourceUrl)
virtual sal_Bool SAL_CALL getBeginGroup() override
virtual void SAL_CALL setBeginGroup(sal_Bool _begin) override
virtual sal_Bool SAL_CALL getEnabled() override
virtual sal_Bool SAL_CALL getVisible() override
virtual sal_Int32 SAL_CALL getType() override
virtual OUString getServiceImplName() override
virtual css::uno::Sequence< OUString > getServiceNames() override
ScVbaCommandBarPopup(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::container::XIndexAccess > &xSettings, const VbaCommandBarHelperRef &pHelper, const css::uno::Reference< css::container::XIndexAccess > &xBarSettings, const OUString &sResourceUrl, sal_Int32 nPosition)
unsigned char sal_Bool
cppu::ImplInheritanceHelper< ScVbaCommandBarControl, ov::XCommandBarPopup > CommandBarPopup_BASE
cppu::ImplInheritanceHelper< ScVbaCommandBarControl, ov::XCommandBarButton > CommandBarButton_BASE
InheritedHelperInterfaceWeakImpl< ov::XCommandBarControl > CommandBarControl_BASE
std::shared_ptr< VbaCommandBarHelper > VbaCommandBarHelperRef