20#include <com/sun/star/animations/TransitionType.hpp>
21#include <com/sun/star/animations/TransitionSubType.hpp>
22#include <com/sun/star/animations/ValuePair.hpp>
23#include <com/sun/star/awt/FontWeight.hpp>
24#include <com/sun/star/awt/FontUnderline.hpp>
25#include <com/sun/star/awt/FontSlant.hpp>
26#include <com/sun/star/drawing/LineStyle.hpp>
27#include <com/sun/star/drawing/FillStyle.hpp>
28#include <com/sun/star/uno/Sequence.hxx>
34 int lcl_gethex(
int nChar)
36 if (nChar >=
'0' && nChar <=
'9')
38 else if (nChar >=
'a' && nChar <=
'f')
39 return nChar -
'a' + 10;
40 else if (nChar >=
'A' && nChar <=
'F')
41 return nChar -
'A' + 10;
85 {
"wipe(up)", css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::TOPTOBOTTOM,
true },
86 {
"wipe(right)", css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::LEFTTORIGHT,
false },
87 {
"wipe(left)", css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::LEFTTORIGHT,
true },
88 {
"wipe(down)", css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::TOPTOBOTTOM,
false },
89 {
"wheel(1)", css::animations::TransitionType::PINWHEELWIPE, css::animations::TransitionSubType::ONEBLADE,
true },
90 {
"wheel(2)", css::animations::TransitionType::PINWHEELWIPE, css::animations::TransitionSubType::TWOBLADEVERTICAL,
true },
91 {
"wheel(3)", css::animations::TransitionType::PINWHEELWIPE, css::animations::TransitionSubType::THREEBLADE,
true },
92 {
"wheel(4)", css::animations::TransitionType::PINWHEELWIPE, css::animations::TransitionSubType::FOURBLADE,
true },
93 {
"wheel(8)", css::animations::TransitionType::PINWHEELWIPE, css::animations::TransitionSubType::EIGHTBLADE,
true },
94 {
"strips(downLeft)", css::animations::TransitionType::WATERFALLWIPE, css::animations::TransitionSubType::HORIZONTALRIGHT,
true },
95 {
"strips(upLeft)", css::animations::TransitionType::WATERFALLWIPE, css::animations::TransitionSubType::HORIZONTALLEFT,
false },
96 {
"strips(downRight)", css::animations::TransitionType::WATERFALLWIPE, css::animations::TransitionSubType::HORIZONTALLEFT,
true },
97 {
"strips(upRight)", css::animations::TransitionType::WATERFALLWIPE, css::animations::TransitionSubType::HORIZONTALRIGHT,
false },
98 {
"barn(inVertical)", css::animations::TransitionType::BARNDOORWIPE, css::animations::TransitionSubType::VERTICAL,
false },
99 {
"barn(outVertical)", css::animations::TransitionType::BARNDOORWIPE, css::animations::TransitionSubType::VERTICAL,
true },
100 {
"barn(inHorizontal)", css::animations::TransitionType::BARNDOORWIPE, css::animations::TransitionSubType::HORIZONTAL,
false },
101 {
"barn(outHorizontal)", css::animations::TransitionType::BARNDOORWIPE, css::animations::TransitionSubType::HORIZONTAL,
true },
102 {
"randombar(vertical)", css::animations::TransitionType::RANDOMBARWIPE, css::animations::TransitionSubType::VERTICAL,
true},
103 {
"randombar(horizontal)", css::animations::TransitionType::RANDOMBARWIPE, css::animations::TransitionSubType::HORIZONTAL,
true },
104 {
"checkerboard(down)", css::animations::TransitionType::CHECKERBOARDWIPE, css::animations::TransitionSubType::DOWN,
true},
105 {
"checkerboard(across)", css::animations::TransitionType::CHECKERBOARDWIPE, css::animations::TransitionSubType::ACROSS,
true },
106 {
"plus(out)", css::animations::TransitionType::FOURBOXWIPE, css::animations::TransitionSubType::CORNERSIN,
false },
107 {
"plus(in)", css::animations::TransitionType::FOURBOXWIPE, css::animations::TransitionSubType::CORNERSIN,
true },
108 {
"diamond(out)", css::animations::TransitionType::IRISWIPE, css::animations::TransitionSubType::DIAMOND,
true },
109 {
"diamond(in)", css::animations::TransitionType::IRISWIPE, css::animations::TransitionSubType::DIAMOND,
false },
110 {
"circle(out)", css::animations::TransitionType::ELLIPSEWIPE, css::animations::TransitionSubType::HORIZONTAL,
true },
111 {
"circle(in)", css::animations::TransitionType::ELLIPSEWIPE, css::animations::TransitionSubType::HORIZONTAL,
false },
112 {
"box(out)", css::animations::TransitionType::IRISWIPE, css::animations::TransitionSubType::RECTANGLE,
true },
113 {
"box(in)", css::animations::TransitionType::IRISWIPE, css::animations::TransitionSubType::RECTANGLE,
false },
114 {
"wedge", css::animations::TransitionType::FANWIPE, css::animations::TransitionSubType::CENTERTOP,
true },
115 {
"blinds(vertical)", css::animations::TransitionType::BLINDSWIPE, css::animations::TransitionSubType::VERTICAL,
true },
116 {
"blinds(horizontal)", css::animations::TransitionType::BLINDSWIPE, css::animations::TransitionSubType::HORIZONTAL,
true },
117 {
"fade", css::animations::TransitionType::FADE, css::animations::TransitionSubType::CROSSFADE,
true },
118 {
"slide(fromTop)", css::animations::TransitionType::SLIDEWIPE, css::animations::TransitionSubType::FROMTOP,
true },
119 {
"slide(fromRight)", css::animations::TransitionType::SLIDEWIPE, css::animations::TransitionSubType::FROMRIGHT,
true },
120 {
"slide(fromLeft)", css::animations::TransitionType::SLIDEWIPE, css::animations::TransitionSubType::FROMLEFT,
true },
121 {
"slide(fromBottom)", css::animations::TransitionType::SLIDEWIPE, css::animations::TransitionSubType::FROMBOTTOM,
true },
122 {
"dissolve", css::animations::TransitionType::DISSOLVE, css::animations::TransitionSubType::DEFAULT,
true },
123 {
"image", css::animations::TransitionType::DISSOLVE, css::animations::TransitionSubType::DEFAULT,
true },
124 {
nullptr, 0, 0,
false }
149 const char* pSource[] = {
"ppt_x",
"ppt_y",
"ppt_w",
"ppt_h",
nullptr };
150 const char* pDest[] = {
"x",
"y",
"width",
"height",
nullptr };
158 const char** ps = pSource;
159 const char** pd = pDest;
163 const OUString aSearch(OUString::createFromAscii(*ps));
164 while ((
nIndex = rString.indexOf(aSearch,
nIndex)) != -1)
166 sal_Int32
nLength = aSearch.getLength();
173 const OUString aNew(OUString::createFromAscii(*pd));
175 nIndex += aNew.getLength();
187 using css::animations::ValuePair;
200 ValuePair aValuePair;
201 if (rValue >>= aValuePair)
203 if (aValuePair.First >>= aString)
207 aValuePair.First <<= aString;
212 if (aValuePair.Second >>= aString)
216 aValuePair.Second <<= aString;
224 if (rValue >>= aString)
239 if (rValue >>= aString)
241 rValue <<= aString.toDouble();
253 rValue <<= static_cast<sal_Int16>(aString.toDouble());
260 rValue <<= static_cast<sal_Int16>(fValue);
272 if (rValue >>= aString)
274 if (aString.getLength() >= 7 && aString[0] ==
'#')
278 + lcl_gethex(aString[2])));
280 + lcl_gethex(aString[4])));
282 + lcl_gethex(aString[6])));
286 else if (aString.startsWith(
"rgb("))
288 aString = aString.copy(4, aString.getLength() - 5);
300 else if (aString.startsWith(
"hsl("))
306 css::uno::Sequence<double> aHSL
323 if (rValue >>= aString)
325 rValue <<= aString ==
"true";
334 if (rValue >>= aString)
336 rValue <<= aString ==
"solid" ? css::drawing::FillStyle_SOLID
337 : css::drawing::FillStyle_NONE;
346 if (rValue >>= aString)
348 rValue <<= aString ==
"true" ? css::drawing::LineStyle_SOLID
349 : css::drawing::LineStyle_NONE;
358 if (rValue >>= aString)
360 rValue <<= aString ==
"bold" ? css::awt::FontWeight::BOLD
361 : css::awt::FontWeight::NORMAL;
370 if (rValue >>= aString)
373 <<= aString ==
"italic" ? css::awt::FontSlant_ITALIC : css::awt::FontSlant_NONE;
382 if (rValue >>= aString)
384 rValue <<= aString ==
"true" ? css::awt::FontUnderline::SINGLE
385 : css::awt::FontUnderline::NONE;
395 if (rValue >>= aString)
397 rValue <<= static_cast<float>(aString.toDouble());
406 if (rValue >>= aString)
408 rValue <<= aString ==
"visible";
void SetGreen(sal_uInt8 nGreen)
void SetRed(sal_uInt8 nRed)
void SetBlue(sal_uInt8 nBlue)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
bool equalsAscii(std::u16string_view s1, std::string_view s2)
bool convertMeasure(OUString &rString)
convert the measure string to LibreOffice format.
const ImplAttributeNameConversion * getAttributeConversionList()
bool convertAnimationValue(AnimationAttributeEnum eAttribute, css::uno::Any &rValue)
convert attribute values of the animation target so that LibreOffice understand.
static const transition * find(std::u16string_view rName)
static const transition * getList()