LibreOffice Module cppuhelper (master) 1
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
cppu::OPropertyArrayHelper Class Reference

You can use this helper class to map a XPropertySet-Interface to a XFast- or a XMultiPropertySet interface. More...

#include <propshlp.hxx>

Inheritance diagram for cppu::OPropertyArrayHelper:
[legend]
Collaboration diagram for cppu::OPropertyArrayHelper:
[legend]

Public Member Functions

 OPropertyArrayHelper (css::beans::Property *pProps, sal_Int32 nElements, sal_Bool bSorted=true)
 Create an object which supports the common property interfaces. More...
 
 OPropertyArrayHelper (const css::uno::Sequence< css::beans::Property > &aProps, sal_Bool bSorted=true)
 Create an object which supports the common property interfaces. More...
 
sal_Int32 SAL_CALL getCount () const
 Return the number of properties. More...
 
virtual sal_Bool SAL_CALL fillPropertyMembersByHandle (::rtl::OUString *pPropName, sal_Int16 *pAttributes, sal_Int32 nHandle) SAL_OVERRIDE
 Return the property members Name and Attribute from the handle nHandle. More...
 
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties () SAL_OVERRIDE
 Return the sequence of properties. More...
 
virtual css::beans::Property SAL_CALL getPropertyByName (const ::rtl::OUString &rPropertyName) SAL_OVERRIDE
 Return the property with the name rPropertyName. More...
 
virtual sal_Bool SAL_CALL hasPropertyByName (const ::rtl::OUString &rPropertyName) SAL_OVERRIDE
 Return true if the property with the name rPropertyName exist, otherwise false. More...
 
virtual sal_Int32 SAL_CALL getHandleByName (const ::rtl::OUString &rPropertyName) SAL_OVERRIDE
 Return the handle of the property with the name rPropertyName. More...
 
virtual sal_Int32 SAL_CALL fillHandles (sal_Int32 *pHandles, const css::uno::Sequence< ::rtl::OUString > &rPropNames) SAL_OVERRIDE
 Fill the array with the handles of the properties. More...
 
- Public Member Functions inherited from cppu::IPropertyArrayHelper
virtual ~IPropertyArrayHelper ()
 Following the rule, the first virtual method implies a virtual destructor. More...
 
virtual sal_Bool SAL_CALL fillPropertyMembersByHandle (::rtl::OUString *pPropName, sal_Int16 *pAttributes, sal_Int32 nHandle)=0
 Return the property members Name and Attribute from the handle nHandle. More...
 
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties ()=0
 Return the sequence of properties. More...
 
virtual css::beans::Property SAL_CALL getPropertyByName (const ::rtl::OUString &rPropertyName)=0
 Return the property with the name rPropertyName. More...
 
virtual sal_Bool SAL_CALL hasPropertyByName (const ::rtl::OUString &rPropertyName)=0
 Return true if the property with the name rPropertyName exist, otherwise false. More...
 
virtual sal_Int32 SAL_CALL getHandleByName (const ::rtl::OUString &rPropertyName)=0
 Return the handle of the property with the name rPropertyName. More...
 
virtual sal_Int32 SAL_CALL fillHandles (sal_Int32 *pHandles, const css::uno::Sequence< ::rtl::OUString > &rPropNames)=0
 Fill the array with the handles of the properties. More...
 

Protected Attributes

void * m_pReserved
 reserved for future use. More...
 

Private Member Functions

void init (sal_Bool bSorted)
 

Private Attributes

css::uno::Sequence< css::beans::Property > aInfos
 The sequence generated from the pProperties array. More...
 
sal_Bool bRightOrdered
 True, If the values of the handles are sorted in the same way as the names and the highest handle value is getCount() -1, otherwise false. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from cppu::IPropertyArrayHelper
static void *SAL_CALL operator new (size_t nSize)
 
static void SAL_CALL operator delete (void *pMem)
 
static void *SAL_CALL operator new (size_t, void *pMem)
 
static void SAL_CALL operator delete (void *, void *)
 

Detailed Description

You can use this helper class to map a XPropertySet-Interface to a XFast- or a XMultiPropertySet interface.

Definition at line 116 of file propshlp.hxx.

Constructor & Destructor Documentation

◆ OPropertyArrayHelper() [1/2]

cppu::OPropertyArrayHelper::OPropertyArrayHelper ( css::beans::Property *  pProps,
sal_Int32  nElements,
sal_Bool  bSorted = true 
)

Create an object which supports the common property interfaces.

Parameters
pPropsarray of properties The array pProps should be sorted.
nElementsis the number of properties in the pProps structure.
bSortedindicates that the elements are sorted.

◆ OPropertyArrayHelper() [2/2]

cppu::OPropertyArrayHelper::OPropertyArrayHelper ( const css::uno::Sequence< css::beans::Property > &  aProps,
sal_Bool  bSorted = true 
)

Create an object which supports the common property interfaces.

Parameters
aPropssequence of properties which are supported by this helper. The sequence aProps should be sorted.
bSortedindicates that the elements are sorted.

Member Function Documentation

◆ fillHandles()

sal_Int32 cppu::OPropertyArrayHelper::fillHandles ( sal_Int32 *  pHandles,
const css::uno::Sequence< ::rtl::OUString > &  rPropNames 
)
virtual

Fill the array with the handles of the properties.

Returns
the handles of the names from the pHandles array. -1 indicates an unknown property name.

Implements cppu::IPropertyArrayHelper.

Definition at line 1108 of file propshlp.cxx.

References aInfos, i, n, and Property.

◆ fillPropertyMembersByHandle()

sal_Bool cppu::OPropertyArrayHelper::fillPropertyMembersByHandle ( ::rtl::OUString *  pPropName,
sal_Int16 *  pAttributes,
sal_Int32  nHandle 
)
virtual

Return the property members Name and Attribute from the handle nHandle.

Parameters
nHandlethe handle of a property. If the values of the handles are sorted in the same way as the names and the highest handle value is getCount() -1, then it is only an indexed access to the property array. Otherwise it is a linear search through the array.
pPropNameis an out parameter filled with property name of the property with the handle nHandle. May be NULL.
pAttributesis an out parameter filled with attributes of the property with the handle nHandle. May be NULL.
Returns
True, if the handle exist, otherwise false.

Implements cppu::IPropertyArrayHelper.

Definition at line 1033 of file propshlp.cxx.

References aInfos, bRightOrdered, Handle, i, nElements, nHandle, and Property.

◆ getCount()

sal_Int32 cppu::OPropertyArrayHelper::getCount ( ) const

Return the number of properties.

Definition at line 1027 of file propshlp.cxx.

References aInfos.

◆ getHandleByName()

sal_Int32 cppu::OPropertyArrayHelper::getHandleByName ( const ::rtl::OUString &  rPropertyName)
virtual

Return the handle of the property with the name rPropertyName.

If the property does not exist -1 is returned.

Parameters
rPropertyNamethe name of the property.

Implements cppu::IPropertyArrayHelper.

Definition at line 1098 of file propshlp.cxx.

References aInfos, cppu::compare_OUString_Property_Impl(), and Property.

◆ getProperties()

Sequence< Property > cppu::OPropertyArrayHelper::getProperties ( )
virtual

Return the sequence of properties.

The sequence is sorted by name.

Implements cppu::IPropertyArrayHelper.

Definition at line 1069 of file propshlp.cxx.

References aInfos.

◆ getPropertyByName()

Property cppu::OPropertyArrayHelper::getPropertyByName ( const ::rtl::OUString &  rPropertyName)
virtual

Return the property with the name rPropertyName.

Parameters
rPropertyNamethe name of the property.
Exceptions
UnknownPropertyExceptionthrown if the property name is unknown.

Implements cppu::IPropertyArrayHelper.

Definition at line 1075 of file propshlp.cxx.

References aInfos, cppu::compare_OUString_Property_Impl(), and Property.

◆ hasPropertyByName()

sal_Bool cppu::OPropertyArrayHelper::hasPropertyByName ( const ::rtl::OUString &  rPropertyName)
virtual

Return true if the property with the name rPropertyName exist, otherwise false.

Parameters
rPropertyNamethe name of the property.

Implements cppu::IPropertyArrayHelper.

Definition at line 1088 of file propshlp.cxx.

References aInfos, cppu::compare_OUString_Property_Impl(), and Property.

◆ init()

void cppu::OPropertyArrayHelper::init ( sal_Bool  bSorted)
private

Definition at line 979 of file propshlp.cxx.

References aInfos, bRightOrdered, cppu::compare_Property_Impl(), Handle, i, Name, nElements, and Property.

Member Data Documentation

◆ aInfos

css::uno::Sequence< css::beans::Property > cppu::OPropertyArrayHelper::aInfos
private

The sequence generated from the pProperties array.

Definition at line 199 of file propshlp.hxx.

Referenced by fillHandles(), fillPropertyMembersByHandle(), getCount(), getHandleByName(), getProperties(), getPropertyByName(), hasPropertyByName(), and init().

◆ bRightOrdered

sal_Bool cppu::OPropertyArrayHelper::bRightOrdered
private

True, If the values of the handles are sorted in the same way as the names and the highest handle value is getCount() -1, otherwise false.

Definition at line 205 of file propshlp.hxx.

Referenced by fillPropertyMembersByHandle(), and init().

◆ m_pReserved

void* cppu::OPropertyArrayHelper::m_pReserved
protected

reserved for future use.

do not use.

Definition at line 193 of file propshlp.hxx.


The documentation for this class was generated from the following files: