namespace com::sun::star::beans
{ class XPropertySet;
} namespace com::sun::star::drawing
{ class XShape;
}
namespace accessibility
{ /** This class creates description strings for shapes. <p>Initializedwithagivenshapeadditionalcallstothe <member>addProperty</member>methodwillbuildadescriptivestringthat startswithageneralshapedescriptionandtheshapesstyle.Appended areallthespecifiedpropertynamesandvaluesthatdifferfromthe defaultvaluesinthestyle.</p>
*/ class DescriptionGenerator
{ public: enumclass PropertyType
{
Color,
Integer
};
/** Creates a new description generator with an empty description string.Usuallyyouwillwanttocallinitializenexttospecify ageneraldescriptionoftheshape. @paramxShape Theshapefromwhichpropertieswillbeextractedbylatercalls to<member>addProperty</member>.
*/
DescriptionGenerator(css::uno::Reference<css::drawing::XShape> xShape);
~DescriptionGenerator();
/** Initialize the description with the given prefix followed by the shapestyleinparenthesesandacolon. @paramsPrefix Anintroductorydescriptionoftheshapethatismademore specificbylatercallsto<member>addProperty</member>.
*/ void Initialize(std::u16string_view sPrefix);
/** Initialize the description with the specified string from the resourcefollowedbytheshapestyleinparenthesesandacolon. @parampResourceId Aresourceidthespecifiestheintroductorydescriptionofthe shapethatismademorespecificbylatercallsto <member>addProperty</member>.
*/ void Initialize(TranslateId pResourceId);
/** Returns the description string and then resets it. Usually called aslastmethodbeforedestroyingtheobject. @return Thedescriptionstringinitscurrentform.
*/
OUString operator()(void);
/** Add the given property name and its associated value to the descriptionstring.Ifthepropertyvaluedoesnotdifferfromthe defaultvalueoftheshape'sstylethenthedescriptionstringis notmodified. @paramsPropertyName TheNameofthepropertytoappend. @paramaType Typeoftheproperty'svalue.Itcontrolsthetransformation intothevalue'sstringrepresentation. @paramsLocalizedName Localizednameoftheproperty.Anemptystringtellsthe methodtousethepropertynameinstead.
*/ void AddProperty(const OUString& sPropertyName, PropertyType aType);
/** Append the given string as is to the current description. @paramsString Stringtoappendtothecurrentdescription.Itisnotmodified inanyway.
*/ void AppendString(std::u16string_view sString);
private: /// Reference to the shape from which the properties are extracted.
css::uno::Reference<css::drawing::XShape> mxShape;
/// Reference to the shape's property set.
css::uno::Reference<css::beans::XPropertySet> mxSet;
/// The description string that is build.
OUStringBuffer msDescription;
/** This flag is used to determine whether to insert a separator e.g. a commabeforethenextproperty.
*/ bool mbIsFirstProperty;
/** Add a property value formatted as color to the description string.
*/ void AddColor(const OUString& sPropertyName);
/** Add a property value formatted as integer to the description string.
*/ void AddInteger(const OUString& sPropertyName);
};
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.