LibreOffice Module cppuhelper (master) 1
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"
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
71 public css::beans::XPropertySet,
72 public css::beans::XFastPropertySet,
73 public css::beans::XPropertyAccess
74{
75protected:
86 IMPLEMENTS_PROPERTY_SET = 1,
87
93 IMPLEMENTS_FAST_PROPERTY_SET = 2,
94
100 IMPLEMENTS_PROPERTY_ACCESS = 4
101 };
102
116 public:
123
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;
149
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
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
334
335 void checkUnknown(rtl::OUString const & propertyName);
336};
337
350template< typename T > class PropertySetMixin: public PropertySetMixinImpl {
351protected:
393 css::uno::Reference< css::uno::XComponentContext > const & context,
394 Implements implements,
395 css::uno::Sequence< rtl::OUString > const & absentOptional):
397 context, implements, absentOptional, T::static_type())
398 {}
399
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: */
A class used by subclasses of cppu::PropertySetMixin when implementing UNO interface type attribute s...
BoundListeners(const BoundListeners &) SAL_DELETED_FUNCTION
void operator=(const BoundListeners &) SAL_DELETED_FUNCTION
A helper base class for cppu::PropertySetMixin.
Implements
Flags used by subclasses of cppu::PropertySetMixin to specify what UNO interface types shall be suppo...
A helper mixin to implement certain UNO interfaces related to property set handling on top of the att...
PropertySetMixin(const PropertySetMixin &) SAL_DELETED_FUNCTION
PropertySetMixin(css::uno::Reference< css::uno::XComponentContext > const &context, Implements implements, css::uno::Sequence< rtl::OUString > const &absentOptional)
The constructor.
void operator=(const PropertySetMixin &) SAL_DELETED_FUNCTION
~PropertySetMixin()
The destructor.
#define CPPUHELPER_DLLPUBLIC
Type
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
void dispose()