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