bump product version to 7.6.3.2-android
[LibreOffice.git] / xmloff / source / forms / formenums.cxx
blob31567ddf7478033fa40ed7895c8f8d5c509b3e23
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include "formenums.hxx"
21 #include <com/sun/star/form/FormSubmitEncoding.hpp>
22 #include <com/sun/star/form/FormSubmitMethod.hpp>
23 #include <com/sun/star/sdb/CommandType.hpp>
24 #include <com/sun/star/form/NavigationBarMode.hpp>
25 #include <com/sun/star/form/TabulatorCycle.hpp>
26 #include <com/sun/star/form/FormButtonType.hpp>
27 #include <com/sun/star/form/ListSourceType.hpp>
28 #include <com/sun/star/awt/TextAlign.hpp>
29 #include <com/sun/star/awt/FontEmphasisMark.hpp>
30 #include <com/sun/star/awt/FontRelief.hpp>
31 #include <com/sun/star/awt/ScrollBarOrientation.hpp>
32 #include <com/sun/star/awt/VisualEffect.hpp>
33 #include <com/sun/star/awt/ImageScaleMode.hpp>
34 #include <tools/gen.hxx>
35 #include <xmloff/xmltoken.hxx>
37 namespace xmloff
40 using namespace ::com::sun::star::form;
41 using namespace ::com::sun::star::sdb;
42 using namespace ::com::sun::star::awt;
43 using namespace ::com::sun::star;
44 using namespace ::xmloff::token;
46 const SvXMLEnumMapEntry<FormSubmitEncoding> aSubmitEncodingMap[] =
48 { XML_APPLICATION_X_WWW_FORM_URLENCODED, FormSubmitEncoding_URL },
49 { XML_MULTIPART_FORMDATA, FormSubmitEncoding_MULTIPART },
50 { XML_APPLICATION_TEXT, FormSubmitEncoding_TEXT },
51 { XML_TOKEN_INVALID, FormSubmitEncoding(0) }
53 const SvXMLEnumMapEntry<FormSubmitMethod> aSubmitMethodMap[] =
55 { XML_GET, FormSubmitMethod_GET },
56 { XML_POST, FormSubmitMethod_POST },
57 { XML_TOKEN_INVALID, FormSubmitMethod(0) }
59 const SvXMLEnumMapEntry<sal_Int32> aCommandTypeMap[] =
61 { XML_TABLE, CommandType::TABLE },
62 { XML_QUERY, CommandType::QUERY },
63 { XML_COMMAND, CommandType::COMMAND },
64 { XML_TOKEN_INVALID, 0 }
66 const SvXMLEnumMapEntry<NavigationBarMode> aNavigationTypeMap[] =
68 { XML_NONE, NavigationBarMode_NONE },
69 { XML_CURRENT, NavigationBarMode_CURRENT },
70 { XML_PARENT, NavigationBarMode_PARENT },
71 { XML_TOKEN_INVALID, NavigationBarMode(0) }
73 const SvXMLEnumMapEntry<TabulatorCycle> aTabulatorCycleMap[] =
75 { XML_RECORDS, TabulatorCycle_RECORDS },
76 { XML_CURRENT, TabulatorCycle_CURRENT },
77 { XML_PAGE, TabulatorCycle_PAGE },
78 { XML_TOKEN_INVALID, TabulatorCycle(0) }
80 const SvXMLEnumMapEntry<FormButtonType> aFormButtonTypeMap[] =
82 { XML_PUSH, FormButtonType_PUSH },
83 { XML_SUBMIT, FormButtonType_SUBMIT },
84 { XML_RESET, FormButtonType_RESET },
85 { XML_URL, FormButtonType_URL },
86 { XML_TOKEN_INVALID, FormButtonType(0) }
88 const SvXMLEnumMapEntry<ListSourceType> aListSourceTypeMap[] =
90 { XML_VALUE_LIST, ListSourceType_VALUELIST },
91 { XML_TABLE, ListSourceType_TABLE },
92 { XML_QUERY, ListSourceType_QUERY },
93 { XML_SQL, ListSourceType_SQL },
94 { XML_SQL_PASS_THROUGH, ListSourceType_SQLPASSTHROUGH },
95 { XML_TABLE_FIELDS, ListSourceType_TABLEFIELDS },
96 { XML_TOKEN_INVALID, ListSourceType(0) }
98 // check state of a checkbox
99 const SvXMLEnumMapEntry<TriState> aCheckStateMap[] =
101 { XML_UNCHECKED, TRISTATE_FALSE },
102 { XML_CHECKED, TRISTATE_TRUE },
103 { XML_UNKNOWN, TRISTATE_INDET },
104 { XML_TOKEN_INVALID, TriState(0) }
106 const SvXMLEnumMapEntry<sal_Int16> aTextAlignMap[] =
108 { XML_START, sal_uInt16(awt::TextAlign::LEFT) },
109 { XML_CENTER, sal_uInt16(awt::TextAlign::CENTER) },
110 { XML_END, sal_uInt16(awt::TextAlign::RIGHT) },
111 { XML_JUSTIFY, -1 },
112 { XML_JUSTIFIED, -1 },
113 { XML_TOKEN_INVALID, 0 }
115 const SvXMLEnumMapEntry<sal_uInt16> aBorderTypeMap[] =
117 { XML_NONE, 0 },
118 { XML_HIDDEN, 0 },
119 { XML_SOLID, 2 },
120 { XML_DOUBLE, 2 },
121 { XML_DOTTED, 2 },
122 { XML_DASHED, 2 },
123 { XML_GROOVE, 1 },
124 { XML_RIDGE, 1 },
125 { XML_INSET, 1 },
126 { XML_OUTSET, 1 },
127 { XML_TOKEN_INVALID, 0 }
129 const SvXMLEnumMapEntry<sal_uInt16> aFontEmphasisMap[] =
131 { XML_NONE, awt::FontEmphasisMark::NONE },
132 { XML_DOT, awt::FontEmphasisMark::DOT },
133 { XML_CIRCLE, awt::FontEmphasisMark::CIRCLE },
134 { XML_DISC, awt::FontEmphasisMark::DISC },
135 { XML_ACCENT, awt::FontEmphasisMark::ACCENT },
136 { XML_TOKEN_INVALID, 0 }
138 const SvXMLEnumMapEntry<sal_uInt16> aFontReliefMap[] =
140 { XML_NONE, FontRelief::NONE },
141 { XML_ENGRAVED, FontRelief::ENGRAVED },
142 { XML_EMBOSSED, FontRelief::EMBOSSED },
143 { XML_TOKEN_INVALID, 0 }
145 const SvXMLEnumMapEntry<sal_Int16> aListLinkageMap[] =
147 { XML_SELECTION, 0 },
148 { XML_SELECTION_INDEXES, 1 },
149 { XML_TOKEN_INVALID, 0 }
151 const SvXMLEnumMapEntry<sal_Int32> aOrientationMap[] =
153 { XML_HORIZONTAL, ScrollBarOrientation::HORIZONTAL },
154 { XML_VERTICAL, ScrollBarOrientation::VERTICAL },
155 { XML_TOKEN_INVALID, 0 }
157 const SvXMLEnumMapEntry<sal_Int16> aVisualEffectMap[] =
159 { XML_NONE, VisualEffect::NONE },
160 { XML_3D, VisualEffect::LOOK3D },
161 { XML_FLAT, VisualEffect::FLAT },
162 { XML_TOKEN_INVALID, 0 }
164 const SvXMLEnumMapEntry<sal_Int16> aImagePositionMap[] =
166 { XML_START, 0 },
167 { XML_END, 1 },
168 { XML_TOP, 2 },
169 { XML_BOTTOM, 3 },
170 { XML_CENTER, -1 },
171 { XML_TOKEN_INVALID, 0 }
173 const SvXMLEnumMapEntry<sal_uInt16> aImageAlignMap[] =
175 { XML_START, 0 },
176 { XML_CENTER, 1 },
177 { XML_END, 2 },
178 { XML_TOKEN_INVALID, 0 }
180 const SvXMLEnumMapEntry<sal_uInt16> aScaleModeMap[] =
182 { XML_BACKGROUND_NO_REPEAT, ImageScaleMode::NONE },
183 { XML_REPEAT, ImageScaleMode::NONE }, // repeating the image is not supported
184 { XML_STRETCH, ImageScaleMode::ANISOTROPIC },
185 { XML_SCALE, ImageScaleMode::ISOTROPIC },
186 { XML_TOKEN_INVALID, 0 }
189 } // namespace xmloff
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */