20 #ifndef INCLUDED_XMLOFF_XMLUCONV_HXX
21 #define INCLUDED_XMLOFF_XMLUCONV_HXX
29 #include <rtl/ustring.hxx>
30 #include <rtl/ustrbuf.hxx>
36 namespace text {
class XNumberingTypeInfo; }
67 bool getNextToken( std::u16string_view& rToken );
86 struct SAL_DLLPRIVATE
Impl;
94 const css::uno::Reference< css::uno::XComponentContext >& xContext,
95 sal_Int16 eCoreMeasureUnit ,
96 sal_Int16 eXMLMeasureUnit );
100 static sal_Int16 GetMeasureUnit(
FieldUnit const nFieldUnit);
103 void SetCoreMeasureUnit( sal_Int16
const eCoreMeasureUnit );
106 void SetXMLMeasureUnit( sal_Int16
const eXMLMeasureUnit );
109 sal_Int16 GetXMLMeasureUnit()
const;
112 const css::uno::Reference< css::text::XNumberingTypeInfo >& getNumTypeInfo()
const;
116 bool convertMeasureToCore( sal_Int32&
rValue,
117 std::u16string_view rString,
118 sal_Int32 nMin = SAL_MIN_INT32,
119 sal_Int32 nMax = SAL_MAX_INT32)
const;
123 bool convertMeasureToCore( sal_Int32&
rValue,
124 std::string_view rString,
125 sal_Int32 nMin = SAL_MIN_INT32,
126 sal_Int32 nMax = SAL_MAX_INT32)
const;
129 void convertMeasureToXML( OUStringBuffer& rBuffer,
130 sal_Int32 nMeasure )
const;
133 OUString convertMeasureToXML( sal_Int32 nMeasure )
const;
137 template<
typename EnumT>
139 std::u16string_view
rValue,
143 bool bRet = convertEnumImpl(nTmp, rValue,
146 rEnum =
static_cast<EnumT
>(nTmp);
152 template<
typename EnumT>
158 bool bRet = convertEnumImpl(nTmp, rValue,
161 rEnum =
static_cast<EnumT
>(nTmp);
167 template<
typename EnumT>
169 std::u16string_view
rValue,
173 bool bRet = convertEnumImpl(nTmp, rValue,
176 rEnum =
static_cast<EnumT
>(nTmp);
182 template<
typename EnumT>
188 bool bRet = convertEnumImpl(nTmp, rValue,
191 rEnum =
static_cast<EnumT
>(nTmp);
199 template<
typename EnumT>
206 return convertEnumImpl(rBuffer, static_cast<sal_uInt16>(nValue),
212 void convertDouble(OUStringBuffer& rBuffer,
213 double fNumber)
const;
216 bool convertDouble(
double&
rValue, std::u16string_view rString)
const;
220 const css::uno::Reference <css::frame::XModel>& xModel);
223 void convertDateTime( OUStringBuffer& rBuffer,
224 const double& fDateTime,
225 bool const bAddTimeIf0AM =
false);
228 bool convertDateTime(
double& fDateTime,
229 std::u16string_view rString);
232 bool convertDateTime(
double& fDateTime,
233 std::string_view rString);
238 static void convertDateTime( OUStringBuffer& rBuffer,
239 const double& fDateTime,
240 const css::util::Date& aNullDate,
241 bool bAddTimeIf0AM =
false);
243 static bool convertDateTime(
double& fDateTime,
244 std::u16string_view rString,
245 const css::util::Date& aNullDate);
247 static bool convertDateTime(
double& fDateTime,
248 std::string_view rString,
249 const css::util::Date& aNullDate);
254 std::u16string_view
rValue );
258 std::string_view
rValue );
261 static void convertB3DVector( OUStringBuffer &rBuffer,
262 const ::basegfx::B3DVector& rVector );
265 bool convertPosition3D( css::drawing::Position3D& rPosition,
266 std::string_view
rValue );
269 void convertPosition3D( OUStringBuffer &rBuffer,
270 const css::drawing::Position3D& rVector );
274 bool convertNumFormat( sal_Int16& rType,
275 const OUString& rNumFormat,
276 std::u16string_view rNumLetterSync,
277 bool bNumberNone =
false )
const;
280 void convertNumFormat( OUStringBuffer& rBuffer,
281 sal_Int16 nType )
const;
282 static void convertNumLetterSync( OUStringBuffer& rBuffer,
285 static void convertPropertySet(css::uno::Sequence<css::beans::PropertyValue>& rProps,
286 const css::uno::Reference<css::beans::XPropertySet>& aProperties);
287 static void convertPropertySet(css::uno::Reference<css::beans::XPropertySet>
const & rProperties,
288 const css::uno::Sequence<css::beans::PropertyValue>& aProps);
290 OUString encodeStyleName(
const OUString& rName,
291 bool *pEncoded=
nullptr )
const;
293 static bool convertHex( sal_uInt32& nVal,
294 std::u16string_view
rValue );
297 static void convertHex( OUStringBuffer& rBuffer,
301 static bool convertEnumImpl( sal_uInt16& rEnum,
302 std::u16string_view
rValue,
305 static bool convertEnumImpl( sal_uInt16& rEnum,
306 std::u16string_view
rValue,
309 static bool convertEnumImpl( sal_uInt16& rEnum,
313 static bool convertEnumImpl( sal_uInt16& rEnum,
317 static bool convertEnumImpl( OUStringBuffer& rBuffer,
323 #endif // INCLUDED_XMLOFF_XMLUCONV_HXX
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, this method will return false
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
std::u16string_view maTokenString
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, this method will return false
css::uno::Any const & rValue
XMLTokenEnum
The enumeration of all XML tokens.
exports com.sun.star. text
Map a const char* (with length) to a sal_uInt16 value.
class SAL_NO_VTABLE XPropertySet
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 SvXMLEnumMapEntry< EnumT > *pMap)
convert string to enum using given enum map, if the enum is not found in the map, this method will re...
Map an XMLTokenEnum to an enum value.
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...
::std::unique_ptr< Impl > m_pImpl