LibreOffice: cppuhelper/propertysetmixin.hxx Source File

LibreOffice LibreOffice 26.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
propertysetmixin.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
20/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
25#define INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
26
27#include "sal/config.h"
28
29#include "com/sun/star/beans/XFastPropertySet.hpp"
30#include "com/sun/star/beans/XPropertyAccess.hpp"
31#include "com/sun/star/beans/XPropertySet.hpp"
32#include "com/sun/star/uno/Reference.h"
33#include "com/sun/star/uno/Sequence.hxx"
34#include "sal/types.h"
35#include "cppuhelper/cppuhelperdllapi.h"
36
37namespace com { namespace sun { namespace star {
38 namespace beans {
39 class XPropertyChangeListener;
40 class XPropertySetInfo;
41 class XVetoableChangeListener;
42 struct PropertyValue;
43 }
44 namespace uno {
45 class Type;
46 class XComponentContext;
47 }
48} } }
49
50namespace cppu {
51
70 class CPPUHELPER_DLLPUBLIC PropertySetMixinImpl:
71 public css::beans::XPropertySet,
72 public css::beans::XFastPropertySet,
73 public css::beans::XPropertyAccess
74{
75protected:
81 enum Implements {
86 IMPLEMENTS_PROPERTY_SET = 1,
87
93 IMPLEMENTS_FAST_PROPERTY_SET = 2,
94
100 IMPLEMENTS_PROPERTY_ACCESS = 4
101 };
102
115 class CPPUHELPER_DLLPUBLIC BoundListeners {
116 public:
122 BoundListeners();
123
129 ~BoundListeners();
130
141 void notify() const;
142
143 private:
144 BoundListeners( const BoundListeners&) SAL_DELETED_FUNCTION;
145 void operator=( const BoundListeners&) SAL_DELETED_FUNCTION;
146
147 class Impl;
148 Impl * m_impl;
149
150 friend class PropertySetMixinImpl;
151 };
152
212 void prepareSet(
213 rtl::OUString const & propertyName,
214 css::uno::Any const & oldValue,
215 css::uno::Any const & newValue,
216 BoundListeners * boundListeners);
217
232 void dispose();
233
247 virtual css::uno::Any SAL_CALL queryInterface(
248 css::uno::Type const & type) SAL_OVERRIDE;
249
250 // @see css::beans::XPropertySet::getPropertySetInfo
251 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE;
252
253 // @see css::beans::XPropertySet::setPropertyValue
254 virtual void SAL_CALL setPropertyValue(
255 rtl::OUString const & propertyName,
256 css::uno::Any const & value) SAL_OVERRIDE;
257
258 // @see css::beans::XPropertySet::getPropertyValue
259 virtual css::uno::Any SAL_CALL getPropertyValue(
260 rtl::OUString const & propertyName) SAL_OVERRIDE;
261
271 virtual void SAL_CALL addPropertyChangeListener(
272 rtl::OUString const & propertyName,
273 css::uno::Reference<
274 css::beans::XPropertyChangeListener > const & listener) SAL_OVERRIDE;
275
276 // @see css::beans::XPropertySet::removePropertyChangeListener
277 virtual void SAL_CALL removePropertyChangeListener(
278 rtl::OUString const & propertyName,
279 css::uno::Reference<
280 css::beans::XPropertyChangeListener > const & listener) SAL_OVERRIDE;
281
291 virtual void SAL_CALL addVetoableChangeListener(
292 rtl::OUString const & propertyName,
293 css::uno::Reference<
294 css::beans::XVetoableChangeListener > const & listener) SAL_OVERRIDE;
295
296 // @see css::beans::XPropertySet::removeVetoableChangeListener
297 virtual void SAL_CALL removeVetoableChangeListener(
298 rtl::OUString const & propertyName,
299 css::uno::Reference<
300 css::beans::XVetoableChangeListener > const & listener) SAL_OVERRIDE;
301
302 // @see css::beans::XFastPropertySet::setFastPropertyValue
303 virtual void SAL_CALL setFastPropertyValue(
304 sal_Int32 handle, css::uno::Any const & value) SAL_OVERRIDE;
305
306 // @see css::beans::XFastPropertySet::getFastPropertyValue
307 virtual css::uno::Any SAL_CALL getFastPropertyValue(
308 sal_Int32 handle) SAL_OVERRIDE;
309
310 // @see css::beans::XPropertyAccess::getPropertyValues
311 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() SAL_OVERRIDE;
312
313 // @see css::beans::XPropertyAccess::setPropertyValues
314 virtual void SAL_CALL setPropertyValues(
315 css::uno::Sequence< css::beans::PropertyValue > const & props) SAL_OVERRIDE;
316
317private:
318 PropertySetMixinImpl( const PropertySetMixinImpl&) SAL_DELETED_FUNCTION;
319 void operator=( const PropertySetMixinImpl&) SAL_DELETED_FUNCTION;
320
321 PropertySetMixinImpl(
322 css::uno::Reference< css::uno::XComponentContext > const & context,
323 Implements implements,
324 css::uno::Sequence< rtl::OUString > const & absentOptional,
325 css::uno::Type const & type);
326
327 class Impl;
328 Impl * m_impl;
329
330 friend class Impl;
331 template< typename T > friend class PropertySetMixin;
332
333 ~PropertySetMixinImpl();
334
335 void checkUnknown(rtl::OUString const & propertyName);
336};
337
350template< typename T > class PropertySetMixin: public PropertySetMixinImpl {
351protected:
392 PropertySetMixin(
393 css::uno::Reference< css::uno::XComponentContext > const & context,
394 Implements implements,
395 css::uno::Sequence< rtl::OUString > const & absentOptional):
396 PropertySetMixinImpl(
397 context, implements, absentOptional, T::static_type())
398 {}
399
405 ~PropertySetMixin() {}
406
407private:
408 PropertySetMixin( const PropertySetMixin&) SAL_DELETED_FUNCTION;
409 void operator=( const PropertySetMixin&) SAL_DELETED_FUNCTION;
410};
411
412}
413
414#endif
415
416/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
types.h
SAL_DELETED_FUNCTION
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition types.h:396
SAL_OVERRIDE
#define SAL_OVERRIDE
C++11 "override" feature.
Definition types.h:409
config.h
cppuhelperdllapi.h
CPPUHELPER_DLLPUBLIC
#define CPPUHELPER_DLLPUBLIC
Definition cppuhelperdllapi.h:32
Reference.h
Sequence.hxx
com
Definition types.h:377
com::sun
Definition types.h:377
com::sun::star
Definition types.h:377
rtl
Definition bootstrap.hxx:34
com::sun::star::uno
Definition typedescription.hxx:43
cppu
Definition Enterable.hxx:31
com::sun::star::beans
Definition propertysetmixin.hxx:38
rtl::OUString
This String class provides base functionality for C++ like Unicode character array handling.
Definition ustring.hxx:168
com::sun::star::uno::Reference
Template reference class for interface type derived from BaseReference.
Definition Reference.h:184
com::sun::star::uno::Sequence< rtl::OUString >
cppu::PropertySetMixinImpl::setPropertyValue
virtual void setPropertyValue(rtl::OUString const &propertyName, css::uno::Any const &value) SAL_OVERRIDE
cppu::PropertySetMixinImpl::getPropertyValue
virtual css::uno::Any getPropertyValue(rtl::OUString const &propertyName) SAL_OVERRIDE
cppu::PropertySetMixinImpl::addVetoableChangeListener
virtual void addVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
Adds a css::beans::XVetoableChangeListener.
cppu::PropertySetMixinImpl::queryInterface
virtual css::uno::Any queryInterface(css::uno::Type const &type) SAL_OVERRIDE
A function used by subclasses of cppu::PropertySetMixin when implementing css::uno::XInterface::query...
cppu::PropertySetMixinImpl::addPropertyChangeListener
virtual void addPropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
Adds a css::beans::XPropertyChangeListener.
cppu::PropertySetMixinImpl::getPropertySetInfo
virtual css::uno::Reference< css::beans::XPropertySetInfo > getPropertySetInfo() SAL_OVERRIDE
cppu::PropertySetMixinImpl::dispose
void dispose()
Mark this instance as being disposed.
cppu::PropertySetMixinImpl::getPropertyValues
virtual css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() SAL_OVERRIDE
cppu::PropertySetMixinImpl::removeVetoableChangeListener
virtual void removeVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
cppu::PropertySetMixinImpl::Implements
Implements
Flags used by subclasses of cppu::PropertySetMixin to specify what UNO interface types shall be suppo...
Definition propertysetmixin.hxx:81
cppu::PropertySetMixinImpl::IMPLEMENTS_FAST_PROPERTY_SET
@ IMPLEMENTS_FAST_PROPERTY_SET
Flag specifying that the UNO interface type css::beans::XFastPropertySet shall be supported.
Definition propertysetmixin.hxx:93
cppu::PropertySetMixinImpl::IMPLEMENTS_PROPERTY_ACCESS
@ IMPLEMENTS_PROPERTY_ACCESS
Flag specifying that the UNO interface type css::beans::XPropertyAccess shall be supported.
Definition propertysetmixin.hxx:100
cppu::PropertySetMixinImpl::IMPLEMENTS_PROPERTY_SET
@ IMPLEMENTS_PROPERTY_SET
Flag specifying that the UNO interface type css::beans::XPropertySet shall be supported.
Definition propertysetmixin.hxx:86
cppu::PropertySetMixinImpl::PropertySetMixin
friend class PropertySetMixin
Definition propertysetmixin.hxx:331
cppu::PropertySetMixinImpl::prepareSet
void prepareSet(rtl::OUString const &propertyName, css::uno::Any const &oldValue, css::uno::Any const &newValue, BoundListeners *boundListeners)
A function used by subclasses of cppu::PropertySetMixin when implementing UNO interface type attribut...
cppu::PropertySetMixinImpl::setFastPropertyValue
virtual void setFastPropertyValue(sal_Int32 handle, css::uno::Any const &value) SAL_OVERRIDE
cppu::PropertySetMixinImpl::Impl
friend class Impl
Definition propertysetmixin.hxx:330
cppu::PropertySetMixinImpl::getFastPropertyValue
virtual css::uno::Any getFastPropertyValue(sal_Int32 handle) SAL_OVERRIDE
cppu::PropertySetMixinImpl::setPropertyValues
virtual void setPropertyValues(css::uno::Sequence< css::beans::PropertyValue > const &props) SAL_OVERRIDE
cppu::PropertySetMixinImpl::removePropertyChangeListener
virtual void removePropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
cppu::PropertySetMixinImpl::BoundListeners
A class used by subclasses of cppu::PropertySetMixin when implementing UNO interface type attribute s...
Definition propertysetmixin.hxx:115
cppu::PropertySetMixinImpl::BoundListeners::~BoundListeners
~BoundListeners()
The destructor.
cppu::PropertySetMixinImpl::BoundListeners::notify
void notify() const
Notifies any css::beans::XPropertyChangeListeners.
cppu::PropertySetMixinImpl::BoundListeners::PropertySetMixinImpl
friend class PropertySetMixinImpl
Definition propertysetmixin.hxx:150
cppu::PropertySetMixinImpl::BoundListeners::BoundListeners
BoundListeners()
The constructor.
cppu::PropertySetMixin
A helper mixin to implement certain UNO interfaces related to property set handling on top of the att...
Definition propertysetmixin.hxx:350
cppu::PropertySetMixin::PropertySetMixin
PropertySetMixin(css::uno::Reference< css::uno::XComponentContext > const &context, Implements implements, css::uno::Sequence< rtl::OUString > const &absentOptional)
The constructor.
Definition propertysetmixin.hxx:392
cppu::PropertySetMixin::~PropertySetMixin
~PropertySetMixin()
The destructor.
Definition propertysetmixin.hxx:405
com::sun::star::uno::Any
C++ class representing an IDL any.
Definition Any.h:62
com::sun::star::uno::Type
C++ class representing an IDL meta type.
Definition Type.h:59