1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <canvas/canvastools.hxx>
23 #include <attributemap.hxx>
31 typedef ::canvas::tools::ValueMap
< AttributeType
> AnimateAttributeMap
;
33 AttributeType
mapAttributeName( const OUString
& rAttrName
)
35 /** Maps attribute name to AttributeType enum.
37 String entries are all case-insensitive and MUST
40 String entries MUST BE SORTED in ascending order!
42 static const AnimateAttributeMap::MapEntry lcl_attributeMap
[] =
44 { "charcolor", AttributeType::CharColor
},
45 { "charfontname", AttributeType::CharFontName
},
46 { "charheight", AttributeType::CharHeight
},
47 { "charposture", AttributeType::CharPosture
},
48 // TODO(Q1): This should prolly be changed in PPT import
49 // { "charrotation", AttributeType::CharRotation },
50 { "charrotation", AttributeType::Rotate
},
51 { "charunderline", AttributeType::CharUnderline
},
52 { "charweight", AttributeType::CharWeight
},
53 { "color", AttributeType::Color
},
54 { "dimcolor", AttributeType::DimColor
},
55 { "fillcolor", AttributeType::FillColor
},
56 { "fillstyle", AttributeType::FillStyle
},
57 { "height", AttributeType::Height
},
58 { "linecolor", AttributeType::LineColor
},
59 { "linestyle", AttributeType::LineStyle
},
60 { "opacity", AttributeType::Opacity
},
61 { "rotate", AttributeType::Rotate
},
62 { "skewx", AttributeType::SkewX
},
63 { "skewy", AttributeType::SkewY
},
64 { "visibility", AttributeType::Visibility
},
65 { "width", AttributeType::Width
},
66 { "x", AttributeType::PosX
},
67 { "y", AttributeType::PosY
}
70 static const AnimateAttributeMap
aMap( lcl_attributeMap
,
71 SAL_N_ELEMENTS(lcl_attributeMap
),
74 AttributeType eAttributeType
= AttributeType::Invalid
;
76 // determine the type from the attribute name
77 if( !aMap
.lookup( rAttrName
,
80 SAL_WARN("slideshow", "mapAttributeName(): attribute name not found in map: " << rAttrName
);
81 return AttributeType::Invalid
;
84 return eAttributeType
;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */