LibreOffice Module filter (master) 1
util.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef INCLUDED_FILTER_MSFILTER_UTIL_HXX
11#define INCLUDED_FILTER_MSFILTER_UTIL_HXX
12
14#include <svx/msdffdef.hxx>
15#include <rtl/string.hxx>
16#include <rtl/textenc.h>
17#include <rtl/ustring.hxx>
18#include <sal/types.h>
19#include <tools/datetime.hxx>
20#include <tools/long.hxx>
21
22class Color;
23
24namespace com::sun::star {
25 namespace awt { struct Size; }
26 namespace lang { struct Locale; }
27}
28
29namespace msfilter::util {
30
34MSFILTER_DLLPUBLIC rtl_TextEncoding getBestTextEncodingFromLocale(const css::lang::Locale &rLocale);
35
37MSFILTER_DLLPUBLIC ::Color BGRToRGB(sal_uInt32 nColour);
38
42
56 rtl_TextEncoding& r_ioChrSet, OUString& r_ioFontName);
57
58
64MSFILTER_DLLPUBLIC OString ConvertColor( const Color &rColor );
65MSFILTER_DLLPUBLIC OUString ConvertColorOU( const Color &rColor );
66
67
70{
71 sal_Int32 mnWidth;
72 sal_Int32 mnHeight;
73};
74
76{
77public:
78 static sal_Int32 getMSPaperSizeIndex( const css::awt::Size& rSize );
79 static const ApiPaperSize& getApiSizeForMSPaperSizeIndex( sal_Int32 nMSOPaperIndex );
80};
81
82MSFILTER_DLLPUBLIC OUString CreateDOCXStyleId(std::u16string_view aName);
83
89MSFILTER_DLLPUBLIC std::u16string_view findQuotedText( std::u16string_view rCommand, std::u16string_view cStartQuote, const sal_Unicode uEndQuote );
90
92{
93private:
94 const OUString aData;
95 sal_Int32 nFnd;
96 sal_Int32 nNext;
97 sal_Int32 nSavPtr;
98public:
99 WW8ReadFieldParams( OUString aData );
100
101 bool GoToTokenParam();
102 sal_Int32 SkipToNextToken();
103 sal_Int32 GetTokenSttPtr() const { return nFnd; }
104
105 sal_Int32 FindNextStringPiece( sal_Int32 _nStart = -1 );
106 bool GetTokenSttFromTo(sal_Int32* _pFrom, sal_Int32* _pTo, sal_Int32 _nMax);
107
108 OUString GetResult() const;
109};
110
112{
113 OUString sResult;
114 OUString sType;
115};
116
118
120MSFILTER_DLLPUBLIC OString GetOOXMLPresetGeometry( std::u16string_view rShapeType );
121
123MSFILTER_DLLPUBLIC MSO_SPT GETVMLShapeType(std::u16string_view aType);
124
130MSFILTER_DLLPUBLIC bool HasTextBoxContent(sal_uInt32 nShapeType);
131
140
141}
142
143
144
145#endif
146
147/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 GetTokenSttPtr() const
Definition: util.hxx:103
MSO_SPT
#define MSFILTER_DLLPUBLIC
Shape IDs per cluster in DGG atom.
::Color BGRToRGB(sal_uInt32 nColor)
Convert a color in BGR format to RGB.
Definition: util.cxx:49
OUString ConvertColorOU(const Color &rColor)
Definition: util.cxx:150
DateTime DTTM2DateTime(tools::Long lDTTM)
Convert from DTTM to Writer's DateTime.
Definition: util.cxx:59
std::u16string_view findQuotedText(std::u16string_view rCommand, std::u16string_view sStartQuote, const sal_Unicode uEndQuote)
Finds the quoted text in a field instruction text.
Definition: util.cxx:333
OString ConvertColor(const Color &rColor)
Converts tools Color to HTML color (without leading hashmark).
Definition: util.cxx:130
rtl_TextEncoding getBestTextEncodingFromLocale(const css::lang::Locale &rLocale)
Returns the best-fit default 8bit encoding for a given locale i.e.
Definition: util.cxx:27
bool HasTextBoxContent(sal_uInt32 nShapeType)
The following function checks if a MSO shapetype is allowed to have textboxcontent.
Definition: util.cxx:1238
sal_uInt8 TransColToIco(const Color &rCol)
Convert the input color value to an ico value (0..16)
Definition: util.cxx:1319
EquationResult ParseCombinedChars(const OUString &rStr)
Definition: util.cxx:615
sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cChar, rtl_TextEncoding &rChrSet, OUString &rFontName)
Convert DateTime to xsd::dateTime string.
Definition: util.cxx:92
OUString CreateDOCXStyleId(std::u16string_view const aName)
Definition: util.cxx:315
OString GetOOXMLPresetGeometry(std::u16string_view rShapeType)
Similar to EnhancedCustomShapeTypeNames::Get(), but it also supports OOXML types and returns a drawin...
Definition: util.cxx:625
MSO_SPT GETVMLShapeType(std::u16string_view aType)
Similar to EnhancedCustomShapeTypeNames::Get(), but returns an MSO_SPT (binary / VML type).
Definition: util.cxx:1025
long Long
Paper size in 1/100 millimeters.
Definition: util.hxx:70
unsigned char sal_uInt8
sal_uInt16 sal_Unicode