1*2a97ec55SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2a97ec55SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2a97ec55SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2a97ec55SAndrew Rist  * distributed with this work for additional information
6*2a97ec55SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2a97ec55SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2a97ec55SAndrew Rist  * "License"); you may not use this file except in compliance
9*2a97ec55SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2a97ec55SAndrew Rist  *
11*2a97ec55SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2a97ec55SAndrew Rist  *
13*2a97ec55SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2a97ec55SAndrew Rist  * software distributed under the License is distributed on an
15*2a97ec55SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2a97ec55SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2a97ec55SAndrew Rist  * specific language governing permissions and limitations
18*2a97ec55SAndrew Rist  * under the License.
19*2a97ec55SAndrew Rist  *
20*2a97ec55SAndrew Rist  *************************************************************/
21*2a97ec55SAndrew Rist 
22*2a97ec55SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_extensions.hxx"
26cdf0e10cSrcweir #include "formmetadata.hxx"
27cdf0e10cSrcweir #ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_
28cdf0e10cSrcweir #include "propctrlr.hrc"
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include "formstrings.hxx"
31cdf0e10cSrcweir #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_
32cdf0e10cSrcweir #include "formresid.hrc"
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include "propctrlr.hrc"
35cdf0e10cSrcweir #include <svtools/localresaccess.hxx>
36cdf0e10cSrcweir #include <tools/debug.hxx>
37cdf0e10cSrcweir #include <comphelper/extract.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #include <algorithm>
40cdf0e10cSrcweir #include <functional>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //............................................................................
43cdf0e10cSrcweir namespace pcr
44cdf0e10cSrcweir {
45cdf0e10cSrcweir //............................................................................
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 	using namespace ::com::sun::star::uno;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir 	//========================================================================
50cdf0e10cSrcweir 	//= OPropertyInfoImpl
51cdf0e10cSrcweir 	//========================================================================
52cdf0e10cSrcweir 	struct OPropertyInfoImpl
53cdf0e10cSrcweir 	{
54cdf0e10cSrcweir 		String			sName;
55cdf0e10cSrcweir 		String			sTranslation;
56cdf0e10cSrcweir 		rtl::OString    sHelpId;
57cdf0e10cSrcweir 		sal_Int32       nId;
58cdf0e10cSrcweir 		sal_uInt16      nPos;
59cdf0e10cSrcweir         sal_uInt32      nUIFlags;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 		OPropertyInfoImpl(
62cdf0e10cSrcweir 						const ::rtl::OUString&		rName,
63cdf0e10cSrcweir 						sal_Int32					_nId,
64cdf0e10cSrcweir 						const String&				aTranslation,
65cdf0e10cSrcweir 						sal_uInt16					nPosId,
66cdf0e10cSrcweir                         const rtl::OString&,
67cdf0e10cSrcweir                         sal_uInt32                  _nUIFlags);
68cdf0e10cSrcweir 	};
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	//------------------------------------------------------------------------
OPropertyInfoImpl(const::rtl::OUString & _rName,sal_Int32 _nId,const String & aString,sal_uInt16 nP,const rtl::OString & sHid,sal_uInt32 _nUIFlags)71cdf0e10cSrcweir 	OPropertyInfoImpl::OPropertyInfoImpl(const ::rtl::OUString& _rName, sal_Int32 _nId,
72cdf0e10cSrcweir 								   const String& aString, sal_uInt16 nP, const rtl::OString& sHid, sal_uInt32 _nUIFlags)
73cdf0e10cSrcweir 	   :sName(_rName)
74cdf0e10cSrcweir 	   ,sTranslation(aString)
75cdf0e10cSrcweir 	   ,sHelpId(sHid)
76cdf0e10cSrcweir 	   ,nId(_nId)
77cdf0e10cSrcweir 	   ,nPos(nP)
78cdf0e10cSrcweir        ,nUIFlags(_nUIFlags)
79cdf0e10cSrcweir 	{
80cdf0e10cSrcweir 	}
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	//------------------------------------------------------------------------
83cdf0e10cSrcweir 	// Vergleichen von PropertyInfo
84cdf0e10cSrcweir     struct PropertyInfoLessByName : public ::std::binary_function< OPropertyInfoImpl, OPropertyInfoImpl, bool >
85cdf0e10cSrcweir     {
operator ()pcr::PropertyInfoLessByName86cdf0e10cSrcweir         bool operator()( const OPropertyInfoImpl& _rLHS, const OPropertyInfoImpl& _rRHS )
87cdf0e10cSrcweir         {
88cdf0e10cSrcweir             return _rLHS.sName.CompareTo( _rRHS.sName ) == COMPARE_LESS;
89cdf0e10cSrcweir         }
90cdf0e10cSrcweir     };
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	//========================================================================
93cdf0e10cSrcweir 	//= OPropertyInfoService
94cdf0e10cSrcweir 	//========================================================================
95cdf0e10cSrcweir #define DEF_INFO( ident, uinameres, helpid, flags )   \
96cdf0e10cSrcweir     OPropertyInfoImpl( PROPERTY_##ident, PROPERTY_ID_##ident, \
97cdf0e10cSrcweir             String( PcrRes( RID_STR_##uinameres ) ), nPos++, HID_PROP_##helpid, flags )
98cdf0e10cSrcweir 
99cdf0e10cSrcweir #define DEF_INFO_1( ident, uinameres, helpid, flag1 ) \
100cdf0e10cSrcweir     DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 )
101cdf0e10cSrcweir 
102cdf0e10cSrcweir #define DEF_INFO_2( ident, uinameres, helpid, flag1, flag2 ) \
103cdf0e10cSrcweir     DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 )
104cdf0e10cSrcweir 
105cdf0e10cSrcweir #define DEF_INFO_3( ident, uinameres, helpid, flag1, flag2, flag3 ) \
106cdf0e10cSrcweir     DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 )
107cdf0e10cSrcweir 
108cdf0e10cSrcweir #define DEF_INFO_4( ident, uinameres, helpid, flag1, flag2, flag3, flag4 ) \
109cdf0e10cSrcweir     DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 | PROP_FLAG_##flag4 )
110cdf0e10cSrcweir 
111cdf0e10cSrcweir #define DEF_INFO_5( ident, uinameres, helpid, flag1, flag2, flag3, flag4, flag5 ) \
112cdf0e10cSrcweir     DEF_INFO( ident, uinameres, helpid, PROP_FLAG_##flag1 | PROP_FLAG_##flag2 | PROP_FLAG_##flag3 | PROP_FLAG_##flag4 | PROP_FLAG_##flag5 )
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     sal_uInt16				OPropertyInfoService::s_nCount = 0;
115cdf0e10cSrcweir 	OPropertyInfoImpl*		OPropertyInfoService::s_pPropertyInfos = NULL;
116cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyInfo()117cdf0e10cSrcweir 	const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo()
118cdf0e10cSrcweir 	{
119cdf0e10cSrcweir 		if ( s_pPropertyInfos )
120cdf0e10cSrcweir             return s_pPropertyInfos;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 		PcrClient aResourceAccess;
123cdf0e10cSrcweir 		// this ensures that we have our resource file loaded
124cdf0e10cSrcweir 
125cdf0e10cSrcweir 		sal_uInt16 nPos = 1;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir         static OPropertyInfoImpl aPropertyInfos[] =
128cdf0e10cSrcweir 		{
129cdf0e10cSrcweir         /*
130cdf0e10cSrcweir         DEF_INFO_?( propname and id,   resoure id,         help id,           flags ),
131cdf0e10cSrcweir         */
132cdf0e10cSrcweir         DEF_INFO_3( NAME,              NAME,               NAME,              FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
133cdf0e10cSrcweir         DEF_INFO_2( TITLE,             TITLE,              TITLE,             FORM_VISIBLE, DIALOG_VISIBLE ),
134cdf0e10cSrcweir         DEF_INFO_3( LABEL,             LABEL,              LABEL,             FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
135cdf0e10cSrcweir         DEF_INFO_2( CONTROLLABEL,      LABELCONTROL,       CONTROLLABEL,      FORM_VISIBLE, COMPOSEABLE ),
136cdf0e10cSrcweir         DEF_INFO_3( WRITING_MODE,      WRITING_MODE,       WRITING_MODE,      FORM_VISIBLE, ENUM, COMPOSEABLE ),
137cdf0e10cSrcweir         DEF_INFO_2( TEXT,              TEXT,               TEXT,              DIALOG_VISIBLE, COMPOSEABLE ),
138cdf0e10cSrcweir         DEF_INFO_3( MAXTEXTLEN,        MAXTEXTLEN,         MAXTEXTLEN,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
139cdf0e10cSrcweir         DEF_INFO_3( EDITMASK,          EDITMASK,           EDITMASK,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
140cdf0e10cSrcweir         DEF_INFO_3( LITERALMASK,       LITERALMASK,        LITERALMASK,       FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
141cdf0e10cSrcweir         DEF_INFO_3( STRICTFORMAT,      STRICTFORMAT,       STRICTFORMAT,      FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
142cdf0e10cSrcweir         DEF_INFO_3( ENABLED,           ENABLED,            ENABLED,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
143cdf0e10cSrcweir         DEF_INFO_3( ENABLE_VISIBLE,    ENABLE_VISIBLE,     ENABLE_VISIBLE,    FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
144cdf0e10cSrcweir         DEF_INFO_3( READONLY,          READONLY,           READONLY,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
145cdf0e10cSrcweir         DEF_INFO_3( PRINTABLE,         PRINTABLE,          PRINTABLE,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
146cdf0e10cSrcweir         DEF_INFO_3( STEP,              STEP,               STEP,              FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
147cdf0e10cSrcweir         DEF_INFO_3( TABSTOP,           TABSTOP,            TABSTOP,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
148cdf0e10cSrcweir         DEF_INFO_2( TABINDEX,          TABINDEX,           TABINDEX,          FORM_VISIBLE, DIALOG_VISIBLE ),
149cdf0e10cSrcweir         DEF_INFO_3( WHEEL_BEHAVIOR,    WHEEL_BEHAVIOR,     WHEEL_BEHAVIOR,    FORM_VISIBLE, ENUM, COMPOSEABLE ),
150cdf0e10cSrcweir 
151cdf0e10cSrcweir         DEF_INFO_2( BOUND_CELL,        BOUND_CELL,         BOUND_CELL,        FORM_VISIBLE, DATA_PROPERTY ),
152cdf0e10cSrcweir         DEF_INFO_3( CELL_EXCHANGE_TYPE,CELL_EXCHANGE_TYPE, CELL_EXCHANGE_TYPE,FORM_VISIBLE, DATA_PROPERTY, ENUM ),
153cdf0e10cSrcweir         DEF_INFO_2( LIST_CELL_RANGE,   LIST_CELL_RANGE,    LIST_CELL_RANGE,   FORM_VISIBLE, DATA_PROPERTY ),
154cdf0e10cSrcweir         DEF_INFO_3( CONTROLSOURCE,     CONTROLSOURCE,      CONTROLSOURCE,     FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
155cdf0e10cSrcweir         DEF_INFO_3( EMPTY_IS_NULL,     EMPTY_IS_NULL,      EMPTY_IS_NULL,     FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
156cdf0e10cSrcweir         DEF_INFO_3( INPUT_REQUIRED,    INPUT_REQUIRED,     INPUT_REQUIRED,    FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
157cdf0e10cSrcweir         DEF_INFO_3( REFVALUE,          REFVALUE,           REFVALUE,          FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
158cdf0e10cSrcweir         DEF_INFO_3( UNCHECKEDREFVALUE, UNCHECKEDREFVALUE,  UNCHECKEDREFVALUE, FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
159cdf0e10cSrcweir         DEF_INFO_3( DATASOURCE,        DATASOURCE,         DATASOURCE,        FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
160cdf0e10cSrcweir         DEF_INFO_4( COMMANDTYPE,       CURSORSOURCETYPE,   CURSORSOURCETYPE,  FORM_VISIBLE, DATA_PROPERTY, ENUM, COMPOSEABLE ),
161cdf0e10cSrcweir         DEF_INFO_3( COMMAND,           CURSORSOURCE,       CURSORSOURCE,      FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
162cdf0e10cSrcweir         DEF_INFO_3( ESCAPE_PROCESSING, ESCAPE_PROCESSING,  ESCAPE_PROCESSING, FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
163cdf0e10cSrcweir         DEF_INFO_3( FILTER,            FILTER,             FILTER,            FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
164cdf0e10cSrcweir         DEF_INFO_3( SORT,              SORT_CRITERIA,      SORT_CRITERIA,     FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
165cdf0e10cSrcweir         DEF_INFO_2( MASTERFIELDS,      MASTERFIELDS,       MASTERFIELDS,      FORM_VISIBLE, DATA_PROPERTY ),
166cdf0e10cSrcweir         DEF_INFO_2( DETAILFIELDS,      SLAVEFIELDS,        SLAVEFIELDS,       FORM_VISIBLE, DATA_PROPERTY ),
167cdf0e10cSrcweir         DEF_INFO_3( ALLOWADDITIONS,    ALLOW_ADDITIONS,    ALLOW_ADDITIONS,   FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
168cdf0e10cSrcweir         DEF_INFO_3( ALLOWEDITS,        ALLOW_EDITS,        ALLOW_EDITS,       FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
169cdf0e10cSrcweir         DEF_INFO_3( ALLOWDELETIONS,    ALLOW_DELETIONS,    ALLOW_DELETIONS,   FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
170cdf0e10cSrcweir         DEF_INFO_4( INSERTONLY,        DATAENTRY,          DATAENTRY,         FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE, COMPOSEABLE ),
171cdf0e10cSrcweir         DEF_INFO_4( NAVIGATION,        NAVIGATION,         NAVIGATION,        FORM_VISIBLE, DATA_PROPERTY, ENUM, COMPOSEABLE ),
172cdf0e10cSrcweir         DEF_INFO_4( CYCLE,             CYCLE,              CYCLE,             FORM_VISIBLE, DATA_PROPERTY, ENUM, COMPOSEABLE ),
173cdf0e10cSrcweir         DEF_INFO_3( FILTERPROPOSAL,    FILTERPROPOSAL,     FILTERPROPOSAL,    FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
174cdf0e10cSrcweir         DEF_INFO_4( LISTSOURCETYPE,    LISTSOURCETYPE,     LISTSOURCETYPE,    FORM_VISIBLE, DATA_PROPERTY, ENUM, COMPOSEABLE ),
175cdf0e10cSrcweir         DEF_INFO_3( LISTSOURCE,        LISTSOURCE,         LISTSOURCE,        FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
176cdf0e10cSrcweir         DEF_INFO_3( BOUNDCOLUMN,       BOUNDCOLUMN,        BOUNDCOLUMN,       FORM_VISIBLE, DATA_PROPERTY, COMPOSEABLE ),
177cdf0e10cSrcweir 
178cdf0e10cSrcweir         // <!----------------->
179cdf0e10cSrcweir         // XML node binding
180cdf0e10cSrcweir         DEF_INFO_2( LIST_BINDING,      LIST_BINDING,       LIST_BINDING,      FORM_VISIBLE, DATA_PROPERTY ),
181cdf0e10cSrcweir         DEF_INFO_2( XML_DATA_MODEL,    XML_DATA_MODEL,     XML_DATA_MODEL,    FORM_VISIBLE, DATA_PROPERTY ),
182cdf0e10cSrcweir         DEF_INFO_2( BINDING_NAME,      BINDING_NAME,       BINDING_NAME,      FORM_VISIBLE, DATA_PROPERTY ),
183cdf0e10cSrcweir         DEF_INFO_2( BIND_EXPRESSION,   BIND_EXPRESSION,    BIND_EXPRESSION,   FORM_VISIBLE, DATA_PROPERTY ),
184cdf0e10cSrcweir         DEF_INFO_2( XSD_REQUIRED,      XSD_REQUIRED,       XSD_REQUIRED,      FORM_VISIBLE, DATA_PROPERTY ),
185cdf0e10cSrcweir         DEF_INFO_2( XSD_RELEVANT,      XSD_RELEVANT,       XSD_RELEVANT,      FORM_VISIBLE, DATA_PROPERTY ),
186cdf0e10cSrcweir         DEF_INFO_2( XSD_READONLY,      XSD_READONLY,       XSD_READONLY,      FORM_VISIBLE, DATA_PROPERTY ),
187cdf0e10cSrcweir         DEF_INFO_2( XSD_CONSTRAINT,    XSD_CONSTRAINT,     XSD_CONSTRAINT,    FORM_VISIBLE, DATA_PROPERTY ),
188cdf0e10cSrcweir         DEF_INFO_2( XSD_CALCULATION,   XSD_CALCULATION,    XSD_CALCULATION,   FORM_VISIBLE, DATA_PROPERTY ),
189cdf0e10cSrcweir 
190cdf0e10cSrcweir         // data type
191cdf0e10cSrcweir         DEF_INFO_2( XSD_DATA_TYPE,     XSD_DATA_TYPE,      XSD_DATA_TYPE,     FORM_VISIBLE, DATA_PROPERTY ),
192cdf0e10cSrcweir         // data types facets
193cdf0e10cSrcweir         //  common
194cdf0e10cSrcweir         DEF_INFO_3( XSD_WHITESPACES,   XSD_WHITESPACES,    XSD_WHITESPACES,   FORM_VISIBLE, DATA_PROPERTY, ENUM ),
195cdf0e10cSrcweir         DEF_INFO_2( XSD_PATTERN,       XSD_PATTERN,        XSD_PATTERN,       FORM_VISIBLE, DATA_PROPERTY ),
196cdf0e10cSrcweir         //  string
197cdf0e10cSrcweir         DEF_INFO_2( XSD_LENGTH,        XSD_LENGTH,         XSD_LENGTH,        FORM_VISIBLE, DATA_PROPERTY ),
198cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_LENGTH,    XSD_MIN_LENGTH,     XSD_MIN_LENGTH,    FORM_VISIBLE, DATA_PROPERTY ),
199cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_LENGTH,    XSD_MAX_LENGTH,     XSD_MAX_LENGTH,    FORM_VISIBLE, DATA_PROPERTY ),
200cdf0e10cSrcweir         //  decimal
201cdf0e10cSrcweir         DEF_INFO_2( XSD_TOTAL_DIGITS,   XSD_TOTAL_DIGITS,   XSD_TOTAL_DIGITS,   FORM_VISIBLE, DATA_PROPERTY ),
202cdf0e10cSrcweir         DEF_INFO_2( XSD_FRACTION_DIGITS,XSD_FRACTION_DIGITS,XSD_FRACTION_DIGITS,FORM_VISIBLE, DATA_PROPERTY ),
203cdf0e10cSrcweir         //  int value types (year, month, day)
204cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_INCLUSIVE_INT, XSD_MAX_INCLUSIVE, XSD_MAX_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
205cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_EXCLUSIVE_INT, XSD_MAX_EXCLUSIVE, XSD_MAX_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
206cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_INCLUSIVE_INT, XSD_MIN_INCLUSIVE, XSD_MIN_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
207cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_EXCLUSIVE_INT, XSD_MIN_EXCLUSIVE, XSD_MIN_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
208cdf0e10cSrcweir         //  double value types (double, float, decimal)
209cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_INCLUSIVE_DOUBLE, XSD_MAX_INCLUSIVE, XSD_MAX_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
210cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_EXCLUSIVE_DOUBLE, XSD_MAX_EXCLUSIVE, XSD_MAX_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
211cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_INCLUSIVE_DOUBLE, XSD_MIN_INCLUSIVE, XSD_MIN_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
212cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_EXCLUSIVE_DOUBLE, XSD_MIN_EXCLUSIVE, XSD_MIN_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
213cdf0e10cSrcweir         // date value type
214cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_INCLUSIVE_DATE, XSD_MAX_INCLUSIVE, XSD_MAX_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
215cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_EXCLUSIVE_DATE, XSD_MAX_EXCLUSIVE, XSD_MAX_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
216cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_INCLUSIVE_DATE, XSD_MIN_INCLUSIVE, XSD_MIN_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
217cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_EXCLUSIVE_DATE, XSD_MIN_EXCLUSIVE, XSD_MIN_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
218cdf0e10cSrcweir         // time value type
219cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_INCLUSIVE_TIME, XSD_MAX_INCLUSIVE, XSD_MAX_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
220cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_EXCLUSIVE_TIME, XSD_MAX_EXCLUSIVE, XSD_MAX_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
221cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_INCLUSIVE_TIME, XSD_MIN_INCLUSIVE, XSD_MIN_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
222cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_EXCLUSIVE_TIME, XSD_MIN_EXCLUSIVE, XSD_MIN_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
223cdf0e10cSrcweir         // dateTime value type
224cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_INCLUSIVE_DATE_TIME, XSD_MAX_INCLUSIVE, XSD_MAX_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
225cdf0e10cSrcweir         DEF_INFO_2( XSD_MAX_EXCLUSIVE_DATE_TIME, XSD_MAX_EXCLUSIVE, XSD_MAX_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
226cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_INCLUSIVE_DATE_TIME, XSD_MIN_INCLUSIVE, XSD_MIN_INCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
227cdf0e10cSrcweir         DEF_INFO_2( XSD_MIN_EXCLUSIVE_DATE_TIME, XSD_MIN_EXCLUSIVE, XSD_MIN_EXCLUSIVE, FORM_VISIBLE, DATA_PROPERTY ),
228cdf0e10cSrcweir         // <!----------------->
229cdf0e10cSrcweir 
230cdf0e10cSrcweir         DEF_INFO_2( HIDDEN_VALUE,      VALUE,              HIDDEN_VALUE,      FORM_VISIBLE, COMPOSEABLE ),
231cdf0e10cSrcweir         DEF_INFO_2( VALUE,             VALUE,              VALUE,             DIALOG_VISIBLE, COMPOSEABLE ),
232cdf0e10cSrcweir         DEF_INFO_3( VALUEMIN,          VALUEMIN,           VALUEMIN,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
233cdf0e10cSrcweir         DEF_INFO_3( VALUEMAX,          VALUEMAX,           VALUEMAX,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
234cdf0e10cSrcweir         DEF_INFO_3( VALUESTEP,         VALUESTEP,          VALUESTEP,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
235cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_VALUE,     DEFAULTVALUE,       DEFAULT_LONG_VALUE,FORM_VISIBLE, COMPOSEABLE ),
236cdf0e10cSrcweir         DEF_INFO_3( DECIMAL_ACCURACY,  DECIMAL_ACCURACY,   DECIMAL_ACCURACY,  FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
237cdf0e10cSrcweir         DEF_INFO_3( SHOWTHOUSANDSEP,   SHOWTHOUSANDSEP,    SHOWTHOUSANDSEP,   FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
238cdf0e10cSrcweir 
239cdf0e10cSrcweir         DEF_INFO_3( CURRENCYSYMBOL,    CURRENCYSYMBOL,     CURRENCYSYMBOL,    FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
240cdf0e10cSrcweir         DEF_INFO_3( CURRSYM_POSITION,  CURRSYM_POSITION,   CURRSYM_POSITION,  FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
241cdf0e10cSrcweir 
242cdf0e10cSrcweir         DEF_INFO_2( DATE,              DATE,               DATE,              DIALOG_VISIBLE, COMPOSEABLE ),
243cdf0e10cSrcweir         DEF_INFO_3( DATEMIN,           DATEMIN,            DATEMIN,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
244cdf0e10cSrcweir         DEF_INFO_3( DATEMAX,           DATEMAX,            DATEMAX,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
245cdf0e10cSrcweir         DEF_INFO_4( DATEFORMAT,        DATEFORMAT,         DATEFORMAT,        FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
246cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_DATE,      DEFAULTDATE,        DEFAULT_DATE,      FORM_VISIBLE, COMPOSEABLE ),
247cdf0e10cSrcweir 
248cdf0e10cSrcweir         DEF_INFO_2( TIME,              TIME,               TIME,              DIALOG_VISIBLE, COMPOSEABLE ),
249cdf0e10cSrcweir         DEF_INFO_3( TIMEMIN,           TIMEMIN,            TIMEMIN,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
250cdf0e10cSrcweir         DEF_INFO_3( TIMEMAX,           TIMEMAX,            TIMEMAX,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
251cdf0e10cSrcweir         DEF_INFO_4( TIMEFORMAT,        TIMEFORMAT,         TIMEFORMAT,        FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
252cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_TIME,      DEFAULTTIME,        DEFAULT_TIME,      FORM_VISIBLE, COMPOSEABLE ),
253cdf0e10cSrcweir 
254cdf0e10cSrcweir         DEF_INFO_1( EFFECTIVE_VALUE,   VALUE,              VALUE,             DIALOG_VISIBLE ),
255cdf0e10cSrcweir         DEF_INFO_3( EFFECTIVE_MIN,     VALUEMIN,           EFFECTIVEMIN,      FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
256cdf0e10cSrcweir         DEF_INFO_3( EFFECTIVE_MAX,     VALUEMAX,           EFFECTIVEMAX,      FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
257cdf0e10cSrcweir         DEF_INFO_2( EFFECTIVE_DEFAULT, DEFAULTVALUE,       EFFECTIVEDEFAULT,  FORM_VISIBLE, COMPOSEABLE ),
258cdf0e10cSrcweir         DEF_INFO_3( FORMATKEY,         FORMATKEY,          FORMATKEY,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
259cdf0e10cSrcweir 
260cdf0e10cSrcweir         DEF_INFO_3( PROGRESSVALUE,     PROGRESSVALUE,      PROGRESSVALUE,     FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
261cdf0e10cSrcweir         DEF_INFO_3( PROGRESSVALUE_MIN, PROGRESSVALUE_MIN,  PROGRESSVALUE_MIN, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
262cdf0e10cSrcweir         DEF_INFO_3( PROGRESSVALUE_MAX, PROGRESSVALUE_MAX,  PROGRESSVALUE_MAX, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
263cdf0e10cSrcweir 
264cdf0e10cSrcweir         DEF_INFO_2( SCROLLVALUE,       SCROLLVALUE,        SCROLLVALUE,       DIALOG_VISIBLE, COMPOSEABLE ),
265cdf0e10cSrcweir         DEF_INFO_3( SCROLLVALUE_MIN,   SCROLLVALUE_MIN,    SCROLLVALUE_MIN,   FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
266cdf0e10cSrcweir         DEF_INFO_3( SCROLLVALUE_MAX,   SCROLLVALUE_MAX,    SCROLLVALUE_MAX,   FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
267cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_SCROLLVALUE,DEFAULT_SCROLLVALUE,DEFAULT_SCROLLVALUE,FORM_VISIBLE, COMPOSEABLE ),
268cdf0e10cSrcweir         DEF_INFO_3( LINEINCREMENT,     LINEINCREMENT,      LINEINCREMENT,     FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
269cdf0e10cSrcweir         DEF_INFO_3( BLOCKINCREMENT,    BLOCKINCREMENT,     BLOCKINCREMENT,    FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
270cdf0e10cSrcweir 
271cdf0e10cSrcweir         DEF_INFO_2( SPINVALUE,        VALUE,               SPINVALUE,         DIALOG_VISIBLE, COMPOSEABLE ),
272cdf0e10cSrcweir         DEF_INFO_3( SPINVALUE_MIN,    VALUEMIN,            SPINVALUE_MIN,     FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
273cdf0e10cSrcweir         DEF_INFO_3( SPINVALUE_MAX,    VALUEMAX,            SPINVALUE_MAX,     FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
274cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_SPINVALUE,DEFAULTVALUE,        DEFAULT_SPINVALUE, FORM_VISIBLE, COMPOSEABLE ),
275cdf0e10cSrcweir         DEF_INFO_3( SPININCREMENT,    VALUESTEP,           SPININCREMENT,     FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
276cdf0e10cSrcweir 
277cdf0e10cSrcweir         DEF_INFO_3( SPIN,              SPIN,               SPIN,              FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
278cdf0e10cSrcweir         DEF_INFO_3( REPEAT,            REPEAT,             REPEAT,            FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
279cdf0e10cSrcweir         DEF_INFO_3( REPEAT_DELAY,      REPEAT_DELAY,       REPEAT_DELAY,      FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
280cdf0e10cSrcweir         DEF_INFO_3( VISIBLESIZE,       VISIBLESIZE,        VISIBLESIZE,       FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
281cdf0e10cSrcweir         DEF_INFO_4( ORIENTATION,       ORIENTATION,        ORIENTATION,       FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
282cdf0e10cSrcweir         DEF_INFO_3( FOCUSONCLICK,      FOCUSONCLICK,       FOCUSONCLICK,      FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
283cdf0e10cSrcweir         DEF_INFO_3( TOGGLE,            TOGGLE,             TOGGLE,            FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
284cdf0e10cSrcweir         DEF_INFO_3( DEFAULT_STATE,     DEFAULT_STATE,      DEFAULT_STATE,     FORM_VISIBLE, ENUM, COMPOSEABLE ),
285cdf0e10cSrcweir 
286cdf0e10cSrcweir         DEF_INFO_3( TEXT_ANCHOR_TYPE,  ANCHOR_TYPE,        ANCHOR_TYPE,       FORM_VISIBLE, ENUM, COMPOSEABLE ),
287cdf0e10cSrcweir         DEF_INFO_3( SHEET_ANCHOR_TYPE, ANCHOR_TYPE,        ANCHOR_TYPE,       FORM_VISIBLE, ENUM, COMPOSEABLE ),
288cdf0e10cSrcweir         DEF_INFO_3( POSITIONX,         POSITIONX,          POSITIONX,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
289cdf0e10cSrcweir         DEF_INFO_3( POSITIONY,         POSITIONY,          POSITIONY,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
290cdf0e10cSrcweir         DEF_INFO_3( WIDTH,             WIDTH,              WIDTH,             FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
291cdf0e10cSrcweir         DEF_INFO_3( HEIGHT,            HEIGHT,             HEIGHT,            FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
292cdf0e10cSrcweir 
293cdf0e10cSrcweir         DEF_INFO_1( LISTINDEX,         LISTINDEX,          LISTINDEX,         FORM_VISIBLE ),
294cdf0e10cSrcweir         DEF_INFO_3( STRINGITEMLIST,    STRINGITEMLIST,     STRINGITEMLIST,    FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
295cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_TEXT,      DEFAULTTEXT,        DEFAULTVALUE,      FORM_VISIBLE, COMPOSEABLE ),
296cdf0e10cSrcweir         DEF_INFO_3( FONT,              FONT,               FONT,              FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
297cdf0e10cSrcweir         DEF_INFO_4( VISUALEFFECT,      VISUALEFFECT,       VISUALEFFECT,      FORM_VISIBLE, DIALOG_VISIBLE, ENUM_ONE, COMPOSEABLE ),
298cdf0e10cSrcweir         DEF_INFO_4( ALIGN,             ALIGN,              ALIGN,             FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
299cdf0e10cSrcweir         DEF_INFO_3( VERTICAL_ALIGN,    VERTICAL_ALIGN,     VERTICAL_ALIGN,    FORM_VISIBLE, ENUM, COMPOSEABLE ),
300cdf0e10cSrcweir         DEF_INFO_3( ROWHEIGHT,         ROWHEIGHT,          ROWHEIGHT,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
301cdf0e10cSrcweir         DEF_INFO_3( BACKGROUNDCOLOR,   BACKGROUNDCOLOR,    BACKGROUNDCOLOR,   FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
302cdf0e10cSrcweir         DEF_INFO_3( SYMBOLCOLOR,       SYMBOLCOLOR,        SYMBOLCOLOR,       FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
303cdf0e10cSrcweir         DEF_INFO_3( FILLCOLOR,         FILLCOLOR,          FILLCOLOR,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
304cdf0e10cSrcweir         DEF_INFO_3( LINECOLOR,         LINECOLOR,          LINECOLOR,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
305cdf0e10cSrcweir         DEF_INFO_4( BORDER,            BORDER,             BORDER,            FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
306cdf0e10cSrcweir         DEF_INFO_3( BORDERCOLOR,       BORDERCOLOR,        BORDERCOLOR,       FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
307cdf0e10cSrcweir         DEF_INFO_3( ICONSIZE,          ICONSIZE,           ICONSIZE,          FORM_VISIBLE, ENUM, COMPOSEABLE ),
308cdf0e10cSrcweir         DEF_INFO_2( SHOW_POSITION,     SHOW_POSITION,      SHOW_POSITION,     FORM_VISIBLE, COMPOSEABLE ),
309cdf0e10cSrcweir         DEF_INFO_2( SHOW_NAVIGATION,   SHOW_NAVIGATION,    SHOW_NAVIGATION,   FORM_VISIBLE, COMPOSEABLE ),
310cdf0e10cSrcweir         DEF_INFO_2( SHOW_RECORDACTIONS,SHOW_RECORDACTIONS, SHOW_RECORDACTIONS,FORM_VISIBLE, COMPOSEABLE ),
311cdf0e10cSrcweir         DEF_INFO_2( SHOW_FILTERSORT,   SHOW_FILTERSORT,    SHOW_FILTERSORT,   FORM_VISIBLE, COMPOSEABLE ),
312cdf0e10cSrcweir 
313cdf0e10cSrcweir         DEF_INFO_3( DROPDOWN,          DROPDOWN,           DROPDOWN,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
314cdf0e10cSrcweir         DEF_INFO_3( LINECOUNT,         LINECOUNT,          LINECOUNT,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
315cdf0e10cSrcweir         DEF_INFO_3( AUTOCOMPLETE,      AUTOCOMPLETE,       AUTOCOMPLETE,      FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
316cdf0e10cSrcweir         DEF_INFO_3( MULTILINE,         MULTILINE,          MULTILINE,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
317cdf0e10cSrcweir         DEF_INFO_3( WORDBREAK,         WORDBREAK,          WORDBREAK,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
318cdf0e10cSrcweir         DEF_INFO_3( TEXTTYPE,          TEXTTYPE,           TEXTTYPE,          FORM_VISIBLE, ENUM, COMPOSEABLE ),
319cdf0e10cSrcweir         DEF_INFO_3( LINEEND_FORMAT,    LINEEND_FORMAT,     LINEEND_FORMAT,    FORM_VISIBLE, ENUM_ONE, COMPOSEABLE ),
320cdf0e10cSrcweir         DEF_INFO_3( MULTISELECTION,    MULTISELECTION,     MULTISELECTION,    FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
321cdf0e10cSrcweir         DEF_INFO_4( SHOW_SCROLLBARS,   SHOW_SCROLLBARS,    SHOW_SCROLLBARS,   FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
322cdf0e10cSrcweir         DEF_INFO_3( HSCROLL,           HSCROLL,            HSCROLL,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
323cdf0e10cSrcweir         DEF_INFO_3( VSCROLL,           VSCROLL,            VSCROLL,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
324cdf0e10cSrcweir         DEF_INFO_3( BUTTONTYPE,        BUTTONTYPE,         BUTTONTYPE,        FORM_VISIBLE, ENUM, COMPOSEABLE ),
325cdf0e10cSrcweir         DEF_INFO_2( XFORMS_BUTTONTYPE, BUTTONTYPE,         BUTTONTYPE,        FORM_VISIBLE, ENUM ),
326cdf0e10cSrcweir         DEF_INFO_1( SUBMISSION_ID,     SUBMISSION_ID,      SUBMISSION_ID,     FORM_VISIBLE ),
327cdf0e10cSrcweir         DEF_INFO_2( PUSHBUTTONTYPE,    PUSHBUTTONTYPE,     PUSHBUTTONTYPE,    DIALOG_VISIBLE, ENUM ),
328cdf0e10cSrcweir         DEF_INFO_2( TARGET_URL,        TARGET_URL,         TARGET_URL,        FORM_VISIBLE, COMPOSEABLE ),
329cdf0e10cSrcweir         DEF_INFO_1( TARGET_FRAME,      TARGET_FRAME,       TARGET_FRAME,      FORM_VISIBLE ),
330cdf0e10cSrcweir         DEF_INFO_2( SUBMIT_ACTION,     SUBMIT_ACTION,      SUBMIT_ACTION,     FORM_VISIBLE, COMPOSEABLE ),
331cdf0e10cSrcweir         DEF_INFO_2( SUBMIT_TARGET,     SUBMIT_TARGET,      SUBMIT_TARGET,     FORM_VISIBLE, COMPOSEABLE ),
332cdf0e10cSrcweir         DEF_INFO_3( SUBMIT_ENCODING,   SUBMIT_ENCODING,    SUBMIT_ENCODING,   FORM_VISIBLE, ENUM, COMPOSEABLE ),
333cdf0e10cSrcweir         DEF_INFO_3( SUBMIT_METHOD,     SUBMIT_METHOD,      SUBMIT_METHOD,     FORM_VISIBLE, ENUM, COMPOSEABLE ),
334cdf0e10cSrcweir         DEF_INFO_3( STATE,             STATE,              STATE,             DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
335cdf0e10cSrcweir         DEF_INFO_3( DEFAULTBUTTON,     DEFAULT_BUTTON,     DEFAULT_BUTTON,    FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
336cdf0e10cSrcweir         DEF_INFO_3( IMAGE_URL,         IMAGE_URL,          IMAGE_URL,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
337cdf0e10cSrcweir         DEF_INFO_4( IMAGEPOSITION,     IMAGEPOSITION,      IMAGEPOSITION,     FORM_VISIBLE, DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
338cdf0e10cSrcweir         DEF_INFO_3( SCALEIMAGE,        SCALEIMAGE,         SCALEIMAGE,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
339cdf0e10cSrcweir         DEF_INFO_4( SCALE_MODE,        SCALEIMAGE,         SCALEIMAGE,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE, ENUM ),
340cdf0e10cSrcweir         DEF_INFO_2( DEFAULT_SELECT_SEQ,DEFAULT_SELECT_SEQ, DEFAULT_SELECT_SEQ,FORM_VISIBLE, COMPOSEABLE ),
341cdf0e10cSrcweir         DEF_INFO_2( SELECTEDITEMS,     SELECTEDITEMS,      SELECTEDITEMS,     DIALOG_VISIBLE, COMPOSEABLE ),
342cdf0e10cSrcweir         DEF_INFO_3( ECHO_CHAR,         ECHO_CHAR,          ECHO_CHAR,         FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
343cdf0e10cSrcweir         DEF_INFO_3( HIDEINACTIVESELECTION, HIDEINACTIVESELECTION, HIDEINACTIVESELECTION, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
344cdf0e10cSrcweir         DEF_INFO_3( TRISTATE,          TRISTATE,           TRISTATE,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
345cdf0e10cSrcweir         DEF_INFO_2( HASNAVIGATION,     NAVIGATION,         NAVIGATIONBAR,     FORM_VISIBLE, COMPOSEABLE ),
346cdf0e10cSrcweir         DEF_INFO_2( RECORDMARKER,      RECORDMARKER,       RECORDMARKER,      FORM_VISIBLE, COMPOSEABLE ),
347cdf0e10cSrcweir         DEF_INFO_3( TAG,               TAG,                TAG,               FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
348cdf0e10cSrcweir         DEF_INFO_3( HELPTEXT,          HELPTEXT,           HELPTEXT,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
349cdf0e10cSrcweir         DEF_INFO_3( HELPURL,           HELPURL,            HELPURL,           FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
350cdf0e10cSrcweir 		DEF_INFO_3( SELECTION_TYPE,    SELECTION_TYPE,     SELECTION_TYPE,                  DIALOG_VISIBLE, ENUM, COMPOSEABLE ),
351cdf0e10cSrcweir 		DEF_INFO_2( ROOT_DISPLAYED,    ROOT_DISPLAYED,     ROOT_DISPLAYED,                  DIALOG_VISIBLE, COMPOSEABLE ),
352cdf0e10cSrcweir 		DEF_INFO_2( SHOWS_HANDLES,     SHOWS_HANDLES,      SHOWS_HANDLES,					DIALOG_VISIBLE, COMPOSEABLE ),
353cdf0e10cSrcweir 		DEF_INFO_2( SHOWS_ROOT_HANDLES, SHOWS_ROOT_HANDLES, SHOWS_ROOT_HANDLES,				DIALOG_VISIBLE, COMPOSEABLE ),
354cdf0e10cSrcweir 		DEF_INFO_2( EDITABLE,          EDITABLE,           EDITABLE,						DIALOG_VISIBLE, COMPOSEABLE ),
355cdf0e10cSrcweir 		DEF_INFO_2( INVOKES_STOP_NOT_EDITING, INVOKES_STOP_NOT_EDITING, INVOKES_STOP_NOT_EDITING, DIALOG_VISIBLE, COMPOSEABLE ),
356cdf0e10cSrcweir         DEF_INFO_2( DECORATION,        DECORATION,         DECORATION,                      DIALOG_VISIBLE, COMPOSEABLE ),
357cdf0e10cSrcweir 		DEF_INFO_2( NOLABEL,           NOLABEL,            NOLABEL,                         DIALOG_VISIBLE, COMPOSEABLE )
358cdf0e10cSrcweir 		};
359cdf0e10cSrcweir 
360cdf0e10cSrcweir 		s_pPropertyInfos = aPropertyInfos;
361cdf0e10cSrcweir 		s_nCount = sizeof(aPropertyInfos) / sizeof(OPropertyInfoImpl);
362cdf0e10cSrcweir 
363cdf0e10cSrcweir 		// sort
364cdf0e10cSrcweir         ::std::sort( s_pPropertyInfos, s_pPropertyInfos + s_nCount, PropertyInfoLessByName() );
365cdf0e10cSrcweir 
366cdf0e10cSrcweir #if OSL_DEBUG_LEVEL > 0
367cdf0e10cSrcweir         for ( const OPropertyInfoImpl* pCheck = s_pPropertyInfos; pCheck != s_pPropertyInfos + s_nCount - 1; ++pCheck )
368cdf0e10cSrcweir         {
369cdf0e10cSrcweir             OSL_ENSURE( pCheck->sName != ( pCheck + 1 )->sName, "OPropertyInfoService::getPropertyInfo: duplicate entry in the table!" );
370cdf0e10cSrcweir         }
371cdf0e10cSrcweir #endif
372cdf0e10cSrcweir 
373cdf0e10cSrcweir         return s_pPropertyInfos;
374cdf0e10cSrcweir 	}
375cdf0e10cSrcweir 
376cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyId(const String & _rName) const377cdf0e10cSrcweir 	sal_Int32 OPropertyInfoService::getPropertyId(const String& _rName) const
378cdf0e10cSrcweir 	{
379cdf0e10cSrcweir 		const OPropertyInfoImpl* pInfo = getPropertyInfo(_rName);
380cdf0e10cSrcweir 		return pInfo ? pInfo->nId : -1;
381cdf0e10cSrcweir 	}
382cdf0e10cSrcweir 
383cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyName(sal_Int32 _nPropId)384cdf0e10cSrcweir 	String OPropertyInfoService::getPropertyName( sal_Int32 _nPropId )
385cdf0e10cSrcweir     {
386cdf0e10cSrcweir 		const OPropertyInfoImpl* pInfo = getPropertyInfo(_nPropId);
387cdf0e10cSrcweir 		return pInfo ? pInfo->sName : String();
388cdf0e10cSrcweir     }
389cdf0e10cSrcweir 
390cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyTranslation(sal_Int32 _nId) const391cdf0e10cSrcweir 	String OPropertyInfoService::getPropertyTranslation(sal_Int32 _nId) const
392cdf0e10cSrcweir 	{
393cdf0e10cSrcweir 		const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
394cdf0e10cSrcweir 		return (pInfo) ? pInfo->sTranslation : String();
395cdf0e10cSrcweir 	}
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyHelpId(sal_Int32 _nId) const398cdf0e10cSrcweir 	rtl::OString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const
399cdf0e10cSrcweir 	{
400cdf0e10cSrcweir 		const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
401cdf0e10cSrcweir 		return (pInfo) ? pInfo->sHelpId : rtl::OString();
402cdf0e10cSrcweir 	}
403cdf0e10cSrcweir 
404cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyPos(sal_Int32 _nId) const405cdf0e10cSrcweir 	sal_Int16 OPropertyInfoService::getPropertyPos(sal_Int32 _nId) const
406cdf0e10cSrcweir 	{
407cdf0e10cSrcweir 		const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
408cdf0e10cSrcweir 		return (pInfo) ? pInfo->nPos : 0xFFFF;
409cdf0e10cSrcweir 	}
410cdf0e10cSrcweir 
411cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyUIFlags(sal_Int32 _nId) const412cdf0e10cSrcweir 	sal_uInt32 OPropertyInfoService::getPropertyUIFlags(sal_Int32 _nId) const
413cdf0e10cSrcweir 	{
414cdf0e10cSrcweir 		const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId);
415cdf0e10cSrcweir 		return (pInfo) ? pInfo->nUIFlags : 0;
416cdf0e10cSrcweir 	}
417cdf0e10cSrcweir 
418cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyEnumRepresentations(sal_Int32 _nId) const419cdf0e10cSrcweir     ::std::vector< ::rtl::OUString > OPropertyInfoService::getPropertyEnumRepresentations(sal_Int32 _nId) const
420cdf0e10cSrcweir 	{
421cdf0e10cSrcweir         OSL_ENSURE( ( ( getPropertyUIFlags( _nId ) & PROP_FLAG_ENUM ) != 0 ) || ( _nId == PROPERTY_ID_TARGET_FRAME ),
422cdf0e10cSrcweir             "OPropertyInfoService::getPropertyEnumRepresentations: this is no enum property!" );
423cdf0e10cSrcweir 
424cdf0e10cSrcweir         sal_Int16 nStringItemsResId = 0;
425cdf0e10cSrcweir         switch ( _nId )
426cdf0e10cSrcweir 		{
427cdf0e10cSrcweir             case PROPERTY_ID_IMAGEPOSITION:
428cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_IMAGE_POSITION;
429cdf0e10cSrcweir 				break;
430cdf0e10cSrcweir 			case PROPERTY_ID_BORDER:
431cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_BORDER_TYPE;
432cdf0e10cSrcweir 				break;
433cdf0e10cSrcweir 			case PROPERTY_ID_ICONSIZE:
434cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_ICONSIZE_TYPE;
435cdf0e10cSrcweir 				break;
436cdf0e10cSrcweir 			case PROPERTY_ID_COMMANDTYPE:
437cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_COMMAND_TYPE;
438cdf0e10cSrcweir 				break;
439cdf0e10cSrcweir 			case PROPERTY_ID_LISTSOURCETYPE:
440cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_LISTSOURCE_TYPE;
441cdf0e10cSrcweir 				break;
442cdf0e10cSrcweir 			case PROPERTY_ID_ALIGN:
443cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_ALIGNMENT;
444cdf0e10cSrcweir 				break;
445cdf0e10cSrcweir             case PROPERTY_ID_VERTICAL_ALIGN:
446cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_VERTICAL_ALIGN;
447cdf0e10cSrcweir                 break;
448cdf0e10cSrcweir 			case PROPERTY_ID_BUTTONTYPE:
449cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_BUTTONTYPE;
450cdf0e10cSrcweir 				break;
451cdf0e10cSrcweir 			case PROPERTY_ID_PUSHBUTTONTYPE:
452cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_PUSHBUTTONTYPE;
453cdf0e10cSrcweir 				break;
454cdf0e10cSrcweir             case PROPERTY_ID_SUBMIT_METHOD:
455cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_SUBMIT_METHOD;
456cdf0e10cSrcweir 				break;
457cdf0e10cSrcweir 			case PROPERTY_ID_SUBMIT_ENCODING:
458cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_SUBMIT_ENCODING;
459cdf0e10cSrcweir 				break;
460cdf0e10cSrcweir 			case PROPERTY_ID_DATEFORMAT:
461cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_DATEFORMAT_LIST;
462cdf0e10cSrcweir 				break;
463cdf0e10cSrcweir 			case PROPERTY_ID_TIMEFORMAT:
464cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_TIMEFORMAT_LIST;
465cdf0e10cSrcweir 				break;
466cdf0e10cSrcweir 			case PROPERTY_ID_DEFAULT_STATE:
467cdf0e10cSrcweir 			case PROPERTY_ID_STATE:
468cdf0e10cSrcweir                 nStringItemsResId = RID_RSC_ENUM_CHECKED;
469cdf0e10cSrcweir 				break;
470cdf0e10cSrcweir 			case PROPERTY_ID_CYCLE:
471cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_CYCLE;
472cdf0e10cSrcweir 				break;
473cdf0e10cSrcweir 			case PROPERTY_ID_NAVIGATION:
474cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_NAVIGATION;
475cdf0e10cSrcweir 				break;
476cdf0e10cSrcweir 			case PROPERTY_ID_TARGET_FRAME:
477cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_SUBMIT_TARGET;
478cdf0e10cSrcweir 				break;
479cdf0e10cSrcweir 			case PROPERTY_ID_ORIENTATION:
480cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_ORIENTATION;
481cdf0e10cSrcweir 				break;
482cdf0e10cSrcweir             case PROPERTY_ID_CELL_EXCHANGE_TYPE:
483cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_CELL_EXCHANGE_TYPE;
484cdf0e10cSrcweir 				break;
485cdf0e10cSrcweir             case PROPERTY_ID_SHOW_SCROLLBARS:
486cdf0e10cSrcweir                 nStringItemsResId = RID_RSC_ENUM_SCROLLBARS;
487cdf0e10cSrcweir                 break;
488cdf0e10cSrcweir             case PROPERTY_ID_VISUALEFFECT:
489cdf0e10cSrcweir                 nStringItemsResId = RID_RSC_ENUM_VISUALEFFECT;
490cdf0e10cSrcweir                 break;
491cdf0e10cSrcweir             case PROPERTY_ID_TEXTTYPE:
492cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_TEXTTYPE;
493cdf0e10cSrcweir                 break;
494cdf0e10cSrcweir             case PROPERTY_ID_LINEEND_FORMAT:
495cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_LINEEND_FORMAT;
496cdf0e10cSrcweir 				break;
497cdf0e10cSrcweir             case PROPERTY_ID_XSD_WHITESPACES:
498cdf0e10cSrcweir                 nStringItemsResId = RID_RSC_ENUM_WHITESPACE_HANDLING;
499cdf0e10cSrcweir                 break;
500cdf0e10cSrcweir             case PROPERTY_ID_SELECTION_TYPE:
501cdf0e10cSrcweir                 nStringItemsResId = RID_RSC_ENUM_SELECTION_TYPE;
502cdf0e10cSrcweir                 break;
503cdf0e10cSrcweir             case PROPERTY_ID_SCALE_MODE:
504cdf0e10cSrcweir                 nStringItemsResId = RID_RSC_ENUM_SCALE_MODE;
505cdf0e10cSrcweir                 break;
506cdf0e10cSrcweir             case PROPERTY_ID_WRITING_MODE:
507cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_WRITING_MODE;
508cdf0e10cSrcweir                 break;
509cdf0e10cSrcweir             case PROPERTY_ID_WHEEL_BEHAVIOR:
510cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_WHEEL_BEHAVIOR;
511cdf0e10cSrcweir                 break;
512cdf0e10cSrcweir             case PROPERTY_ID_TEXT_ANCHOR_TYPE:
513cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_TEXT_ANCHOR_TYPE;
514cdf0e10cSrcweir                 break;
515cdf0e10cSrcweir             case PROPERTY_ID_SHEET_ANCHOR_TYPE:
516cdf0e10cSrcweir 				nStringItemsResId = RID_RSC_ENUM_SHEET_ANCHOR_TYPE;
517cdf0e10cSrcweir                 break;
518cdf0e10cSrcweir             default:
519cdf0e10cSrcweir                 OSL_ENSURE( sal_False, "OPropertyInfoService::getPropertyEnumRepresentations: unknown enum property!" );
520cdf0e10cSrcweir                 break;
521cdf0e10cSrcweir 		}
522cdf0e10cSrcweir 
523cdf0e10cSrcweir         ::std::vector< ::rtl::OUString > aReturn;
524cdf0e10cSrcweir 
525cdf0e10cSrcweir         if ( nStringItemsResId )
526cdf0e10cSrcweir         {
527cdf0e10cSrcweir             PcrRes aResId( nStringItemsResId );
528cdf0e10cSrcweir             ::svt::OLocalResourceAccess aEnumStrings( aResId, RSC_RESOURCE );
529cdf0e10cSrcweir 
530cdf0e10cSrcweir             sal_Int16 i = 1;
531cdf0e10cSrcweir             PcrRes aLocalId( i );
532cdf0e10cSrcweir             while ( aEnumStrings.IsAvailableRes( aLocalId.SetRT( RSC_STRING ) ) )
533cdf0e10cSrcweir             {
534cdf0e10cSrcweir                 aReturn.push_back( String( aLocalId ) );
535cdf0e10cSrcweir                 aLocalId = PcrRes( ++i );
536cdf0e10cSrcweir             }
537cdf0e10cSrcweir         }
538cdf0e10cSrcweir 
539cdf0e10cSrcweir 		return aReturn;
540cdf0e10cSrcweir 	}
541cdf0e10cSrcweir 
542cdf0e10cSrcweir 	//------------------------------------------------------------------------
isComposeable(const::rtl::OUString & _rPropertyName) const543cdf0e10cSrcweir     sal_Bool OPropertyInfoService::isComposeable( const ::rtl::OUString& _rPropertyName ) const
544cdf0e10cSrcweir     {
545cdf0e10cSrcweir         sal_Int32 nId = getPropertyId( _rPropertyName );
546cdf0e10cSrcweir         if ( nId == -1 )
547cdf0e10cSrcweir             return sal_False;
548cdf0e10cSrcweir 
549cdf0e10cSrcweir         sal_uInt32 nFlags = getPropertyUIFlags( nId );
550cdf0e10cSrcweir         return ( nFlags & PROP_FLAG_COMPOSEABLE ) != 0;
551cdf0e10cSrcweir     }
552cdf0e10cSrcweir 
553cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyInfo(const String & _rName)554cdf0e10cSrcweir 	const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(const String& _rName)
555cdf0e10cSrcweir 	{
556cdf0e10cSrcweir 		// intialisierung
557cdf0e10cSrcweir 		if(!s_pPropertyInfos)
558cdf0e10cSrcweir 			getPropertyInfo();
559cdf0e10cSrcweir 		OPropertyInfoImpl  aSearch(_rName, 0L, String(), 0, "", 0);
560cdf0e10cSrcweir 
561cdf0e10cSrcweir         const OPropertyInfoImpl* pInfo = ::std::lower_bound(
562cdf0e10cSrcweir             s_pPropertyInfos, s_pPropertyInfos + s_nCount, aSearch, PropertyInfoLessByName() );
563cdf0e10cSrcweir 
564cdf0e10cSrcweir         if ( pInfo == s_pPropertyInfos + s_nCount )
565cdf0e10cSrcweir             return NULL;
566cdf0e10cSrcweir 
567cdf0e10cSrcweir         if ( pInfo->sName != _rName )
568cdf0e10cSrcweir             return NULL;
569cdf0e10cSrcweir 
570cdf0e10cSrcweir 		return pInfo;
571cdf0e10cSrcweir 	}
572cdf0e10cSrcweir 
573cdf0e10cSrcweir 
574cdf0e10cSrcweir 	//------------------------------------------------------------------------
getPropertyInfo(sal_Int32 _nId)575cdf0e10cSrcweir 	const OPropertyInfoImpl* OPropertyInfoService::getPropertyInfo(sal_Int32 _nId)
576cdf0e10cSrcweir 	{
577cdf0e10cSrcweir 		// intialisierung
578cdf0e10cSrcweir 		if(!s_pPropertyInfos)
579cdf0e10cSrcweir 			getPropertyInfo();
580cdf0e10cSrcweir 
581cdf0e10cSrcweir 		// TODO: a real structure which allows quick access by name as well as by id
582cdf0e10cSrcweir 		for (sal_uInt16 i = 0; i < s_nCount; i++)
583cdf0e10cSrcweir 			if (s_pPropertyInfos[i].nId == _nId)
584cdf0e10cSrcweir 				return &s_pPropertyInfos[i];
585cdf0e10cSrcweir 
586cdf0e10cSrcweir 		return NULL;
587cdf0e10cSrcweir 	}
588cdf0e10cSrcweir 
589cdf0e10cSrcweir 	//====================================================================
590cdf0e10cSrcweir 	//= DefaultEnumRepresentation
591cdf0e10cSrcweir 	//====================================================================
DBG_NAME(DefaultEnumRepresentation)592cdf0e10cSrcweir     DBG_NAME( DefaultEnumRepresentation )
593cdf0e10cSrcweir     //--------------------------------------------------------------------
594cdf0e10cSrcweir     DefaultEnumRepresentation::DefaultEnumRepresentation( const IPropertyInfoService& _rInfo, const Type& _rType, sal_Int32 _nPropertyId )
595cdf0e10cSrcweir         :m_refCount( 0 )
596cdf0e10cSrcweir         ,m_rMetaData( _rInfo )
597cdf0e10cSrcweir         ,m_aType( _rType )
598cdf0e10cSrcweir         ,m_nPropertyId( _nPropertyId )
599cdf0e10cSrcweir     {
600cdf0e10cSrcweir         DBG_CTOR( DefaultEnumRepresentation, NULL );
601cdf0e10cSrcweir     }
602cdf0e10cSrcweir 
603cdf0e10cSrcweir     //--------------------------------------------------------------------
~DefaultEnumRepresentation()604cdf0e10cSrcweir     DefaultEnumRepresentation::~DefaultEnumRepresentation()
605cdf0e10cSrcweir     {
606cdf0e10cSrcweir         DBG_DTOR( DefaultEnumRepresentation, NULL );
607cdf0e10cSrcweir     }
608cdf0e10cSrcweir 
609cdf0e10cSrcweir     //--------------------------------------------------------------------
getDescriptions() const610cdf0e10cSrcweir     ::std::vector< ::rtl::OUString > SAL_CALL DefaultEnumRepresentation::getDescriptions() const
611cdf0e10cSrcweir     {
612cdf0e10cSrcweir         return m_rMetaData.getPropertyEnumRepresentations( m_nPropertyId );
613cdf0e10cSrcweir     }
614cdf0e10cSrcweir 
615cdf0e10cSrcweir     //--------------------------------------------------------------------
getValueFromDescription(const::rtl::OUString & _rDescription,Any & _out_rValue) const616cdf0e10cSrcweir     void SAL_CALL DefaultEnumRepresentation::getValueFromDescription( const ::rtl::OUString& _rDescription, Any& _out_rValue ) const
617cdf0e10cSrcweir     {
618cdf0e10cSrcweir         sal_uInt32  nPropertyUIFlags = m_rMetaData.getPropertyUIFlags( m_nPropertyId );
619cdf0e10cSrcweir         ::std::vector< ::rtl::OUString > aEnumStrings = m_rMetaData.getPropertyEnumRepresentations( m_nPropertyId );
620cdf0e10cSrcweir         ::std::vector< ::rtl::OUString >::const_iterator pos = ::std::find( aEnumStrings.begin(), aEnumStrings.end(), _rDescription );
621cdf0e10cSrcweir         if ( pos != aEnumStrings.end() )
622cdf0e10cSrcweir         {
623cdf0e10cSrcweir             sal_Int32 nPos = pos - aEnumStrings.begin();
624cdf0e10cSrcweir             if ( ( nPropertyUIFlags & PROP_FLAG_ENUM_ONE ) == PROP_FLAG_ENUM_ONE )
625cdf0e10cSrcweir                 // enum value starting with 1
626cdf0e10cSrcweir                 ++nPos;
627cdf0e10cSrcweir 
628cdf0e10cSrcweir             switch ( m_aType.getTypeClass() )
629cdf0e10cSrcweir             {
630cdf0e10cSrcweir                 case TypeClass_ENUM:
631cdf0e10cSrcweir                     _out_rValue = ::cppu::int2enum( nPos, m_aType );
632cdf0e10cSrcweir                     break;
633cdf0e10cSrcweir 
634cdf0e10cSrcweir                 case TypeClass_SHORT:
635cdf0e10cSrcweir                     _out_rValue <<= (sal_Int16)nPos;
636cdf0e10cSrcweir                     break;
637cdf0e10cSrcweir 
638cdf0e10cSrcweir                 case TypeClass_UNSIGNED_SHORT:
639cdf0e10cSrcweir                     _out_rValue <<= (sal_uInt16)nPos;
640cdf0e10cSrcweir                     break;
641cdf0e10cSrcweir 
642cdf0e10cSrcweir                 case TypeClass_UNSIGNED_LONG:
643cdf0e10cSrcweir                     _out_rValue <<= (sal_uInt32)nPos;
644cdf0e10cSrcweir                     break;
645cdf0e10cSrcweir 
646cdf0e10cSrcweir                 default:
647cdf0e10cSrcweir                     _out_rValue <<= (sal_Int32)nPos;
648cdf0e10cSrcweir                     break;
649cdf0e10cSrcweir             }
650cdf0e10cSrcweir         }
651cdf0e10cSrcweir         else
652cdf0e10cSrcweir         {
653cdf0e10cSrcweir             DBG_ERROR( "DefaultEnumRepresentation::getValueFromDescription: could not translate the enum string!" );
654cdf0e10cSrcweir             _out_rValue.clear();
655cdf0e10cSrcweir         }
656cdf0e10cSrcweir     }
657cdf0e10cSrcweir 
658cdf0e10cSrcweir     //--------------------------------------------------------------------
getDescriptionForValue(const Any & _rEnumValue) const659cdf0e10cSrcweir     ::rtl::OUString SAL_CALL DefaultEnumRepresentation::getDescriptionForValue( const Any& _rEnumValue ) const
660cdf0e10cSrcweir     {
661cdf0e10cSrcweir         ::rtl::OUString sReturn;
662cdf0e10cSrcweir 		sal_Int32 nIntValue = -1;
663cdf0e10cSrcweir 		OSL_VERIFY( ::cppu::enum2int( nIntValue, _rEnumValue ) );
664cdf0e10cSrcweir 
665cdf0e10cSrcweir         sal_uInt32 nUIFlags = m_rMetaData.getPropertyUIFlags( m_nPropertyId );
666cdf0e10cSrcweir         if ( ( nUIFlags & PROP_FLAG_ENUM_ONE ) == PROP_FLAG_ENUM_ONE )
667cdf0e10cSrcweir             // enum value starting with 1
668cdf0e10cSrcweir             --nIntValue;
669cdf0e10cSrcweir 
670cdf0e10cSrcweir         ::std::vector< ::rtl::OUString > aEnumStrings = m_rMetaData.getPropertyEnumRepresentations( m_nPropertyId );
671cdf0e10cSrcweir 		if ( ( nIntValue >= 0 ) && ( nIntValue < (sal_Int32)aEnumStrings.size() ) )
672cdf0e10cSrcweir 		{
673cdf0e10cSrcweir 			sReturn = aEnumStrings[ nIntValue ];
674cdf0e10cSrcweir 		}
675cdf0e10cSrcweir 		else
676cdf0e10cSrcweir 		{
677cdf0e10cSrcweir 			DBG_ERROR( "DefaultEnumRepresentation::getDescriptionForValue: could not translate an enum value" );
678cdf0e10cSrcweir 		}
679cdf0e10cSrcweir         return sReturn;
680cdf0e10cSrcweir     }
681cdf0e10cSrcweir 
682cdf0e10cSrcweir     //--------------------------------------------------------------------
acquire()683cdf0e10cSrcweir     oslInterlockedCount SAL_CALL DefaultEnumRepresentation::acquire()
684cdf0e10cSrcweir     {
685cdf0e10cSrcweir         return osl_incrementInterlockedCount( &m_refCount );
686cdf0e10cSrcweir     }
687cdf0e10cSrcweir 
688cdf0e10cSrcweir     //--------------------------------------------------------------------
release()689cdf0e10cSrcweir     oslInterlockedCount SAL_CALL DefaultEnumRepresentation::release()
690cdf0e10cSrcweir     {
691cdf0e10cSrcweir         if ( 0 == osl_decrementInterlockedCount( &m_refCount ) )
692cdf0e10cSrcweir         {
693cdf0e10cSrcweir            delete this;
694cdf0e10cSrcweir            return 0;
695cdf0e10cSrcweir         }
696cdf0e10cSrcweir         return m_refCount;
697cdf0e10cSrcweir     }
698cdf0e10cSrcweir 
699cdf0e10cSrcweir //............................................................................
700cdf0e10cSrcweir } // namespace pcr
701cdf0e10cSrcweir //............................................................................
702cdf0e10cSrcweir 
703