// infos about one single property struct COMPHELPER_DLLPUBLIC PropertyDescription
{ // the possibilities where a property holding object may be located enumclass LocationType
{
DerivedClassRealType, // within the derived class, it's a "real" (non-Any) type
DerivedClassAnyType, // within the derived class, it's a com.sun.star.uno::Any
HoldMyself // within m_aHoldProperties
}; // the location of an object holding a property value : union LocationAccess
{ void* pDerivedClassMember; // a pointer to a member of an object of a derived class
std::size_t nOwnClassVectorIndex; // an index within m_aHoldProperties
};
css::beans::Property aProperty;
LocationType eLocated; // where is the object containing the value located ?
LocationAccess aLocation; // access to the property value
Formoreinformation,seehttp://wiki.openoffice.org/wiki/Development/Cpp/Helper/PropertyContainerHelper.
*/ class COMPHELPER_DLLPUBLIC OPropertyContainerHelper
{ typedef ::std::vector< css::uno::Any > PropertyContainer;
PropertyContainer m_aHoldProperties; // the properties which are hold by this class' instance, not the derived one's
/** register a property. The property is represented through a member of the derived class which calls thismethod. @param_rNamethenameoftheproperty @param_nHandlethehandleoftheproperty @param_nAttributestheattributesoftheproperty @param_pPointerToMemberthepointertothememberrepresentingtheproperty withinthederivedclass. @param_rMemberTypethecpputypeofthepropertyrepresentedbytheobject towhich_pPointerToMemberpoints.
*/ void registerProperty(const OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void* _pPointerToMember, const css::uno::Type& _rMemberType);
/** register a property. The property is represented through a css::uno::Any member of the derivedclasswhichcallsthismethod. @param_rNamethenameoftheproperty @param_nHandlethehandleoftheproperty @param_nAttributestheattributesoftheproperty @param_pPointerToMemberthepointertothememberrepresentingtheproperty withinthederivedclass,whichhastobeacss::uno::Any. @param_rExpectedTypetheexpectedtypeoftheproperty.NOTthetypeoftheobjecttowhich _pPointerToMemberpoints(thisisalwaysanAny).
*/ void registerMayBeVoidProperty(const OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes,
css::uno::Any* _pPointerToMember, const css::uno::Type& _rExpectedType);
/** register a property. The repository will create an own object holding this property, so there is no needtodeclareanextramemberinyourderivedclass @param_rNamethenameoftheproperty @param_nHandlethehandleoftheproperty @param_nAttributestheattributesoftheproperty @param_rTypethetypeoftheproperty @param_pInitialValuetheinitialvalueoftheproperty.Maybevoidif_nAttributesincludes thecss::beans::PropertyAttribute::MAYBEVOIDflag. Elseitmustcontainavaluecompatiblewiththetypedescribedby_rType.
*/ void registerPropertyNoMember(const OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, const css::uno::Type& _rType, css::uno::Any const & _pInitialValue);
// helper /** appends the descriptions of all properties which were registered 'til that moment to the given sequence, keepingthearraysorted(byname) @precond thegivensequenceisalreadysortedbyname @param_rProps initialpropertysequencewhichistobeextended
*/ void describeProperties(css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps) const;
/** retrieves the description for a registered property @throwcss::beans::UnknownPropertyException ifnopropertywiththegivennameisregistered
*/ const css::beans::Property&
getProperty( const OUString& _rName ) const;
private: /// insertion of _rProp into m_aProperties, keeping the sort order
COMPHELPER_DLLPRIVATE void implPushBackProperty(const PropertyDescription& _rProp);
/// search the PropertyDescription for the given handle (within m_aProperties)
COMPHELPER_DLLPRIVATE PropertiesIterator searchHandle(sal_Int32 _nHandle);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.