20#ifndef INCLUDED_XMLOFF_XMLUCONV_HXX
21#define INCLUDED_XMLOFF_XMLUCONV_HXX
29#include <rtl/ustring.hxx>
30#include <rtl/ustrbuf.hxx>
38 namespace text {
class XNumberingTypeInfo; }
69 bool getNextToken( std::u16string_view& rToken );
88 struct SAL_DLLPRIVATE
Impl;
96 const css::uno::Reference< css::uno::XComponentContext >& xContext,
97 sal_Int16 eCoreMeasureUnit ,
98 sal_Int16 eXMLMeasureUnit ,
103 static sal_Int16 GetMeasureUnit(
FieldUnit const nFieldUnit);
106 void SetCoreMeasureUnit( sal_Int16
const eCoreMeasureUnit );
109 void SetXMLMeasureUnit( sal_Int16
const eXMLMeasureUnit );
112 sal_Int16 GetXMLMeasureUnit()
const;
119 const css::uno::Reference< css::text::XNumberingTypeInfo >& getNumTypeInfo()
const;
123 bool convertMeasureToCore( sal_Int32& rValue,
124 std::u16string_view rString,
125 sal_Int32 nMin = SAL_MIN_INT32,
126 sal_Int32 nMax = SAL_MAX_INT32)
const;
130 bool convertMeasureToCore( sal_Int32& rValue,
131 std::string_view rString,
132 sal_Int32 nMin = SAL_MIN_INT32,
133 sal_Int32 nMax = SAL_MAX_INT32)
const;
136 void convertMeasureToXML( OUStringBuffer& rBuffer,
137 sal_Int32 nMeasure )
const;
140 OUString convertMeasureToXML( sal_Int32 nMeasure )
const;
144 template<
typename EnumT>
146 std::u16string_view rValue,
150 bool bRet = convertEnumImpl(nTmp, rValue,
153 rEnum =
static_cast<EnumT
>(nTmp);
159 template<
typename EnumT>
161 std::string_view rValue,
165 bool bRet = convertEnumImpl(nTmp, rValue,
168 rEnum =
static_cast<EnumT
>(nTmp);
174 template<
typename EnumT>
176 std::u16string_view rValue,
180 bool bRet = convertEnumImpl(nTmp, rValue,
183 rEnum =
static_cast<EnumT
>(nTmp);
189 template<
typename EnumT>
191 std::string_view rValue,
195 bool bRet = convertEnumImpl(nTmp, rValue,
198 rEnum =
static_cast<EnumT
>(nTmp);
206 template<
typename EnumT>
213 return convertEnumImpl(rBuffer,
static_cast<sal_uInt16
>(
nValue),
219 void convertDouble(OUStringBuffer& rBuffer,
220 double fNumber)
const;
223 bool convertDouble(
double& rValue, std::u16string_view rString)
const;
226 bool convertDouble(
double& rValue, std::string_view rString)
const;
230 const css::uno::Reference <css::frame::XModel>& xModel);
233 void convertDateTime( OUStringBuffer& rBuffer,
234 const double& fDateTime,
235 bool const bAddTimeIf0AM =
false);
238 bool convertDateTime(
double& fDateTime,
239 std::u16string_view rString)
const;
242 bool convertDateTime(
double& fDateTime,
243 std::string_view rString)
const;
248 static void convertDateTime( OUStringBuffer& rBuffer,
249 const double& fDateTime,
250 const css::util::Date& aNullDate,
251 bool bAddTimeIf0AM =
false);
253 static bool convertDateTime(
double& fDateTime,
254 std::u16string_view rString,
255 const css::util::Date& aNullDate);
257 static bool convertDateTime(
double& fDateTime,
258 std::string_view rString,
259 const css::util::Date& aNullDate);
263 std::string_view rValue );
266 static void convertB3DVector( OUStringBuffer &rBuffer,
267 const ::basegfx::B3DVector& rVector );
271 std::string_view rValue )
const;
275 const css::drawing::Position3D& rVector );
279 bool convertNumFormat( sal_Int16& rType,
280 const OUString& rNumFormat,
281 std::u16string_view rNumLetterSync,
282 bool bNumberNone =
false )
const;
285 void convertNumFormat( OUStringBuffer& rBuffer,
286 sal_Int16 nType )
const;
287 static void convertNumLetterSync( OUStringBuffer& rBuffer,
291 const css::uno::Reference<css::beans::XPropertySet>& aProperties,
292 const std::initializer_list<std::u16string_view>* pOmitFalseValues =
nullptr);
294 const css::uno::Sequence<css::beans::PropertyValue>& aProps);
296 OUString encodeStyleName(
const OUString& rName,
297 bool *pEncoded=
nullptr )
const;
299 static bool convertHex( sal_uInt32& nVal,
300 std::u16string_view rValue );
303 static void convertHex( OUStringBuffer& rBuffer,
307 static bool convertEnumImpl( sal_uInt16& rEnum,
308 std::u16string_view rValue,
311 static bool convertEnumImpl( sal_uInt16& rEnum,
312 std::u16string_view rValue,
315 static bool convertEnumImpl( sal_uInt16& rEnum,
316 std::string_view rValue,
320 std::string_view rValue,
std::u16string_view maTokenString
SvXMLTokenEnumerator(OUString &&, sal_Unicode cSeparator=u' ')=delete
just so no-one accidentally passes a temporary to this, and ends up with this class accessing the tem...
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
static bool convertEnumImpl(OUStringBuffer &rBuffer, sal_uInt16 nValue, const SvXMLEnumMapEntry< sal_uInt16 > *pMap, enum ::xmloff::token::XMLTokenEnum eDefault)
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
static bool convertEnum(OUStringBuffer &rBuffer, EnumT nValue, const SvXMLEnumMapEntry< EnumT > *pMap, enum ::xmloff::token::XMLTokenEnum eDefault=::xmloff::token::XML_TOKEN_INVALID)
convert enum to string using given enum map with an optional default token.
static bool convertEnum(EnumT &rEnum, std::string_view rValue, const SvXMLEnumStringMapEntry< EnumT > *pMap)
convert string to enum using given token map, if the enum is not found in the map,...
bool convertPosition3D(css::drawing::Position3D &rPosition, std::string_view rValue) const
convert string to Position3D
void convertPosition3D(OUStringBuffer &rBuffer, const css::drawing::Position3D &rVector)
convert Position3D to string
SvXMLUnitConverter(const SvXMLUnitConverter &)=delete
SvXMLUnitConverter(const css::uno::Reference< css::uno::XComponentContext > &xContext, sal_Int16 eCoreMeasureUnit, sal_Int16 eXMLMeasureUnit, SvtSaveOptions::ODFSaneDefaultVersion const nODFVersion)
constructs a SvXMLUnitConverter.
static void convertPropertySet(css::uno::Sequence< css::beans::PropertyValue > &rProps, const css::uno::Reference< css::beans::XPropertySet > &aProperties, const std::initializer_list< std::u16string_view > *pOmitFalseValues=nullptr)
::std::unique_ptr< Impl > m_pImpl
static bool convertEnum(EnumT &rEnum, std::string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumStringMapEntry< EnumT > *pMap)
convert string to enum using given token map, if the enum is not found in the map,...
static bool convertEnumImpl(sal_uInt16 &rEnum, std::string_view rValue, const SvXMLEnumStringMapEntry< sal_uInt16 > *pMap)
static void convertPropertySet(css::uno::Reference< css::beans::XPropertySet > const &rProperties, const css::uno::Sequence< css::beans::PropertyValue > &aProps)
SvXMLUnitConverter & operator=(const SvXMLUnitConverter &)=delete
class SAL_NO_VTABLE XPropertySet
XMLTokenEnum
The enumeration of all XML tokens.
Map a const char* (with length) to a sal_uInt16 value.