LibreOffice Module basctl (master) 1
basidectrlr.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
20#include <basidectrlr.hxx>
21#include <basidesh.hxx>
22#include <com/sun/star/beans/PropertyAttribute.hpp>
23
24namespace basctl
25{
26
27using namespace com::sun::star;
28using namespace com::sun::star::uno;
29using namespace com::sun::star::beans;
30
31namespace
32{
33
34int const nPropertyIconId = 1;
35constexpr OUStringLiteral sPropertyIconId(u"IconId");
36
37}
38
40 :OPropertyContainer( m_aBHelper )
41 ,SfxBaseController( pViewShell )
42 ,m_nIconId( ICON_MACROLIBRARY )
43{
45 sPropertyIconId, nPropertyIconId,
46 PropertyAttribute::READONLY,
47 &m_nIconId, cppu::UnoType<decltype(m_nIconId)>::get()
48 );
49}
50
52{ }
53
54// XInterface
55Any SAL_CALL Controller::queryInterface( const Type & rType )
56{
57 Any aReturn = SfxBaseController::queryInterface( rType );
58 if ( !aReturn.hasValue() )
59 aReturn = OPropertyContainer::queryInterface( rType );
60
61 return aReturn;
62}
63
64void SAL_CALL Controller::acquire() noexcept
65{
66 SfxBaseController::acquire();
67}
68
69void SAL_CALL Controller::release() noexcept
70{
71 SfxBaseController::release();
72}
73
74// XTypeProvider ( ::SfxBaseController )
76{
77 Sequence< Type > aTypes = ::comphelper::concatSequences(
78 SfxBaseController::getTypes(),
80 );
81
82 return aTypes;
83}
84
86{
87 return css::uno::Sequence<sal_Int8>();
88}
89
90// XPropertySet
92{
93 Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
94 return xInfo;
95}
96
97// OPropertySetHelper
99{
100 return *getArrayHelper();
101}
102
103// OPropertyArrayUsageHelper
105{
107 describeProperties( aProps );
108 return new ::cppu::OPropertyArrayHelper( aProps );
109}
110
111} // namespace basctl
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL acquire() noexcept override
Definition: basidectrlr.cxx:64
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
Definition: basidectrlr.cxx:98
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: basidectrlr.cxx:85
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: basidectrlr.cxx:55
virtual ~Controller() override
Definition: basidectrlr.cxx:51
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: basidectrlr.cxx:91
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
Controller(Shell *pViewShell)
Definition: basidectrlr.cxx:39
virtual void SAL_CALL release() noexcept override
Definition: basidectrlr.cxx:69
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: basidectrlr.cxx:75
::cppu::IPropertyArrayHelper * getArrayHelper()
void describeProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
static css::uno::Sequence< css::uno::Type > getBaseTypes()
Type
#define ICON_MACROLIBRARY
const SvXMLTokenMapEntry aTypes[]