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 .
20 #include "frm_strings.hxx"
21 #include "property.hxx"
23 #include "property.hrc"
24 #include <cppuhelper/queryinterface.hxx>
25 #include <com/sun/star/beans/PropertyAttribute.hpp>
32 //= PropertyInfoService
34 PropertyInfoService::PropertyMap
PropertyInfoService::s_AllKnownProperties
;
36 sal_Int32
PropertyInfoService::getPropertyId(const OUString
& _rName
)
40 PropertyAssignment
aCompareName(_rName
, -1);
42 ::std::pair
<PropertyMap::iterator
,PropertyMap::iterator
> aPair
= ::std::equal_range(
43 s_AllKnownProperties
.begin(),
44 s_AllKnownProperties
.end(),
46 PropertyAssignmentNameCompareLess());
48 sal_Int32 nHandle
= -1;
49 if (aPair
.first
!= aPair
.second
)
50 { // we found something _and_ we have an identity
51 nHandle
= aPair
.first
->nHandle
;
58 sal_Int32
ConcreteInfoService::getPreferredPropertyId(const OUString
& _rName
)
60 return PropertyInfoService::getPropertyId(_rName
);
64 #define ADD_PROP_ASSIGNMENT(varname) \
65 s_AllKnownProperties.push_back(PropertyAssignment(PROPERTY_##varname, PROPERTY_ID_##varname))
67 void PropertyInfoService::initialize()
69 if (!s_AllKnownProperties
.empty())
72 s_AllKnownProperties
.reserve(220);
74 ADD_PROP_ASSIGNMENT(NAME
);
75 ADD_PROP_ASSIGNMENT(TAG
);
76 ADD_PROP_ASSIGNMENT(TABINDEX
);
77 ADD_PROP_ASSIGNMENT(CLASSID
);
78 ADD_PROP_ASSIGNMENT(ALIGN
);
79 ADD_PROP_ASSIGNMENT(FETCHSIZE
);
80 ADD_PROP_ASSIGNMENT(VALUE
);
81 ADD_PROP_ASSIGNMENT(VALUEMIN
);
82 ADD_PROP_ASSIGNMENT(VALUEMAX
);
83 ADD_PROP_ASSIGNMENT(VALUESTEP
);
84 ADD_PROP_ASSIGNMENT(TEXT
);
85 ADD_PROP_ASSIGNMENT(LABEL
);
86 ADD_PROP_ASSIGNMENT(NAVIGATION
);
87 ADD_PROP_ASSIGNMENT(CYCLE
);
88 ADD_PROP_ASSIGNMENT(CONTROLSOURCE
);
89 ADD_PROP_ASSIGNMENT(ENABLED
);
90 ADD_PROP_ASSIGNMENT(ENABLEVISIBLE
);
91 ADD_PROP_ASSIGNMENT(SPIN
);
92 ADD_PROP_ASSIGNMENT(READONLY
);
93 ADD_PROP_ASSIGNMENT(FILTER
);
94 ADD_PROP_ASSIGNMENT(WIDTH
);
95 ADD_PROP_ASSIGNMENT(SEARCHABLE
);
96 ADD_PROP_ASSIGNMENT(MULTILINE
);
97 ADD_PROP_ASSIGNMENT(TARGET_URL
);
98 ADD_PROP_ASSIGNMENT(DEFAULTCONTROL
);
99 ADD_PROP_ASSIGNMENT(MAXTEXTLEN
);
100 ADD_PROP_ASSIGNMENT(SIZE
);
101 ADD_PROP_ASSIGNMENT(DATE
);
102 ADD_PROP_ASSIGNMENT(TIME
);
103 ADD_PROP_ASSIGNMENT(STATE
);
104 ADD_PROP_ASSIGNMENT(TRISTATE
);
105 ADD_PROP_ASSIGNMENT(HIDDEN_VALUE
);
106 ADD_PROP_ASSIGNMENT(TARGET_FRAME
);
107 ADD_PROP_ASSIGNMENT(BUTTONTYPE
);
108 ADD_PROP_ASSIGNMENT(STRINGITEMLIST
);
109 ADD_PROP_ASSIGNMENT(DEFAULT_TEXT
);
110 ADD_PROP_ASSIGNMENT(DEFAULT_STATE
);
111 ADD_PROP_ASSIGNMENT(DEFAULT_DATE
);
112 ADD_PROP_ASSIGNMENT(DEFAULT_TIME
);
113 ADD_PROP_ASSIGNMENT(DEFAULT_VALUE
);
114 ADD_PROP_ASSIGNMENT(FORMATKEY
);
115 ADD_PROP_ASSIGNMENT(FORMATSSUPPLIER
);
116 ADD_PROP_ASSIGNMENT(SUBMIT_ACTION
);
117 ADD_PROP_ASSIGNMENT(SUBMIT_TARGET
);
118 ADD_PROP_ASSIGNMENT(SUBMIT_METHOD
);
119 ADD_PROP_ASSIGNMENT(SUBMIT_ENCODING
);
120 ADD_PROP_ASSIGNMENT(IMAGE_URL
);
121 ADD_PROP_ASSIGNMENT(GRAPHIC
);
122 ADD_PROP_ASSIGNMENT(EMPTY_IS_NULL
);
123 ADD_PROP_ASSIGNMENT(LISTSOURCETYPE
);
124 ADD_PROP_ASSIGNMENT(LISTSOURCE
);
125 ADD_PROP_ASSIGNMENT(SELECT_SEQ
);
126 ADD_PROP_ASSIGNMENT(VALUE_SEQ
);
127 ADD_PROP_ASSIGNMENT(SELECT_VALUE
);
128 ADD_PROP_ASSIGNMENT(SELECT_VALUE_SEQ
);
129 ADD_PROP_ASSIGNMENT(DEFAULT_SELECT_SEQ
);
130 ADD_PROP_ASSIGNMENT(MULTISELECTION
);
131 ADD_PROP_ASSIGNMENT(DECIMAL_ACCURACY
);
132 ADD_PROP_ASSIGNMENT(EDITMASK
);
133 ADD_PROP_ASSIGNMENT(ISREADONLY
);
134 ADD_PROP_ASSIGNMENT(FIELDTYPE
);
135 ADD_PROP_ASSIGNMENT(DECIMALS
);
136 ADD_PROP_ASSIGNMENT(REFVALUE
);
137 ADD_PROP_ASSIGNMENT(STRICTFORMAT
);
138 ADD_PROP_ASSIGNMENT(DATASOURCE
);
139 ADD_PROP_ASSIGNMENT(ALLOWADDITIONS
);
140 ADD_PROP_ASSIGNMENT(ALLOWEDITS
);
141 ADD_PROP_ASSIGNMENT(ALLOWDELETIONS
);
142 ADD_PROP_ASSIGNMENT(MASTERFIELDS
);
143 ADD_PROP_ASSIGNMENT(ISPASSTHROUGH
);
144 ADD_PROP_ASSIGNMENT(QUERY
);
145 ADD_PROP_ASSIGNMENT(LITERALMASK
);
146 ADD_PROP_ASSIGNMENT(SHOWTHOUSANDSEP
);
147 ADD_PROP_ASSIGNMENT(CURRENCYSYMBOL
);
148 ADD_PROP_ASSIGNMENT(DATEFORMAT
);
149 ADD_PROP_ASSIGNMENT(DATEMIN
);
150 ADD_PROP_ASSIGNMENT(DATEMAX
);
151 ADD_PROP_ASSIGNMENT(DATE_SHOW_CENTURY
);
152 ADD_PROP_ASSIGNMENT(TIMEFORMAT
);
153 ADD_PROP_ASSIGNMENT(TIMEMIN
);
154 ADD_PROP_ASSIGNMENT(TIMEMAX
);
155 ADD_PROP_ASSIGNMENT(LINECOUNT
);
156 ADD_PROP_ASSIGNMENT(BOUNDCOLUMN
);
157 ADD_PROP_ASSIGNMENT(HASNAVIGATION
);
158 ADD_PROP_ASSIGNMENT(FONT
);
159 ADD_PROP_ASSIGNMENT(BACKGROUNDCOLOR
);
160 ADD_PROP_ASSIGNMENT(FILLCOLOR
);
161 ADD_PROP_ASSIGNMENT(TEXTCOLOR
);
162 ADD_PROP_ASSIGNMENT(LINECOLOR
);
163 ADD_PROP_ASSIGNMENT(BORDER
);
164 ADD_PROP_ASSIGNMENT(DROPDOWN
);
165 ADD_PROP_ASSIGNMENT(HSCROLL
);
166 ADD_PROP_ASSIGNMENT(VSCROLL
);
167 ADD_PROP_ASSIGNMENT(TABSTOP
);
168 ADD_PROP_ASSIGNMENT(AUTOCOMPLETE
);
169 ADD_PROP_ASSIGNMENT(HARDLINEBREAKS
);
170 ADD_PROP_ASSIGNMENT(PRINTABLE
);
171 ADD_PROP_ASSIGNMENT(ECHO_CHAR
);
172 ADD_PROP_ASSIGNMENT(ROWHEIGHT
);
173 ADD_PROP_ASSIGNMENT(HELPTEXT
);
174 ADD_PROP_ASSIGNMENT(FONT_NAME
);
175 ADD_PROP_ASSIGNMENT(FONT_STYLENAME
);
176 ADD_PROP_ASSIGNMENT(FONT_FAMILY
);
177 ADD_PROP_ASSIGNMENT(FONT_CHARSET
);
178 ADD_PROP_ASSIGNMENT(FONT_HEIGHT
);
179 ADD_PROP_ASSIGNMENT(FONT_WEIGHT
);
180 ADD_PROP_ASSIGNMENT(FONT_SLANT
);
181 ADD_PROP_ASSIGNMENT(FONT_UNDERLINE
);
182 ADD_PROP_ASSIGNMENT(FONT_WORDLINEMODE
);
183 ADD_PROP_ASSIGNMENT(FONT_STRIKEOUT
);
184 ADD_PROP_ASSIGNMENT(TEXTLINECOLOR
);
185 ADD_PROP_ASSIGNMENT(FONTEMPHASISMARK
);
186 ADD_PROP_ASSIGNMENT(FONTRELIEF
);
187 ADD_PROP_ASSIGNMENT(HELPURL
);
188 ADD_PROP_ASSIGNMENT(RECORDMARKER
);
189 ADD_PROP_ASSIGNMENT(BOUNDFIELD
);
190 ADD_PROP_ASSIGNMENT(INPUT_REQUIRED
);
191 ADD_PROP_ASSIGNMENT(TREATASNUMERIC
);
192 ADD_PROP_ASSIGNMENT(EFFECTIVE_VALUE
);
193 ADD_PROP_ASSIGNMENT(EFFECTIVE_DEFAULT
);
194 ADD_PROP_ASSIGNMENT(EFFECTIVE_MIN
);
195 ADD_PROP_ASSIGNMENT(EFFECTIVE_MAX
);
196 ADD_PROP_ASSIGNMENT(HIDDEN
);
197 ADD_PROP_ASSIGNMENT(FILTERPROPOSAL
);
198 ADD_PROP_ASSIGNMENT(FIELDSOURCE
);
199 ADD_PROP_ASSIGNMENT(TABLENAME
);
200 ADD_PROP_ASSIGNMENT(CONTROLLABEL
);
201 ADD_PROP_ASSIGNMENT(CURRSYM_POSITION
);
202 ADD_PROP_ASSIGNMENT(CURSORCOLOR
);
203 ADD_PROP_ASSIGNMENT(ALWAYSSHOWCURSOR
);
204 ADD_PROP_ASSIGNMENT(DISPLAYSYNCHRON
);
205 ADD_PROP_ASSIGNMENT(ISMODIFIED
);
206 ADD_PROP_ASSIGNMENT(ISNEW
);
207 ADD_PROP_ASSIGNMENT(PRIVILEGES
);
208 ADD_PROP_ASSIGNMENT(DETAILFIELDS
);
209 ADD_PROP_ASSIGNMENT(COMMAND
);
210 ADD_PROP_ASSIGNMENT(COMMANDTYPE
);
211 ADD_PROP_ASSIGNMENT(RESULTSET_CONCURRENCY
);
212 ADD_PROP_ASSIGNMENT(INSERTONLY
);
213 ADD_PROP_ASSIGNMENT(RESULTSET_TYPE
);
214 ADD_PROP_ASSIGNMENT(ESCAPE_PROCESSING
);
215 ADD_PROP_ASSIGNMENT(APPLYFILTER
);
216 ADD_PROP_ASSIGNMENT(ISNULLABLE
);
217 ADD_PROP_ASSIGNMENT(ACTIVECOMMAND
);
218 ADD_PROP_ASSIGNMENT(ISCURRENCY
);
219 ADD_PROP_ASSIGNMENT(URL
);
220 ADD_PROP_ASSIGNMENT(TITLE
);
221 ADD_PROP_ASSIGNMENT(ACTIVE_CONNECTION
);
222 ADD_PROP_ASSIGNMENT(SCALE
);
223 ADD_PROP_ASSIGNMENT(SORT
);
224 ADD_PROP_ASSIGNMENT(PERSISTENCE_MAXTEXTLENGTH
);
225 ADD_PROP_ASSIGNMENT(SCROLL_VALUE
);
226 ADD_PROP_ASSIGNMENT(SPIN_VALUE
);
227 ADD_PROP_ASSIGNMENT(DEFAULT_SCROLL_VALUE
);
228 ADD_PROP_ASSIGNMENT(DEFAULT_SPIN_VALUE
);
229 ADD_PROP_ASSIGNMENT( WRITING_MODE
);
230 ADD_PROP_ASSIGNMENT( CONTEXT_WRITING_MODE
);
231 ADD_PROP_ASSIGNMENT( GENERATEVBAEVENTS
);
233 // now sort the array by name
236 s_AllKnownProperties
.begin(),
237 s_AllKnownProperties
.end(),
238 PropertyAssignmentNameCompareLess()
244 //... namespace frm .......................................................
246 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */