LibreOffice Module sc (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ScfPropSetHelper Class Reference

Generic helper class for reading from and writing to property sets. More...

#include <fapihelper.hxx>

Public Member Functions

 ScfPropSetHelper (const char *const *ppcPropNames)
 
void ReadFromPropertySet (const ScfPropertySet &rPropSet)
 Reads all values from the passed property set. More...
 
template<typename Type >
void ReadValue (Type &rValue)
 Reads the next value from the value sequence. More...
 
void ReadValue (css::uno::Any &rAny)
 Reads an Any from the value sequence. More...
 
void ReadValue (Color &rColor)
 Reads a color value from the value sequence. More...
 
void ReadValue (bool &rbValue)
 Reads a C++ boolean value from the value sequence. More...
 
void InitializeWrite ()
 Must be called before reading or storing property values in the helper. More...
 
template<typename Type >
void WriteValue (const Type &rValue)
 Writes the next value to the value sequence. More...
 
void WriteValue (const css::uno::Any &rAny)
 Writes an Any to the value sequence. More...
 
void WriteValue (const Color &rColor)
 Writes a color value to the value sequence. More...
 
void WriteValue (bool rbValue)
 Writes a C++ boolean value to the value sequence. More...
 
void WriteToPropertySet (ScfPropertySet &rPropSet) const
 Writes all values to the passed property set. More...
 

Private Member Functions

css::uno::Any * GetNextAny ()
 Returns a pointer to the next Any to be written to. More...
 

Private Attributes

css::uno::Sequence< OUString > maNameSeq
 
css::uno::Sequence< css::uno::Any > maValueSeq
 Sequence of property names. More...
 
ScfInt32Vec maNameOrder
 Sequence of property values. More...
 
size_t mnNextIdx
 Maps initial order to alphabetical order. More...
 

Detailed Description

Generic helper class for reading from and writing to property sets.

Usage: 1) Call the constructor with a null-terminated array of ASCII strings. 2a) Read properties from a property set: Call the ReadFromPropertySet() function, then get the properties with the ReadValue() functions or the operator>> stream operator. The properties are returned in order of the array of property names passed in the constructor. 2b) Write properties to a property set: Call InitializeWrite() to start a new cycle. Set the values with the WriteValue() functions or the operator<< stream operator. The order of the properties is equal to the array of property names passed in the constructor. Finally, call the WriteToPropertySet() function.

Definition at line 213 of file fapihelper.hxx.

Constructor & Destructor Documentation

◆ ScfPropSetHelper()

ScfPropSetHelper::ScfPropSetHelper ( const char *const *  ppcPropNames)
explicit
Parameters
ppPropNamesA null-terminated array of ASCII property names.

Definition at line 271 of file fapihelper.cxx.

References aPropName, maNameOrder, maNameSeq, and maValueSeq.

Member Function Documentation

◆ GetNextAny()

Any * ScfPropSetHelper::GetNextAny ( )
private

Returns a pointer to the next Any to be written to.

Definition at line 360 of file fapihelper.cxx.

References Any, maNameOrder, maValueSeq, and mnNextIdx.

Referenced by ReadValue(), and WriteValue().

◆ InitializeWrite()

void ScfPropSetHelper::InitializeWrite ( )

Must be called before reading or storing property values in the helper.

Definition at line 336 of file fapihelper.cxx.

References mnNextIdx.

Referenced by XclChPropSetHelper::WriteAreaProperties(), XclChPropSetHelper::WriteEscherProperties(), XclFontPropSetHelper::WriteFontProperties(), and XclChPropSetHelper::WriteLineProperties().

◆ ReadFromPropertySet()

void ScfPropSetHelper::ReadFromPropertySet ( const ScfPropertySet rPropSet)

◆ ReadValue() [1/4]

void ScfPropSetHelper::ReadValue ( bool &  rbValue)

Reads a C++ boolean value from the value sequence.

Definition at line 327 of file fapihelper.cxx.

References Any, ScUnoHelpFunctions::GetBoolFromAny(), and ReadValue().

◆ ReadValue() [2/4]

void ScfPropSetHelper::ReadValue ( Color rColor)

Reads a color value from the value sequence.

Definition at line 320 of file fapihelper.cxx.

References ColorTransparency, and ReadValue().

◆ ReadValue() [3/4]

void ScfPropSetHelper::ReadValue ( css::uno::Any &  rAny)

Reads an Any from the value sequence.

◆ ReadValue() [4/4]

template<typename Type >
void ScfPropSetHelper::ReadValue ( Type rValue)

Reads the next value from the value sequence.

Definition at line 265 of file fapihelper.hxx.

References GetNextAny().

Referenced by operator>>(), and ReadValue().

◆ WriteToPropertySet()

void ScfPropSetHelper::WriteToPropertySet ( ScfPropertySet rPropSet) const

◆ WriteValue() [1/4]

void ScfPropSetHelper::WriteValue ( bool  rbValue)

Writes a C++ boolean value to the value sequence.

Definition at line 347 of file fapihelper.cxx.

References Any, and GetNextAny().

◆ WriteValue() [2/4]

void ScfPropSetHelper::WriteValue ( const Color rColor)
inline

Writes a color value to the value sequence.

Definition at line 245 of file fapihelper.hxx.

References WriteValue().

◆ WriteValue() [3/4]

void ScfPropSetHelper::WriteValue ( const css::uno::Any &  rAny)

Writes an Any to the value sequence.

◆ WriteValue() [4/4]

template<typename Type >
void ScfPropSetHelper::WriteValue ( const Type rValue)

Writes the next value to the value sequence.

Definition at line 273 of file fapihelper.hxx.

References GetNextAny().

Referenced by operator<<(), and WriteValue().

Member Data Documentation

◆ maNameOrder

ScfInt32Vec ScfPropSetHelper::maNameOrder
private

Sequence of property values.

Definition at line 260 of file fapihelper.hxx.

Referenced by GetNextAny(), and ScfPropSetHelper().

◆ maNameSeq

css::uno::Sequence< OUString > ScfPropSetHelper::maNameSeq
private

Definition at line 258 of file fapihelper.hxx.

Referenced by ReadFromPropertySet(), ScfPropSetHelper(), and WriteToPropertySet().

◆ maValueSeq

css::uno::Sequence< css::uno::Any > ScfPropSetHelper::maValueSeq
private

Sequence of property names.

Definition at line 259 of file fapihelper.hxx.

Referenced by GetNextAny(), ReadFromPropertySet(), ScfPropSetHelper(), and WriteToPropertySet().

◆ mnNextIdx

size_t ScfPropSetHelper::mnNextIdx
private

Maps initial order to alphabetical order.

Definition at line 261 of file fapihelper.hxx.

Referenced by GetNextAny(), InitializeWrite(), and ReadFromPropertySet().


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