20#ifndef INCLUDED_OOX_HELPER_ATTRIBUTELIST_HXX
21#define INCLUDED_OOX_HELPER_ATTRIBUTELIST_HXX
28#include <com/sun/star/uno/Reference.hxx>
29#include <com/sun/star/util/DateTime.hpp>
32#include <rtl/ustring.hxx>
37 namespace xml::sax {
class XFastAttributeList; }
41 class FastAttributeList;
56 static sal_Int32 decodeToken( std::u16string_view rValue );
60 static OUString decodeXString(
const OUString& rValue );
63 static sal_Int32 decodeInteger( std::u16string_view rValue );
66 static sal_uInt32 decodeUnsigned( std::u16string_view rValue );
69 static sal_Int64 decodeHyper( std::u16string_view rValue );
72 static sal_Int32 decodeIntegerHex( std::u16string_view rValue );
86 const css::uno::Reference< css::xml::sax::XFastAttributeList >& rxAttribs );
89 const css::uno::Reference< css::xml::sax::XFastAttributeList >&
93 bool hasAttribute( sal_Int32 nAttrToken )
const;
98 std::optional< sal_Int32 >
getToken( sal_Int32 nAttrToken )
const;
104 std::optional< OUString >
getString( sal_Int32 nAttrToken )
const;
107 OUString getStringDefaulted( sal_Int32 nAttrToken )
const;
111 std::optional< OUString > getXString( sal_Int32 nAttrToken )
const;
114 std::optional< double >
getDouble( sal_Int32 nAttrToken )
const;
117 std::optional< sal_Int32 > getInteger( sal_Int32 nAttrToken )
const;
120 std::optional< sal_uInt32 > getUnsigned( sal_Int32 nAttrToken )
const;
123 std::optional< sal_Int64 > getHyper( sal_Int32 nAttrToken )
const;
126 std::optional< sal_Int32 > getIntegerHex( sal_Int32 nAttrToken )
const;
129 std::optional< bool > getBool( sal_Int32 nAttrToken )
const;
132 std::optional< css::util::DateTime > getDateTime( sal_Int32 nAttrToken )
const;
138 sal_Int32
getToken( sal_Int32 nAttrToken, sal_Int32 nDefault )
const;
142 OUString
getString( sal_Int32 nAttrToken,
const OUString& rDefault )
const;
146 OUString getXString( sal_Int32 nAttrToken,
const OUString& rDefault )
const;
148 std::string_view
getView( sal_Int32 nAttrToken )
const;
153 double getDouble( sal_Int32 nAttrToken,
double fDefault )
const;
157 sal_Int32 getInteger( sal_Int32 nAttrToken, sal_Int32 nDefault )
const;
161 sal_uInt32 getUnsigned( sal_Int32 nAttrToken, sal_uInt32 nDefault )
const;
165 sal_Int64 getHyper( sal_Int32 nAttrToken, sal_Int64 nDefault )
const;
169 sal_Int32 getIntegerHex( sal_Int32 nAttrToken, sal_Int32 nDefault )
const;
171 sal_uInt32 getUnsignedHex( sal_Int32 nAttrToken, sal_uInt32 nDefault )
const;
175 bool getBool( sal_Int32 nAttrToken,
bool bDefault )
const;
179 css::util::DateTime
getDateTime( sal_Int32 nAttrToken,
const css::util::DateTime& rDefault )
const;
181 std::vector<sal_Int32> getTokenList(sal_Int32 nAttrToken)
const;
184 css::uno::Reference< css::xml::sax::XFastAttributeList >
Static helpers for conversion of strings to attribute values of various different data types.
Provides access to attribute values of an element.
css::uno::Reference< css::xml::sax::XFastAttributeList > mxAttribs
sax_fastparser::FastAttributeList * mpAttribList
AttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &rxAttribs)
css::util::DateTime getDateTime(sal_Int32 nAttrToken, const css::util::DateTime &rDefault) const
Returns the date/time value of the specified attribute, or the default value if the attribute is miss...
const css::uno::Reference< css::xml::sax::XFastAttributeList > & getFastAttributeList() const
Returns the wrapped com.sun.star.xml.sax.XFastAttributeList object.
sal_Int32 getToken(const Context &rContext, const char *pToken)
double getDouble(const Any &_rAny)
OUString getString(const Any &_rAny)
SwView * getView(const uno::Reference< frame::XModel > &xModel)
sal_Int32 getHighlightColorTokenFromString(std::u16string_view sColorName)