LibreOffice Module sc (master) 1
|
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... | |
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.
|
explicit |
ppPropNames | A null-terminated array of ASCII property names. |
Definition at line 271 of file fapihelper.cxx.
References aPropName, maNameOrder, maNameSeq, and maValueSeq.
|
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().
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().
void ScfPropSetHelper::ReadFromPropertySet | ( | const ScfPropertySet & | rPropSet | ) |
Reads all values from the passed property set.
Definition at line 307 of file fapihelper.cxx.
References ScfPropertySet::GetProperties(), maNameSeq, maValueSeq, and mnNextIdx.
Referenced by XclChPropSetHelper::ReadAreaProperties(), XclChPropSetHelper::ReadEscherProperties(), XclFontPropSetHelper::ReadFontProperties(), and XclChPropSetHelper::ReadLineProperties().
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().
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().
void ScfPropSetHelper::ReadValue | ( | css::uno::Any & | rAny | ) |
Reads an Any from the value sequence.
Reads the next value from the value sequence.
Definition at line 265 of file fapihelper.hxx.
References GetNextAny().
Referenced by operator>>(), and ReadValue().
void ScfPropSetHelper::WriteToPropertySet | ( | ScfPropertySet & | rPropSet | ) | const |
Writes all values to the passed property set.
Definition at line 353 of file fapihelper.cxx.
References maNameSeq, maValueSeq, and ScfPropertySet::SetProperties().
Referenced by XclChPropSetHelper::WriteAreaProperties(), XclChPropSetHelper::WriteEscherProperties(), XclFontPropSetHelper::WriteFontProperties(), and XclChPropSetHelper::WriteLineProperties().
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().
|
inline |
Writes a color value to the value sequence.
Definition at line 245 of file fapihelper.hxx.
References WriteValue().
void ScfPropSetHelper::WriteValue | ( | const css::uno::Any & | rAny | ) |
Writes an Any to the value sequence.
Writes the next value to the value sequence.
Definition at line 273 of file fapihelper.hxx.
References GetNextAny().
Referenced by operator<<(), and WriteValue().
|
private |
Sequence of property values.
Definition at line 260 of file fapihelper.hxx.
Referenced by GetNextAny(), and ScfPropSetHelper().
|
private |
Definition at line 258 of file fapihelper.hxx.
Referenced by ReadFromPropertySet(), ScfPropSetHelper(), and WriteToPropertySet().
|
private |
Sequence of property names.
Definition at line 259 of file fapihelper.hxx.
Referenced by GetNextAny(), ReadFromPropertySet(), ScfPropSetHelper(), and WriteToPropertySet().
|
private |
Maps initial order to alphabetical order.
Definition at line 261 of file fapihelper.hxx.
Referenced by GetNextAny(), InitializeWrite(), and ReadFromPropertySet().