LibreOffice Module slideshow (master)
1
slideshow
source
engine
attributemap.cxx
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
* This file incorporates work covered by the following license notice:
10
*
11
* Licensed to the Apache Software Foundation (ASF) under one or more
12
* contributor license agreements. See the NOTICE file distributed
13
* with this work for additional information regarding copyright
14
* ownership. The ASF licenses this file to you under the Apache
15
* License, Version 2.0 (the "License"); you may not use this file
16
* except in compliance with the License. You may obtain a copy of
17
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
*/
19
20
21
#include <
canvas/canvastools.hxx
>
22
23
#include <
attributemap.hxx
>
24
#include <
sal/log.hxx
>
25
26
27
namespace
slideshow::internal
28
{
29
typedef ::canvas::tools::ValueMap< AttributeType >
AnimateAttributeMap
;
30
31
AttributeType
mapAttributeName
(
const
OUString& rAttrName )
32
{
40
static
const
AnimateAttributeMap::MapEntry lcl_attributeMap[] =
41
{
42
{
"charcolor"
,
AttributeType::CharColor
},
43
{
"charfontname"
,
AttributeType::CharFontName
},
44
{
"charheight"
,
AttributeType::CharHeight
},
45
{
"charposture"
,
AttributeType::CharPosture
},
46
// TODO(Q1): This should prolly be changed in PPT import
47
// { "charrotation", AttributeType::CharRotation },
48
{
"charrotation"
,
AttributeType::Rotate
},
49
{
"charunderline"
,
AttributeType::CharUnderline
},
50
{
"charweight"
,
AttributeType::CharWeight
},
51
{
"color"
,
AttributeType::Color
},
52
{
"dimcolor"
,
AttributeType::DimColor
},
53
{
"fillcolor"
,
AttributeType::FillColor
},
54
{
"fillstyle"
,
AttributeType::FillStyle
},
55
{
"height"
,
AttributeType::Height
},
56
{
"linecolor"
,
AttributeType::LineColor
},
57
{
"linestyle"
,
AttributeType::LineStyle
},
58
{
"opacity"
,
AttributeType::Opacity
},
59
{
"rotate"
,
AttributeType::Rotate
},
60
{
"skewx"
,
AttributeType::SkewX
},
61
{
"skewy"
,
AttributeType::SkewY
},
62
{
"visibility"
,
AttributeType::Visibility
},
63
{
"width"
,
AttributeType::Width
},
64
{
"x"
,
AttributeType::PosX
},
65
{
"y"
,
AttributeType::PosY
}
66
};
67
68
static
const
AnimateAttributeMap
aMap
( lcl_attributeMap,
69
SAL_N_ELEMENTS
(lcl_attributeMap),
70
false
);
71
72
AttributeType
eAttributeType =
AttributeType::Invalid
;
73
74
// determine the type from the attribute name
75
if
( !
aMap
.lookup( rAttrName,
76
eAttributeType ) )
77
{
78
SAL_WARN
(
"slideshow"
,
"mapAttributeName(): attribute name not found in map: "
<< rAttrName);
79
return
AttributeType::Invalid
;
80
}
81
82
return
eAttributeType;
83
}
84
85
}
86
87
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
attributemap.hxx
canvastools.hxx
canvas::tools::ValueMap
log.hxx
SAL_WARN
#define SAL_WARN(area, stream)
SAL_N_ELEMENTS
#define SAL_N_ELEMENTS(arr)
slideshow::internal
Definition:
accumulation.hxx:28
slideshow::internal::AnimateAttributeMap
::canvas::tools::ValueMap< AttributeType > AnimateAttributeMap
Definition:
attributemap.cxx:29
slideshow::internal::AttributeType
AttributeType
Type of to-be-animated attribute.
Definition:
attributemap.hxx:35
slideshow::internal::AttributeType::PosX
@ PosX
slideshow::internal::AttributeType::Visibility
@ Visibility
slideshow::internal::AttributeType::Width
@ Width
slideshow::internal::AttributeType::LineColor
@ LineColor
slideshow::internal::AttributeType::Invalid
@ Invalid
slideshow::internal::AttributeType::SkewX
@ SkewX
slideshow::internal::AttributeType::FillColor
@ FillColor
slideshow::internal::AttributeType::CharColor
@ CharColor
slideshow::internal::AttributeType::PosY
@ PosY
slideshow::internal::AttributeType::CharUnderline
@ CharUnderline
slideshow::internal::AttributeType::Rotate
@ Rotate
slideshow::internal::AttributeType::FillStyle
@ FillStyle
slideshow::internal::AttributeType::CharPosture
@ CharPosture
slideshow::internal::AttributeType::CharFontName
@ CharFontName
slideshow::internal::AttributeType::Opacity
@ Opacity
slideshow::internal::AttributeType::DimColor
@ DimColor
slideshow::internal::AttributeType::Color
@ Color
slideshow::internal::AttributeType::CharWeight
@ CharWeight
slideshow::internal::AttributeType::SkewY
@ SkewY
slideshow::internal::AttributeType::Height
@ Height
slideshow::internal::AttributeType::LineStyle
@ LineStyle
slideshow::internal::AttributeType::CharHeight
@ CharHeight
slideshow::internal::mapAttributeName
AttributeType mapAttributeName(const OUString &rAttrName)
Map attribute name to AttributeType enum.
Definition:
attributemap.cxx:31
aMap
HashMap_OWString_Interface aMap
Generated on Sun Jul 30 2023 04:26:35 for LibreOffice Module slideshow (master) by
1.9.3