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 214 of file fapihelper.hxx.

Constructor & Destructor Documentation

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 maNameOrder, maNameSeq, and maValueSeq.

Member Function Documentation

Any * ScfPropSetHelper::GetNextAny ( )
private

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

Definition at line 359 of file fapihelper.cxx.

References Any, maNameOrder, maValueSeq, and mnNextIdx.

Referenced by ReadValue(), and WriteValue().

void ScfPropSetHelper::InitializeWrite ( )

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

Definition at line 335 of file fapihelper.cxx.

References mnNextIdx.

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

void ScfPropSetHelper::ReadFromPropertySet ( const ScfPropertySet rPropSet)
template<typename Type >
void ScfPropSetHelper::ReadValue ( Type rValue)

Reads the next value from the value sequence.

Definition at line 266 of file fapihelper.hxx.

References GetNextAny().

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

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

Reads an Any from the value sequence.

void ScfPropSetHelper::ReadValue ( Color rColor)

Reads a color value from the value sequence.

Definition at line 319 of file fapihelper.cxx.

References ReadValue().

void ScfPropSetHelper::ReadValue ( bool &  rbValue)

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

Definition at line 326 of file fapihelper.cxx.

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

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

Writes the next value to the value sequence.

Definition at line 274 of file fapihelper.hxx.

References GetNextAny().

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

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

Writes an Any to the value sequence.

void ScfPropSetHelper::WriteValue ( const Color rColor)
inline

Writes a color value to the value sequence.

Definition at line 246 of file fapihelper.hxx.

References WriteValue().

void ScfPropSetHelper::WriteValue ( bool  rbValue)

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

Definition at line 346 of file fapihelper.cxx.

References Any, and GetNextAny().

Member Data Documentation

ScfInt32Vec ScfPropSetHelper::maNameOrder
private

Sequence of property values.

Definition at line 261 of file fapihelper.hxx.

Referenced by GetNextAny(), and ScfPropSetHelper().

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

Definition at line 259 of file fapihelper.hxx.

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

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

Sequence of property names.

Definition at line 260 of file fapihelper.hxx.

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

size_t ScfPropSetHelper::mnNextIdx
private

Maps initial order to alphabetical order.

Definition at line 262 of file fapihelper.hxx.

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


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