Bump for 3.6-28
[LibreOffice.git] / xmlscript / source / xmldlg_imexp / xmldlg_expmodels.cxx
blob1c3432f99b1dbd5f12d8917ca9cce248fad926a8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "exp_share.hxx"
31 #include <com/sun/star/form/binding/XListEntrySink.hpp>
32 #include <com/sun/star/form/binding/XBindableValue.hpp>
33 #include <com/sun/star/form/binding/XValueBinding.hpp>
34 #include <com/sun/star/table/CellAddress.hpp>
35 #include <com/sun/star/table/CellRangeAddress.hpp>
36 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
37 #include <com/sun/star/document/XStorageBasedDocument.hpp>
38 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
39 #include <comphelper/componentcontext.hxx>
40 #include <com/sun/star/lang/XServiceInfo.hpp>
42 using namespace ::com::sun::star;
43 using namespace ::com::sun::star::uno;
44 using ::rtl::OUString;
46 namespace xmlscript
49 static inline bool readBorderProps(
50 ElementDescriptor * element, Style & style )
52 if (element->readProp( &style._border, OUSTR("Border") )) {
53 if (style._border == BORDER_SIMPLE /* simple */)
55 if (element->readProp( &style._borderColor, OUSTR("BorderColor") ))
56 style._border = BORDER_SIMPLE_COLOR;
58 return true;
60 return false;
63 static inline bool readFontProps( ElementDescriptor * element, Style & style )
65 bool ret = element->readProp(
66 &style._descr, OUSTR("FontDescriptor") );
67 ret |= element->readProp(
68 &style._fontEmphasisMark, OUSTR("FontEmphasisMark") );
69 ret |= element->readProp(
70 &style._fontRelief, OUSTR("FontRelief") );
71 return ret;
74 //__________________________________________________________________________________________________
75 void ElementDescriptor::readMultiPageModel( StyleBag * all_styles )
77 // collect styles
78 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
79 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
80 aStyle._set |= 0x1;
81 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
82 aStyle._set |= 0x2;
83 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
84 aStyle._set |= 0x20;
85 if (readFontProps( this, aStyle ))
86 aStyle._set |= 0x8;
87 if (aStyle._set)
89 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
90 all_styles->getStyleId( aStyle ) );
93 // collect elements
94 readDefaults();
95 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiPageValue") ),
96 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
97 Any aDecorationAny( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ) ) );
98 bool bDecoration = sal_True;
99 if ( (aDecorationAny >>= bDecoration) && !bDecoration )
100 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":withtabs") ), OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
102 readEvents();
103 uno::Reference< container::XNameContainer > xPagesContainer( _xProps, uno::UNO_QUERY );
104 if ( xPagesContainer.is() && xPagesContainer->getElementNames().getLength() )
106 ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), _xDocument );
107 pElem->readBullitinBoard( all_styles );
108 addSubElement( pElem );
111 //__________________________________________________________________________________________________
112 void ElementDescriptor::readFrameModel( StyleBag * all_styles )
114 // collect styles
115 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
117 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
118 aStyle._set |= 0x2;
119 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
120 aStyle._set |= 0x20;
121 if (readFontProps( this, aStyle ))
122 aStyle._set |= 0x8;
123 if (aStyle._set)
125 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
126 all_styles->getStyleId( aStyle ) );
129 // collect elements
130 readDefaults();
131 OUString aTitle;
133 if ( readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle)
135 ElementDescriptor * title = new ElementDescriptor(
136 _xProps, _xPropState,
137 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ), _xDocument );
138 title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
139 aTitle );
140 addSubElement( title );
143 uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY );
144 if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() )
146 ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), _xDocument );
147 pElem->readBullitinBoard( all_styles );
148 addSubElement( pElem );
150 readEvents();
152 //__________________________________________________________________________________________________
153 void ElementDescriptor::readPageModel( StyleBag * all_styles )
155 // collect styles
156 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
157 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
158 aStyle._set |= 0x1;
159 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
160 aStyle._set |= 0x2;
161 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
162 aStyle._set |= 0x20;
163 if (readFontProps( this, aStyle ))
164 aStyle._set |= 0x8;
165 if (aStyle._set)
167 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
168 all_styles->getStyleId( aStyle ) );
171 // collect elements
172 readDefaults();
173 rtl::OUString aTitle;
174 readStringAttr(
175 OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ),
176 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) );
177 uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY );
178 if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() )
180 ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), _xDocument );
181 pElem->readBullitinBoard( all_styles );
182 addSubElement( pElem );
184 readEvents();
187 void ElementDescriptor::readButtonModel( StyleBag * all_styles )
188 SAL_THROW( (Exception) )
190 // collect styles
191 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
192 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
193 aStyle._set |= 0x1;
194 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
195 aStyle._set |= 0x2;
196 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
197 aStyle._set |= 0x20;
198 if (readFontProps( this, aStyle ))
199 aStyle._set |= 0x8;
200 if (aStyle._set)
202 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
203 all_styles->getStyleId( aStyle ) );
206 // collect elements
207 readDefaults();
208 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
209 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
210 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultButton") ),
211 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":default") ) );
212 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
213 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
214 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
215 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
216 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
217 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) );
218 readButtonTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("PushButtonType") ),
219 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":button-type") ) );
220 readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
221 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) );
224 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ),
225 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) );
226 readImageAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageAlign") ),
227 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-align") ) );
228 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) ))
229 readLongAttr( OUSTR("RepeatDelay"),
230 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ );
231 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Toggle") ) ))
232 addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":toggled"), OUSTR("1") );
233 readBoolAttr( OUSTR("FocusOnClick"),
234 OUSTR(XMLNS_DIALOGS_PREFIX ":grab-focus") );
235 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
236 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) );
239 // State
240 sal_Int16 nState = 0;
241 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState)
243 switch (nState)
245 case 0:
246 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
247 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
248 break;
249 case 1:
250 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
251 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
252 break;
253 default:
254 OSL_FAIL( "### unexpected radio state!" );
255 break;
259 readEvents();
261 //__________________________________________________________________________________________________
262 void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles )
263 SAL_THROW( (Exception) )
265 // collect styles
266 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
267 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
268 aStyle._set |= 0x1;
269 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
270 aStyle._set |= 0x2;
271 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
272 aStyle._set |= 0x20;
273 if (readFontProps( this, aStyle ))
274 aStyle._set |= 0x8;
275 if (readProp( OUSTR("VisualEffect") ) >>= aStyle._visualEffect)
276 aStyle._set |= 0x40;
277 if (aStyle._set)
279 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
280 all_styles->getStyleId( aStyle ) );
283 // collect elements
284 readDefaults();
285 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
286 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
287 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
288 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
289 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
290 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
291 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
292 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) );
293 readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
294 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) );
295 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ),
296 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) );
297 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
298 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) );
300 sal_Bool bTriState = sal_False;
301 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TriState") ) ) >>= bTriState) && bTriState)
303 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tristate") ),
304 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
306 sal_Int16 nState = 0;
307 if (_xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState)
309 switch (nState)
311 case 0:
312 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
313 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
314 break;
315 case 1:
316 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
317 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
318 break;
319 case 2: // tristate=true exported, checked omitted => dont know!
320 OSL_ENSURE( bTriState, "### detected tristate value, but TriState is not set!" );
321 break;
322 default:
323 OSL_FAIL( "### unexpected checkbox state!" );
324 break;
327 readEvents();
329 //__________________________________________________________________________________________________
330 void ElementDescriptor::readComboBoxModel( StyleBag * all_styles )
331 SAL_THROW( (Exception) )
333 // collect styles
334 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
335 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
336 aStyle._set |= 0x1;
337 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
338 aStyle._set |= 0x2;
339 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
340 aStyle._set |= 0x20;
341 if (readBorderProps( this, aStyle ))
342 aStyle._set |= 0x4;
343 if (readFontProps( this, aStyle ))
344 aStyle._set |= 0x8;
345 if (aStyle._set)
347 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
348 all_styles->getStyleId( aStyle ) );
351 // collect elements
352 readDefaults();
353 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
354 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
355 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
356 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
357 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
358 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
359 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Autocomplete") ),
360 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":autocomplete") ) );
361 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
362 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
363 readBoolAttr( OUSTR("HideInactiveSelection"),
364 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
365 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ),
366 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
367 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
368 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) );
369 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ),
370 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) );
371 // Cell Range, Ref Cell etc.
372 readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") );
373 readDataAwareAttr( OUSTR( XMLNS_DIALOGS_PREFIX ":source-cell-range") );
375 // string item list
376 Sequence< OUString > itemValues;
377 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) &&
378 itemValues.getLength() > 0)
380 ElementDescriptor * popup = new ElementDescriptor(
381 _xProps, _xPropState,
382 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ), _xDocument );
384 OUString const * pItemValues = itemValues.getConstArray();
385 for ( sal_Int32 nPos = 0; nPos < itemValues.getLength(); ++nPos )
387 ElementDescriptor * item = new ElementDescriptor(
388 _xProps, _xPropState,
389 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ), _xDocument );
390 item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
391 pItemValues[ nPos ] );
392 popup->addSubElement( item );
395 addSubElement( popup );
397 readEvents();
399 //__________________________________________________________________________________________________
400 void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
401 SAL_THROW( (Exception) )
403 // collect styles
404 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
405 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
406 aStyle._set |= 0x1;
407 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
408 aStyle._set |= 0x2;
409 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
410 aStyle._set |= 0x20;
411 if (readBorderProps( this, aStyle ))
412 aStyle._set |= 0x4;
413 if (readFontProps( this, aStyle ))
414 aStyle._set |= 0x8;
415 if (aStyle._set)
417 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
418 all_styles->getStyleId( aStyle ) );
421 // collect elements
422 readDefaults();
423 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
424 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
425 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiSelection") ),
426 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiselection") ) );
427 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
428 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
429 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ),
430 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
431 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ),
432 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) );
433 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
434 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
435 readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") );
436 readDataAwareAttr( OUSTR( XMLNS_DIALOGS_PREFIX ":source-cell-range") );
437 // string item list
438 Sequence< OUString > itemValues;
439 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) &&
440 itemValues.getLength() > 0)
442 ElementDescriptor * popup = new ElementDescriptor(
443 _xProps, _xPropState,
444 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ), _xDocument );
446 OUString const * pItemValues = itemValues.getConstArray();
447 sal_Int32 nPos;
448 for ( nPos = 0; nPos < itemValues.getLength(); ++nPos )
450 ElementDescriptor * item = new ElementDescriptor(
451 _xProps, _xPropState,
452 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ), _xDocument );
453 item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
454 pItemValues[ nPos ] );
455 popup->addSubElement( item );
458 Sequence< sal_Int16 > selected;
459 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ) ) >>= selected)
461 sal_Int16 const * pSelected = selected.getConstArray();
462 for ( nPos = selected.getLength(); nPos--; )
464 ElementDescriptor * item = static_cast< ElementDescriptor * >(
465 popup->getSubElement( pSelected[ nPos ] ).get() );
466 item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selected") ),
467 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
471 addSubElement( popup );
473 readEvents();
475 //__________________________________________________________________________________________________
476 void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles )
477 SAL_THROW( (Exception) )
479 // collect styles
480 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
481 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
482 aStyle._set |= 0x1;
483 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
484 aStyle._set |= 0x2;
485 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
486 aStyle._set |= 0x20;
487 if (readFontProps( this, aStyle ))
488 aStyle._set |= 0x8;
489 if (readProp( OUSTR("VisualEffect") ) >>= aStyle._visualEffect)
490 aStyle._set |= 0x40;
491 if (aStyle._set)
493 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
494 all_styles->getStyleId( aStyle ) );
497 // collect elements
498 readDefaults();
499 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
500 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
501 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
502 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
503 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
504 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
505 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
506 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) );
507 readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
508 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) );
509 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ),
510 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) );
511 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
512 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) );
513 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ),
514 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":group-name") ) );
516 sal_Int16 nState = 0;
517 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState)
519 switch (nState)
521 case 0:
522 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
523 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
524 break;
525 case 1:
526 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ),
527 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
528 break;
529 default:
530 OSL_FAIL( "### unexpected radio state!" );
531 break;
534 readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") );
535 readEvents();
537 //__________________________________________________________________________________________________
538 void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
539 SAL_THROW( (Exception) )
541 // collect styles
542 Style aStyle( 0x2 | 0x8 | 0x20 );
543 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
544 aStyle._set |= 0x2;
545 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
546 aStyle._set |= 0x20;
547 if (readFontProps( this, aStyle ))
548 aStyle._set |= 0x8;
549 if (aStyle._set)
551 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
552 all_styles->getStyleId( aStyle ) );
555 // collect elements
556 readDefaults();
558 OUString aTitle;
559 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle)
561 ElementDescriptor * title = new ElementDescriptor(
562 _xProps, _xPropState,
563 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ), _xDocument );
564 title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ),
565 aTitle );
566 addSubElement( title );
569 readEvents();
571 //__________________________________________________________________________________________________
572 void ElementDescriptor::readFixedTextModel( StyleBag * all_styles )
573 SAL_THROW( (Exception) )
575 // collect styles
576 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
577 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
578 aStyle._set |= 0x1;
579 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
580 aStyle._set |= 0x2;
581 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
582 aStyle._set |= 0x20;
583 if (readBorderProps( this, aStyle ))
584 aStyle._set |= 0x4;
585 if (readFontProps( this, aStyle ))
586 aStyle._set |= 0x8;
587 if (aStyle._set)
589 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
590 all_styles->getStyleId( aStyle ) );
593 // collect elements
594 readDefaults();
595 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
596 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
597 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
598 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
599 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
600 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) );
601 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
602 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) );
603 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
604 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
605 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("NoLabel") ),
606 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":nolabel") ) );
607 readEvents();
609 //__________________________________________________________________________________________________
610 void ElementDescriptor::readFixedHyperLinkModel( StyleBag * all_styles )
611 SAL_THROW( (Exception) )
613 // collect styles
614 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
615 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
616 aStyle._set |= 0x1;
617 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
618 aStyle._set |= 0x2;
619 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
620 aStyle._set |= 0x20;
621 if (readBorderProps( this, aStyle ))
622 aStyle._set |= 0x4;
623 if (readFontProps( this, aStyle ))
624 aStyle._set |= 0x8;
625 if (aStyle._set)
627 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
628 all_styles->getStyleId( aStyle ) );
631 // collect elements
632 readDefaults();
633 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
634 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
635 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("URL") ),
636 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":url") ) );
637 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Description") ),
638 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":description") ) );
639 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
640 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
641 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ),
642 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) );
643 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
644 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) );
645 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
646 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
647 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("NoLabel") ),
648 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":nolabel") ) );
649 readEvents();
651 //__________________________________________________________________________________________________
652 void ElementDescriptor::readEditModel( StyleBag * all_styles )
653 SAL_THROW( (Exception) )
655 // collect styles
656 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
657 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
658 aStyle._set |= 0x1;
659 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
660 aStyle._set |= 0x2;
661 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
662 aStyle._set |= 0x20;
663 if (readBorderProps( this, aStyle ))
664 aStyle._set |= 0x4;
665 if (readFontProps( this, aStyle ))
666 aStyle._set |= 0x8;
667 if (aStyle._set)
669 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
670 all_styles->getStyleId( aStyle ) );
673 // collect elements
674 readDefaults();
675 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
676 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
677 readBoolAttr( OUSTR("HideInactiveSelection"),
678 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
679 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
680 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
681 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HardLineBreaks") ),
682 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":hard-linebreaks") ) );
683 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HScroll") ),
684 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":hscroll") ) );
685 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VScroll") ),
686 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":vscroll") ) );
687 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
688 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) );
689 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ),
690 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) );
691 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
692 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
693 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
694 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
695 readLineEndFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineEndFormat") ),
696 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":lineend-format") ) );
697 sal_Int16 nEcho = 0;
698 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EchoChar") ) ) >>= nEcho)
700 sal_Unicode cEcho = (sal_Unicode)nEcho;
701 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":echochar") ),
702 OUString( &cEcho, 1 ) );
704 readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") );
705 readEvents();
707 //__________________________________________________________________________________________________
708 void ElementDescriptor::readImageControlModel( StyleBag * all_styles )
709 SAL_THROW( (Exception) )
711 // collect styles
712 Style aStyle( 0x1 | 0x4 );
713 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
714 aStyle._set |= 0x1;
715 if (readBorderProps( this, aStyle ))
716 aStyle._set |= 0x4;
717 if (aStyle._set)
719 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
720 all_styles->getStyleId( aStyle ) );
723 // collect elements
724 readDefaults();
725 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleImage") ),
726 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scale-image") ) );
727 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
728 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
729 readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
730 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":src") ) );
731 readEvents();
733 //__________________________________________________________________________________________________
734 void ElementDescriptor::readFileControlModel( StyleBag * all_styles )
735 SAL_THROW( (Exception) )
737 // collect styles
738 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
739 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
740 aStyle._set |= 0x1;
741 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
742 aStyle._set |= 0x2;
743 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
744 aStyle._set |= 0x20;
745 if (readBorderProps( this, aStyle ))
746 aStyle._set |= 0x4;
747 if (readFontProps( this, aStyle ))
748 aStyle._set |= 0x8;
749 if (aStyle._set)
751 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
752 all_styles->getStyleId( aStyle ) );
755 // collect elements
756 readDefaults();
757 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
758 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
759 readBoolAttr( OUSTR("HideInactiveSelection"),
760 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
761 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
762 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
763 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
764 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
765 readEvents();
767 //__________________________________________________________________________________________________
768 void ElementDescriptor::readTreeControlModel( StyleBag * all_styles )
769 SAL_THROW( (Exception) )
771 // collect styles
772 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
773 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
774 aStyle._set |= 0x1;
775 if (readBorderProps( this, aStyle ))
776 aStyle._set |= 0x4;
777 if (aStyle._set)
779 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
780 all_styles->getStyleId( aStyle ) );
783 // collect elements
784 readDefaults();
785 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
786 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
787 readSelectionTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectionType") ),
788 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selectiontype") ) );
790 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("RootDisplayed") ),
791 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":rootdisplayed") ) );
792 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowsHandles") ),
793 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":showshandles") ) );
794 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowsRootHandles") ),
795 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":showsroothandles") ) );
796 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Editable") ),
797 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":editable") ) );
798 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("InvokesStopNodeEditing") ),
799 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":invokesstopnodeediting") ) );
800 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("RowHeight") ),
801 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":rowheight") ) );
802 readEvents();
804 //__________________________________________________________________________________________________
805 void ElementDescriptor::readCurrencyFieldModel( StyleBag * all_styles )
806 SAL_THROW( (Exception) )
808 // collect styles
809 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
810 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
811 aStyle._set |= 0x1;
812 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
813 aStyle._set |= 0x2;
814 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
815 aStyle._set |= 0x20;
816 if (readBorderProps( this, aStyle ))
817 aStyle._set |= 0x4;
818 if (readFontProps( this, aStyle ))
819 aStyle._set |= 0x8;
820 if (aStyle._set)
822 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
823 all_styles->getStyleId( aStyle ) );
826 // collect elements
827 readDefaults();
828 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
829 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
830 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
831 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
832 readBoolAttr( OUSTR("HideInactiveSelection"),
833 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
834 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
835 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) );
836 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("CurrencySymbol") ),
837 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":currency-symbol") ) );
838 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy") ),
839 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":decimal-accuracy") ) );
840 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowThousandsSeparator") ),
841 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":thousands-separator") ) );
842 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Value") ),
843 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
844 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMin") ),
845 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) );
846 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMax") ),
847 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) );
848 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueStep") ),
849 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-step") ) );
850 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
851 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
852 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) ))
853 readLongAttr( OUSTR("RepeatDelay"),
854 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ );
855 readBoolAttr(
856 OUString( RTL_CONSTASCII_USTRINGPARAM("PrependCurrencySymbol") ),
857 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":prepend-symbol") ) );
858 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
859 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) );
860 readEvents();
862 //__________________________________________________________________________________________________
863 void ElementDescriptor::readDateFieldModel( StyleBag * all_styles )
864 SAL_THROW( (Exception) )
866 // collect styles
867 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
868 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
869 aStyle._set |= 0x1;
870 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
871 aStyle._set |= 0x2;
872 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
873 aStyle._set |= 0x20;
874 if (readBorderProps( this, aStyle ))
875 aStyle._set |= 0x4;
876 if (readFontProps( this, aStyle ))
877 aStyle._set |= 0x8;
878 if (aStyle._set)
880 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
881 all_styles->getStyleId( aStyle ) );
884 // collect elements
885 readDefaults();
886 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
887 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
888 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
889 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
890 readBoolAttr( OUSTR("HideInactiveSelection"),
891 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
892 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
893 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) );
894 readDateFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateFormat") ),
895 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":date-format") ) );
896 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateShowCentury") ),
897 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":show-century") ) );
898 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Date") ),
899 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
900 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateMin") ),
901 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) );
902 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateMax") ),
903 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) );
904 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
905 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
906 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) ))
907 readLongAttr( OUSTR("RepeatDelay"),
908 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ );
909 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ),
910 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":dropdown") ) );
911 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
912 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) );
913 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
914 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) );
915 readEvents();
917 //__________________________________________________________________________________________________
918 void ElementDescriptor::readNumericFieldModel( StyleBag * all_styles )
919 SAL_THROW( (Exception) )
921 // collect styles
922 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
923 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
924 aStyle._set |= 0x1;
925 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
926 aStyle._set |= 0x2;
927 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
928 aStyle._set |= 0x20;
929 if (readBorderProps( this, aStyle ))
930 aStyle._set |= 0x4;
931 if (readFontProps( this, aStyle ))
932 aStyle._set |= 0x8;
933 if (aStyle._set)
935 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
936 all_styles->getStyleId( aStyle ) );
939 // collect elements
940 readDefaults();
941 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
942 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
943 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
944 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
945 readBoolAttr( OUSTR("HideInactiveSelection"),
946 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
947 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
948 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) );
949 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy") ),
950 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":decimal-accuracy") ) );
951 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowThousandsSeparator") ),
952 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":thousands-separator") ) );
953 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Value") ),
954 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
955 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMin") ),
956 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) );
957 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMax") ),
958 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) );
959 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueStep") ),
960 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-step") ) );
961 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
962 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
963 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) ))
964 readLongAttr( OUSTR("RepeatDelay"),
965 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ );
966 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
967 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) );
968 readEvents();
970 //__________________________________________________________________________________________________
971 void ElementDescriptor::readTimeFieldModel( StyleBag * all_styles )
972 SAL_THROW( (Exception) )
974 // collect styles
975 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
976 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
977 aStyle._set |= 0x1;
978 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
979 aStyle._set |= 0x2;
980 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
981 aStyle._set |= 0x20;
982 if (readBorderProps( this, aStyle ))
983 aStyle._set |= 0x4;
984 if (readFontProps( this, aStyle ))
985 aStyle._set |= 0x8;
986 if (aStyle._set)
988 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
989 all_styles->getStyleId( aStyle ) );
992 // collect elements
993 readDefaults();
994 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
995 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
996 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
997 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
998 readBoolAttr( OUSTR("HideInactiveSelection"),
999 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
1000 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
1001 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) );
1002 readTimeFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeFormat") ),
1003 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":time-format") ) );
1004 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Time") ),
1005 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
1006 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeMin") ),
1007 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) );
1008 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeMax") ),
1009 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) );
1010 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
1011 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
1012 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) ))
1013 readLongAttr( OUSTR("RepeatDelay"),
1014 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ );
1015 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
1016 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) );
1017 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
1018 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) );
1019 readEvents();
1021 //__________________________________________________________________________________________________
1022 void ElementDescriptor::readPatternFieldModel( StyleBag * all_styles )
1023 SAL_THROW( (Exception) )
1025 // collect styles
1026 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1027 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
1028 aStyle._set |= 0x1;
1029 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
1030 aStyle._set |= 0x2;
1031 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
1032 aStyle._set |= 0x20;
1033 if (readBorderProps( this, aStyle ))
1034 aStyle._set |= 0x4;
1035 if (readFontProps( this, aStyle ))
1036 aStyle._set |= 0x8;
1037 if (aStyle._set)
1039 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1040 all_styles->getStyleId( aStyle ) );
1043 // collect elements
1044 readDefaults();
1045 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1046 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
1047 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
1048 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
1049 readBoolAttr( OUSTR("HideInactiveSelection"),
1050 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
1051 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
1052 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) );
1053 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
1054 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
1055 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
1056 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) );
1057 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EditMask") ),
1058 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":edit-mask") ) );
1059 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LiteralMask") ),
1060 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":literal-mask") ) );
1061 readEvents();
1063 //__________________________________________________________________________________________________
1064 void ElementDescriptor::readFormattedFieldModel( StyleBag * all_styles )
1065 SAL_THROW( (Exception) )
1067 // collect styles
1068 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1069 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
1070 aStyle._set |= 0x1;
1071 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
1072 aStyle._set |= 0x2;
1073 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
1074 aStyle._set |= 0x20;
1075 if (readBorderProps( this, aStyle ))
1076 aStyle._set |= 0x4;
1077 if (readFontProps( this, aStyle ))
1078 aStyle._set |= 0x8;
1079 if (aStyle._set)
1081 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1082 all_styles->getStyleId( aStyle ) );
1085 // collect elements
1086 readDefaults();
1087 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1088 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
1089 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ),
1090 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) );
1091 readBoolAttr( OUSTR("HideInactiveSelection"),
1092 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") );
1093 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ),
1094 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) );
1095 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ),
1096 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) );
1097 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
1098 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
1099 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ),
1100 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) );
1101 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ),
1102 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) );
1103 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) ))
1104 readLongAttr( OUSTR("RepeatDelay"),
1105 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ );
1107 Any a( readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveDefault") ) ) );
1108 switch (a.getValueTypeClass())
1110 case TypeClass_DOUBLE:
1111 addAttribute(
1112 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-default") ),
1113 OUString::valueOf( *(double const *)a.getValue() ) );
1114 break;
1115 case TypeClass_STRING:
1116 addAttribute(
1117 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-default") ),
1118 *(OUString const *)a.getValue() );
1119 break;
1120 default:
1121 break;
1123 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveMin") ),
1124 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) );
1125 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveMax") ),
1126 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) );
1127 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveValue") ),
1128 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
1130 // format spec
1131 sal_Int32 nKey = 0;
1132 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FormatKey") ) ) >>= nKey)
1134 Reference< util::XNumberFormatsSupplier > xSupplier;
1135 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FormatsSupplier") ) ) >>= xSupplier)
1137 addNumberFormatAttr(
1138 xSupplier->getNumberFormats()->getByKey( nKey ) );
1141 readBoolAttr(
1142 OUString( RTL_CONSTASCII_USTRINGPARAM("TreatAsNumber") ),
1143 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":treat-as-number") ) );
1144 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ),
1145 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) );
1147 readEvents();
1150 void ElementDescriptor::readSpinButtonModel( StyleBag * all_styles )
1151 SAL_THROW( (Exception) )
1153 // collect styles
1154 Style aStyle( 0x1 | 0x4 );
1155 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
1156 aStyle._set |= 0x1;
1157 if (readBorderProps( this, aStyle ))
1158 aStyle._set |= 0x4;
1159 if (aStyle._set)
1161 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1162 all_styles->getStyleId( aStyle ) );
1165 // collect elements
1166 readDefaults();
1167 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
1168 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
1169 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinIncrement") ),
1170 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":increment") ) );
1171 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValue") ),
1172 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":curval") ) );
1173 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") ),
1174 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxval") ) );
1175 readLongAttr( OUSTR("SpinValueMin"),
1176 OUSTR(XMLNS_DIALOGS_PREFIX ":minval") );
1177 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Repeat") ),
1178 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":repeat") ) );
1179 readLongAttr( OUSTR("RepeatDelay"), OUSTR(XMLNS_DIALOGS_PREFIX ":repeat-delay") );
1180 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1181 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
1182 readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
1183 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":symbol-color") ) );
1184 readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") );
1185 readEvents();
1188 //__________________________________________________________________________________________________
1189 void ElementDescriptor::readFixedLineModel( StyleBag * all_styles )
1190 SAL_THROW( (Exception) )
1192 // collect styles
1193 Style aStyle( 0x2 | 0x8 | 0x20 );
1194 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
1195 aStyle._set |= 0x2;
1196 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
1197 aStyle._set |= 0x20;
1198 if (readFontProps( this, aStyle ))
1199 aStyle._set |= 0x8;
1200 if (aStyle._set)
1202 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1203 all_styles->getStyleId( aStyle ) );
1206 // collect elements
1207 readDefaults();
1208 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ),
1209 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
1210 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
1211 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
1212 readEvents();
1214 //__________________________________________________________________________________________________
1215 void ElementDescriptor::readProgressBarModel( StyleBag * all_styles )
1216 SAL_THROW( (Exception) )
1218 // collect styles
1219 Style aStyle( 0x1 | 0x4 | 0x10 );
1220 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
1221 aStyle._set |= 0x1;
1222 if (readBorderProps( this, aStyle ))
1223 aStyle._set |= 0x4;
1224 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ) ) >>= aStyle._descr)
1225 aStyle._set |= 0x10;
1226 if (aStyle._set)
1228 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1229 all_styles->getStyleId( aStyle ) );
1232 // collect elements
1233 readDefaults();
1234 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ),
1235 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) );
1236 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMin") ),
1237 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) );
1238 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ),
1239 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) );
1240 readEvents();
1242 //__________________________________________________________________________________________________
1243 void ElementDescriptor::readScrollBarModel( StyleBag * all_styles )
1244 SAL_THROW( (Exception) )
1246 // collect styles
1247 Style aStyle( 0x1 | 0x4 );
1248 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
1249 aStyle._set |= 0x1;
1250 if (readBorderProps( this, aStyle ))
1251 aStyle._set |= 0x4;
1252 if (aStyle._set)
1254 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1255 all_styles->getStyleId( aStyle ) );
1258 // collect elements
1259 readDefaults();
1260 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
1261 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
1262 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") ),
1263 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":pageincrement") ) );
1264 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") ),
1265 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":increment") ) );
1266 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") ),
1267 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":curpos") ) );
1268 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") ),
1269 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxpos") ) );
1270 readLongAttr( OUSTR("ScrollValueMin"),
1271 OUSTR(XMLNS_DIALOGS_PREFIX ":minpos") );
1272 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VisibleSize") ),
1273 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":visible-size") ) );
1274 readLongAttr( OUSTR("RepeatDelay"), OUSTR(XMLNS_DIALOGS_PREFIX ":repeat") );
1275 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
1276 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
1277 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LiveScroll") ),
1278 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":live-scroll") ) );
1279 readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
1280 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":symbol-color") ) );
1281 readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") );
1282 readEvents();
1284 //__________________________________________________________________________________________________
1285 void ElementDescriptor::readDialogModel( StyleBag * all_styles )
1286 SAL_THROW( (Exception) )
1288 // collect elements
1289 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX) ),
1290 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ) );
1291 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_SCRIPT_PREFIX) ),
1292 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_URI) ) );
1294 // collect styles
1295 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
1296 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
1297 aStyle._set |= 0x1;
1298 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor)
1299 aStyle._set |= 0x2;
1300 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor)
1301 aStyle._set |= 0x20;
1302 if (readFontProps( this, aStyle ))
1303 aStyle._set |= 0x8;
1304 if (aStyle._set)
1306 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
1307 all_styles->getStyleId( aStyle ) );
1310 // collect elements
1311 readDefaults( false, false );
1312 readBoolAttr(
1313 OUString( RTL_CONSTASCII_USTRINGPARAM("Closeable") ),
1314 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":closeable") ) );
1315 readBoolAttr(
1316 OUString( RTL_CONSTASCII_USTRINGPARAM("Moveable") ),
1317 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":moveable") ) );
1318 readBoolAttr(
1319 OUString( RTL_CONSTASCII_USTRINGPARAM("Sizeable") ),
1320 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":resizeable") ) );
1321 readStringAttr(
1322 OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ),
1323 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) );
1325 Any aDecorationAny( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ) ) );
1326 bool bDecoration = sal_False;
1327 if ( (aDecorationAny >>= bDecoration) && !bDecoration )
1328 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":withtitlebar") ),
1329 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) );
1330 readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ),
1331 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) );
1332 readEvents();
1335 void ElementDescriptor::readBullitinBoard( StyleBag * all_styles )
1336 SAL_THROW( (Exception) )
1338 // collect elements
1339 ::std::vector< ElementDescriptor* > all_elements;
1340 // read out all props
1341 Reference< container::XNameContainer > xDialogModel( _xProps, UNO_QUERY );
1342 if ( !xDialogModel.is() )
1343 return; // #TODO throw???
1344 Sequence< OUString > aElements( xDialogModel->getElementNames() );
1345 OUString const * pElements = aElements.getConstArray();
1347 ElementDescriptor * pRadioGroup = 0;
1349 sal_Int32 nPos;
1350 for ( nPos = 0; nPos < aElements.getLength(); ++nPos )
1352 Any aControlModel( xDialogModel->getByName( pElements[ nPos ] ) );
1353 Reference< beans::XPropertySet > xProps;
1354 OSL_VERIFY( aControlModel >>= xProps );
1355 if (! xProps.is())
1356 continue;
1357 Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY );
1358 OSL_ENSURE( xPropState.is(), "no XPropertyState!" );
1359 if (! xPropState.is())
1360 continue;
1361 Reference< lang::XServiceInfo > xServiceInfo( xProps, UNO_QUERY );
1362 OSL_ENSURE( xServiceInfo.is(), "no XServiceInfo!" );
1363 if (! xServiceInfo.is())
1364 continue;
1366 ElementDescriptor * pElem = 0;
1368 // group up radio buttons
1369 if ( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) )
1371 if (! pRadioGroup) // open radiogroup
1373 pRadioGroup = new ElementDescriptor(
1374 xProps, xPropState,
1375 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radiogroup") ), _xDocument );
1376 all_elements.push_back( pRadioGroup );
1379 pElem = new ElementDescriptor(
1380 xProps, xPropState,
1381 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radio") ), _xDocument );
1382 pElem->readRadioButtonModel( all_styles );
1383 pRadioGroup->addSubElement( pElem );
1385 else // no radio
1387 pRadioGroup = 0; // close radiogroup
1389 if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) )
1391 pElem = new ElementDescriptor(
1392 xProps, xPropState,
1393 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":button") ), _xDocument );
1394 pElem->readButtonModel( all_styles );
1396 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) )
1398 pElem = new ElementDescriptor(
1399 xProps, xPropState,
1400 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checkbox") ), _xDocument );
1401 pElem->readCheckBoxModel( all_styles );
1403 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) )
1405 pElem = new ElementDescriptor(
1406 xProps, xPropState,
1407 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":combobox") ), _xDocument );
1408 pElem->readComboBoxModel( all_styles );
1410 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) )
1412 pElem = new ElementDescriptor(
1413 xProps, xPropState,
1414 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menulist") ), _xDocument );
1415 pElem->readListBoxModel( all_styles );
1417 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
1419 pElem = new ElementDescriptor(
1420 xProps, xPropState,
1421 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":titledbox") ), _xDocument );
1422 pElem->readGroupBoxModel( all_styles );
1424 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) )
1426 pElem = new ElementDescriptor(
1427 xProps, xPropState,
1428 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multipage") ), _xDocument );
1429 pElem->readMultiPageModel( all_styles );
1431 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ) )
1433 pElem = new ElementDescriptor(
1434 xProps, xPropState,
1435 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":frame") ), _xDocument );
1436 pElem->readFrameModel( all_styles );
1438 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoPageModel") ) ) )
1440 pElem = new ElementDescriptor(
1441 xProps, xPropState,
1442 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":page") ), _xDocument );
1443 pElem->readPageModel( all_styles );
1445 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) )
1447 pElem = new ElementDescriptor(
1448 xProps, xPropState,
1449 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ), _xDocument );
1450 pElem->readFixedTextModel( all_styles );
1452 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) )
1454 pElem = new ElementDescriptor(
1455 xProps, xPropState,
1456 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":textfield") ), _xDocument );
1457 pElem->readEditModel( all_styles );
1459 // FixedHyperLink
1460 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedHyperlinkModel") ) ) )
1462 pElem = new ElementDescriptor(
1463 xProps, xPropState,
1464 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linklabel") ), _xDocument );
1465 pElem->readFixedHyperLinkModel( all_styles );
1467 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) )
1469 pElem = new ElementDescriptor(
1470 xProps, xPropState,
1471 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":img") ), _xDocument );
1472 pElem->readImageControlModel( all_styles );
1474 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFileControlModel") ) ) )
1476 pElem = new ElementDescriptor(
1477 xProps, xPropState,
1478 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":filecontrol") ), _xDocument );
1479 pElem->readFileControlModel( all_styles );
1481 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.TreeControlModel") ) ) )
1483 pElem = new ElementDescriptor(
1484 xProps, xPropState,
1485 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":treecontrol") ), _xDocument );
1486 pElem->readTreeControlModel( all_styles );
1488 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCurrencyFieldModel") ) ) )
1490 pElem = new ElementDescriptor(
1491 xProps, xPropState,
1492 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":currencyfield") ), _xDocument );
1493 pElem->readCurrencyFieldModel( all_styles );
1495 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDateFieldModel") ) ) )
1497 pElem = new ElementDescriptor(
1498 xProps, xPropState,
1499 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":datefield") ), _xDocument );
1500 pElem->readDateFieldModel( all_styles );
1502 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlNumericFieldModel") ) ) )
1504 pElem = new ElementDescriptor(
1505 xProps, xPropState,
1506 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":numericfield") ), _xDocument );
1507 pElem->readNumericFieldModel( all_styles );
1509 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlTimeFieldModel") ) ) )
1511 pElem = new ElementDescriptor(
1512 xProps, xPropState,
1513 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":timefield") ) , _xDocument);
1514 pElem->readTimeFieldModel( all_styles );
1516 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlPatternFieldModel") ) ) )
1518 pElem = new ElementDescriptor(
1519 xProps, xPropState,
1520 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":patternfield") ), _xDocument );
1521 pElem->readPatternFieldModel( all_styles );
1523 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFormattedFieldModel") ) ) )
1525 pElem = new ElementDescriptor(
1526 xProps, xPropState,
1527 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":formattedfield") ), _xDocument );
1528 pElem->readFormattedFieldModel( all_styles );
1530 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel") ) ) )
1532 pElem = new ElementDescriptor(
1533 xProps, xPropState,
1534 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":fixedline") ), _xDocument );
1535 pElem->readFixedLineModel( all_styles );
1537 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) )
1539 pElem = new ElementDescriptor(
1540 xProps, xPropState,
1541 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scrollbar") ), _xDocument );
1542 pElem->readScrollBarModel( all_styles );
1544 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
1546 pElem = new ElementDescriptor(
1547 xProps, xPropState,
1548 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spinbutton") ), _xDocument );
1549 pElem->readSpinButtonModel( all_styles );
1551 else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
1553 pElem = new ElementDescriptor(
1554 xProps, xPropState,
1555 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":progressmeter") ), _xDocument );
1556 pElem->readProgressBarModel( all_styles );
1559 if (pElem)
1561 all_elements.push_back( pElem );
1563 else
1565 OSL_FAIL( "unknown control type!" );
1566 continue;
1570 if (! all_elements.empty())
1572 for ( std::size_t n = 0; n < all_elements.size(); ++n )
1574 addSubElement( all_elements[ n ] );
1581 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */