AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
4 #ifndef INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
5 #define INCLUDED_CPPUHELPER_PROPERTYSETMIXIN_HXX
6 
7 #include "sal/config.h"
8 
9 #include "com/sun/star/beans/XFastPropertySet.hpp"
10 #include "com/sun/star/beans/XPropertyAccess.hpp"
11 #include "com/sun/star/beans/XPropertySet.hpp"
14 #include "sal/types.h"
16 
17 namespace com { namespace sun { namespace star {
18  namespace beans {
19  class XPropertyChangeListener;
20  class XPropertySetInfo;
21  class XVetoableChangeListener;
22  struct PropertyValue;
23  }
24  namespace uno {
25  class Type;
26  class XComponentContext;
27  }
28 } } }
29 
30 namespace cppu {
31 
51  public css::beans::XPropertySet,
52  public css::beans::XFastPropertySet,
53  public css::beans::XPropertyAccess
54 {
55 protected:
61  enum Implements {
66  IMPLEMENTS_PROPERTY_SET = 1,
67 
73  IMPLEMENTS_FAST_PROPERTY_SET = 2,
74 
80  IMPLEMENTS_PROPERTY_ACCESS = 4
81  };
82 
96  public:
102  BoundListeners();
103 
109  ~BoundListeners();
110 
121  void notify() const;
122 
123  private:
125  void operator=( const BoundListeners&) SAL_DELETED_FUNCTION;
126 
127  class Impl;
128  Impl * m_impl;
129 
130  friend class PropertySetMixinImpl;
131  };
132 
192  void prepareSet(
193  rtl::OUString const & propertyName,
194  css::uno::Any const & oldValue,
195  css::uno::Any const & newValue,
196  BoundListeners * boundListeners);
197 
212  void dispose();
213 
227  virtual css::uno::Any SAL_CALL queryInterface(
228  css::uno::Type const & type) SAL_OVERRIDE;
229 
230  // @see css::beans::XPropertySet::getPropertySetInfo
231  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE;
232 
233  // @see css::beans::XPropertySet::setPropertyValue
234  virtual void SAL_CALL setPropertyValue(
235  rtl::OUString const & propertyName,
236  css::uno::Any const & value) SAL_OVERRIDE;
237 
238  // @see css::beans::XPropertySet::getPropertyValue
239  virtual css::uno::Any SAL_CALL getPropertyValue(
240  rtl::OUString const & propertyName) SAL_OVERRIDE;
241 
251  virtual void SAL_CALL addPropertyChangeListener(
252  rtl::OUString const & propertyName,
253  css::uno::Reference<
254  css::beans::XPropertyChangeListener > const & listener) SAL_OVERRIDE;
255 
256  // @see css::beans::XPropertySet::removePropertyChangeListener
257  virtual void SAL_CALL removePropertyChangeListener(
258  rtl::OUString const & propertyName,
259  css::uno::Reference<
260  css::beans::XPropertyChangeListener > const & listener) SAL_OVERRIDE;
261 
271  virtual void SAL_CALL addVetoableChangeListener(
272  rtl::OUString const & propertyName,
273  css::uno::Reference<
274  css::beans::XVetoableChangeListener > const & listener) SAL_OVERRIDE;
275 
276  // @see css::beans::XPropertySet::removeVetoableChangeListener
277  virtual void SAL_CALL removeVetoableChangeListener(
278  rtl::OUString const & propertyName,
279  css::uno::Reference<
280  css::beans::XVetoableChangeListener > const & listener) SAL_OVERRIDE;
281 
282  // @see css::beans::XFastPropertySet::setFastPropertyValue
283  virtual void SAL_CALL setFastPropertyValue(
284  sal_Int32 handle, css::uno::Any const & value) SAL_OVERRIDE;
285 
286  // @see css::beans::XFastPropertySet::getFastPropertyValue
287  virtual css::uno::Any SAL_CALL getFastPropertyValue(
288  sal_Int32 handle) SAL_OVERRIDE;
289 
290  // @see css::beans::XPropertyAccess::getPropertyValues
291  virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() SAL_OVERRIDE;
292 
293  // @see css::beans::XPropertyAccess::setPropertyValues
294  virtual void SAL_CALL setPropertyValues(
295  css::uno::Sequence< css::beans::PropertyValue > const & props) SAL_OVERRIDE;
296 
297 private:
299  void operator=( const PropertySetMixinImpl&) SAL_DELETED_FUNCTION;
300 
302  css::uno::Reference< css::uno::XComponentContext > const & context,
303  Implements implements,
304  css::uno::Sequence< rtl::OUString > const & absentOptional,
305  css::uno::Type const & type);
306 
307  class Impl;
308  Impl * m_impl;
309 
310  friend class Impl;
311  template< typename T > friend class PropertySetMixin;
312 
314 
315  void checkUnknown(rtl::OUString const & propertyName);
316 };
317 
330 template< typename T > class PropertySetMixin: public PropertySetMixinImpl {
331 protected:
373  css::uno::Reference< css::uno::XComponentContext > const & context,
374  Implements implements,
375  css::uno::Sequence< rtl::OUString > const & absentOptional):
376  PropertySetMixinImpl(
377  context, implements, absentOptional, T::static_type())
378  {}
379 
386 
387 private:
388  PropertySetMixin( const PropertySetMixin&) SAL_DELETED_FUNCTION;
389  void operator=( const PropertySetMixin&) SAL_DELETED_FUNCTION;
390 };
391 
392 }
393 
394 #endif
395 
396 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A class used by subclasses of cppu::PropertySetMixin when implementing UNO interface type attribute s...
Definition: propertysetmixin.hxx:95
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:182
A helper base class for cppu::PropertySetMixin.
Definition: propertysetmixin.hxx:50
Implements
Flags used by subclasses of cppu::PropertySetMixin to specify what UNO interface types shall be suppo...
Definition: propertysetmixin.hxx:61
#define CPPUHELPER_DLLPUBLIC
Definition: cppuhelperdllapi.h:12
PropertySetMixin(css::uno::Reference< css::uno::XComponentContext > const &context, Implements implements, css::uno::Sequence< rtl::OUString > const &absentOptional)
The constructor.
Definition: propertysetmixin.hxx:372
css::uno::Any queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
Definition: queryinterface.hxx:23
A helper mixin to implement certain UNO interfaces related to property set handling on top of the att...
Definition: propertysetmixin.hxx:330
~PropertySetMixin()
The destructor.
Definition: propertysetmixin.hxx:385
#define SAL_OVERRIDE
C++11 &quot;override&quot; feature.
Definition: types.h:371
#define SAL_DELETED_FUNCTION
short-circuit extra-verbose API namespaces
Definition: types.h:358