1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "exp_share.hxx"
22 #include <com/sun/star/form/binding/XListEntrySink.hpp>
23 #include <com/sun/star/form/binding/XBindableValue.hpp>
24 #include <com/sun/star/form/binding/XValueBinding.hpp>
25 #include <com/sun/star/table/CellAddress.hpp>
26 #include <com/sun/star/table/CellRangeAddress.hpp>
27 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
28 #include <com/sun/star/document/XStorageBasedDocument.hpp>
29 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
32 using namespace ::com::sun::star
;
33 using namespace ::com::sun::star::uno
;
38 static inline bool readBorderProps(
39 ElementDescriptor
* element
, Style
& style
)
41 if (element
->readProp( &style
._border
, "Border" )) {
42 if (style
._border
== BORDER_SIMPLE
/* simple */)
44 if (element
->readProp( &style
._borderColor
, "BorderColor" ))
45 style
._border
= BORDER_SIMPLE_COLOR
;
52 static inline bool readFontProps( ElementDescriptor
* element
, Style
& style
)
54 bool ret
= element
->readProp(
55 &style
._descr
, "FontDescriptor" );
56 ret
|= element
->readProp(
57 &style
._fontEmphasisMark
, "FontEmphasisMark" );
58 ret
|= element
->readProp(
59 &style
._fontRelief
, "FontRelief" );
63 void ElementDescriptor::readMultiPageModel( StyleBag
* all_styles
)
66 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
67 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
69 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
71 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
73 if (readFontProps( this, aStyle
))
77 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id" , all_styles
->getStyleId( aStyle
) );
82 readLongAttr( "MultiPageValue", XMLNS_DIALOGS_PREFIX
":value" );
83 Any
aDecorationAny( _xProps
->getPropertyValue( "Decoration" ) );
84 bool bDecoration
= true;
85 if ( (aDecorationAny
>>= bDecoration
) && !bDecoration
)
86 addAttribute( XMLNS_DIALOGS_PREFIX
":withtabs", "false" );
89 uno::Reference
< container::XNameContainer
> xPagesContainer( _xProps
, uno::UNO_QUERY
);
90 if ( xPagesContainer
.is() && xPagesContainer
->getElementNames().getLength() )
92 ElementDescriptor
* pElem
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":bulletinboard", _xDocument
);
93 pElem
->readBullitinBoard( all_styles
);
94 addSubElement( pElem
);
98 void ElementDescriptor::readFrameModel( StyleBag
* all_styles
)
101 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
103 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
105 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
107 if (readFontProps( this, aStyle
))
111 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
118 if ( readProp( "Label" ) >>= aTitle
)
120 ElementDescriptor
* title
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":title", _xDocument
);
121 title
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", aTitle
);
122 addSubElement( title
);
124 uno::Reference
< container::XNameContainer
> xControlContainer( _xProps
, uno::UNO_QUERY
);
125 if ( xControlContainer
.is() && xControlContainer
->getElementNames().getLength() )
127 ElementDescriptor
* pElem
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":bulletinboard", _xDocument
);
128 pElem
->readBullitinBoard( all_styles
);
129 addSubElement( pElem
);
134 void ElementDescriptor::readPageModel( StyleBag
* all_styles
)
137 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
138 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
140 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
142 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
144 if (readFontProps( this, aStyle
))
148 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
153 readStringAttr( "Title", XMLNS_DIALOGS_PREFIX
":title" );
154 uno::Reference
< container::XNameContainer
> xControlContainer( _xProps
, uno::UNO_QUERY
);
155 if ( xControlContainer
.is() && xControlContainer
->getElementNames().getLength() )
157 ElementDescriptor
* pElem
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":bulletinboard", _xDocument
);
158 pElem
->readBullitinBoard( all_styles
);
159 addSubElement( pElem
);
164 void ElementDescriptor::readButtonModel( StyleBag
* all_styles
)
167 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
168 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
170 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
172 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
174 if (readFontProps( this, aStyle
))
178 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
183 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
184 readBoolAttr( "DefaultButton", XMLNS_DIALOGS_PREFIX
":default" );
185 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
186 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
187 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
188 readButtonTypeAttr( "PushButtonType", XMLNS_DIALOGS_PREFIX
":button-type" );
189 readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX
":image-src" );
191 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX
":image-position" );
192 readImageAlignAttr( "ImageAlign", XMLNS_DIALOGS_PREFIX
":image-align" );
194 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
195 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
197 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Toggle" ) ))
198 addAttribute( XMLNS_DIALOGS_PREFIX
":toggled", "1" );
200 readBoolAttr( "FocusOnClick", XMLNS_DIALOGS_PREFIX
":grab-focus" );
201 readBoolAttr( "MultiLine",XMLNS_DIALOGS_PREFIX
":multiline" );
204 sal_Int16 nState
= 0;
205 if (readProp( "State" ) >>= nState
)
210 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "false" );
213 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "true" );
216 OSL_FAIL( "### unexpected radio state!" );
224 void ElementDescriptor::readCheckBoxModel( StyleBag
* all_styles
)
227 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
228 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
230 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
232 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
234 if (readFontProps( this, aStyle
))
236 if (readProp( "VisualEffect" ) >>= aStyle
._visualEffect
)
240 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
245 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
246 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
247 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
248 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
249 readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX
":image-src" );
250 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX
":image-position" );
251 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
253 bool bTriState
= false;
254 if ((readProp( "TriState" ) >>= bTriState
) && bTriState
)
256 addAttribute( XMLNS_DIALOGS_PREFIX
":tristate", "true" );
258 sal_Int16 nState
= 0;
259 if (_xProps
->getPropertyValue( "State" ) >>= nState
)
264 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "false" );
267 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "true" );
269 case 2: // tristate=true exported, checked omitted => dont know!
270 OSL_ENSURE( bTriState
, "### detected tristate value, but TriState is not set!" );
273 OSL_FAIL( "### unexpected checkbox state!" );
280 void ElementDescriptor::readComboBoxModel( StyleBag
* all_styles
)
283 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
284 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
286 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
288 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
290 if (readBorderProps( this, aStyle
))
292 if (readFontProps( this, aStyle
))
296 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
301 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
302 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
303 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
304 readBoolAttr( "Autocomplete", XMLNS_DIALOGS_PREFIX
":autocomplete" );
305 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
306 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
307 readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX
":spin" );
308 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
309 readShortAttr( "LineCount", XMLNS_DIALOGS_PREFIX
":linecount" );
310 // Cell Range, Ref Cell etc.
311 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
312 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":source-cell-range" );
315 Sequence
< OUString
> itemValues
;
316 if ((readProp( "StringItemList" ) >>= itemValues
) && itemValues
.getLength() > 0)
318 ElementDescriptor
* popup
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menupopup", _xDocument
);
320 OUString
const * pItemValues
= itemValues
.getConstArray();
321 for ( sal_Int32 nPos
= 0; nPos
< itemValues
.getLength(); ++nPos
)
323 ElementDescriptor
* item
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menuitem", _xDocument
);
324 item
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", pItemValues
[ nPos
] );
325 popup
->addSubElement( item
);
328 addSubElement( popup
);
333 void ElementDescriptor::readListBoxModel( StyleBag
* all_styles
)
336 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
337 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
339 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
341 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
343 if (readBorderProps( this, aStyle
))
345 if (readFontProps( this, aStyle
))
349 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
354 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
355 readBoolAttr( "MultiSelection", XMLNS_DIALOGS_PREFIX
":multiselection" );
356 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
357 readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX
":spin" );
358 readShortAttr( "LineCount", XMLNS_DIALOGS_PREFIX
":linecount" );
359 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
360 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
361 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":source-cell-range" );
363 Sequence
< OUString
> itemValues
;
364 if ((readProp( "StringItemList" ) >>= itemValues
) && itemValues
.getLength() > 0)
366 ElementDescriptor
* popup
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menupopup", _xDocument
);
368 OUString
const * pItemValues
= itemValues
.getConstArray();
370 for ( nPos
= 0; nPos
< itemValues
.getLength(); ++nPos
)
372 ElementDescriptor
* item
= new ElementDescriptor(_xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menuitem", _xDocument
);
373 item
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", pItemValues
[ nPos
] );
374 popup
->addSubElement( item
);
377 Sequence
< sal_Int16
> selected
;
378 if (readProp( "SelectedItems" ) >>= selected
)
380 sal_Int16
const * pSelected
= selected
.getConstArray();
381 for ( nPos
= selected
.getLength(); nPos
--; )
383 ElementDescriptor
* item
= static_cast< ElementDescriptor
* >(
384 popup
->getSubElement( pSelected
[ nPos
] ).get() );
385 item
->addAttribute( XMLNS_DIALOGS_PREFIX
":selected", "true" );
389 addSubElement( popup
);
394 void ElementDescriptor::readRadioButtonModel( StyleBag
* all_styles
)
397 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
398 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
400 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
402 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
404 if (readFontProps( this, aStyle
))
406 if (readProp( "VisualEffect" ) >>= aStyle
._visualEffect
)
410 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id" , all_styles
->getStyleId( aStyle
) );
415 readBoolAttr("Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
416 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
417 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
418 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
419 readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX
":image-src" );
420 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX
":image-position" );
421 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
422 readStringAttr( "GroupName", XMLNS_DIALOGS_PREFIX
":group-name" );
424 sal_Int16 nState
= 0;
425 if (readProp( "State" ) >>= nState
)
430 addAttribute(XMLNS_DIALOGS_PREFIX
":checked", "false" );
433 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "true" );
436 OSL_FAIL( "### unexpected radio state!" );
440 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
444 void ElementDescriptor::readGroupBoxModel( StyleBag
* all_styles
)
447 Style
aStyle( 0x2 | 0x8 | 0x20 );
448 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
450 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
452 if (readFontProps( this, aStyle
))
456 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
463 if (readProp( "Label" ) >>= aTitle
)
465 ElementDescriptor
* title
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":title", _xDocument
);
466 title
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", aTitle
);
467 addSubElement( title
);
473 void ElementDescriptor::readFixedTextModel( StyleBag
* all_styles
)
476 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
477 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
479 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
481 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
483 if (readBorderProps( this, aStyle
))
485 if (readFontProps( this, aStyle
))
489 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
494 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
495 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
496 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
497 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
498 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
499 readBoolAttr( "NoLabel", XMLNS_DIALOGS_PREFIX
":nolabel" );
503 void ElementDescriptor::readFixedHyperLinkModel( StyleBag
* all_styles
)
506 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
507 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
509 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
511 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
513 if (readBorderProps( this, aStyle
))
515 if (readFontProps( this, aStyle
))
519 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
524 readStringAttr( "Label",XMLNS_DIALOGS_PREFIX
":value" );
525 readStringAttr( "URL", XMLNS_DIALOGS_PREFIX
":url" );
526 readStringAttr( "Description", XMLNS_DIALOGS_PREFIX
":description" );
527 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
528 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
529 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
530 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
531 readBoolAttr( "NoLabel", XMLNS_DIALOGS_PREFIX
":nolabel" );
535 void ElementDescriptor::readEditModel( StyleBag
* all_styles
)
538 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
539 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
541 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
543 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
545 if (readBorderProps( this, aStyle
))
547 if (readFontProps( this, aStyle
))
551 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
556 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
557 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
558 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
559 readBoolAttr( "HardLineBreaks", XMLNS_DIALOGS_PREFIX
":hard-linebreaks" );
560 readBoolAttr( "HScroll", XMLNS_DIALOGS_PREFIX
":hscroll" );
561 readBoolAttr( "VScroll", XMLNS_DIALOGS_PREFIX
":vscroll" );
562 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
563 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
564 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
565 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
566 readLineEndFormatAttr( "LineEndFormat", XMLNS_DIALOGS_PREFIX
":lineend-format" );
568 if (readProp( "EchoChar" ) >>= nEcho
)
570 sal_Unicode cEcho
= (sal_Unicode
)nEcho
;
571 addAttribute( XMLNS_DIALOGS_PREFIX
":echochar", OUString( &cEcho
, 1 ) );
573 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
577 void ElementDescriptor::readImageControlModel( StyleBag
* all_styles
)
580 Style
aStyle( 0x1 | 0x4 );
581 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
583 if (readBorderProps( this, aStyle
))
587 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
592 readBoolAttr( "ScaleImage", XMLNS_DIALOGS_PREFIX
":scale-image" );
593 readImageScaleModeAttr( "ScaleMode", XMLNS_DIALOGS_PREFIX
":scale-mode" );
594 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
595 readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX
":src" );
599 void ElementDescriptor::readFileControlModel( StyleBag
* all_styles
)
602 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
603 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
605 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
607 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
609 if (readBorderProps( this, aStyle
))
611 if (readFontProps( this, aStyle
))
615 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
620 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
621 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
622 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
623 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
627 void ElementDescriptor::readTreeControlModel( StyleBag
* all_styles
)
630 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
631 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
633 if (readBorderProps( this, aStyle
))
637 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
642 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
643 readSelectionTypeAttr( "SelectionType", XMLNS_DIALOGS_PREFIX
":selectiontype" );
645 readBoolAttr( "RootDisplayed", XMLNS_DIALOGS_PREFIX
":rootdisplayed" );
646 readBoolAttr( "ShowsHandles", XMLNS_DIALOGS_PREFIX
":showshandles" );
647 readBoolAttr( "ShowsRootHandles", XMLNS_DIALOGS_PREFIX
":showsroothandles" );
648 readBoolAttr( "Editable", XMLNS_DIALOGS_PREFIX
":editable" );
649 readBoolAttr( "InvokesStopNodeEditing", XMLNS_DIALOGS_PREFIX
":invokesstopnodeediting" );
650 readLongAttr( "RowHeight", XMLNS_DIALOGS_PREFIX
":rowheight" );
654 void ElementDescriptor::readCurrencyFieldModel( StyleBag
* all_styles
)
657 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
658 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
660 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
662 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
664 if (readBorderProps( this, aStyle
))
666 if (readFontProps( this, aStyle
))
670 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
675 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
676 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
677 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
678 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
679 readStringAttr( "CurrencySymbol", XMLNS_DIALOGS_PREFIX
":currency-symbol" );
680 readShortAttr( "DecimalAccuracy", XMLNS_DIALOGS_PREFIX
":decimal-accuracy" );
681 readBoolAttr( "ShowThousandsSeparator", XMLNS_DIALOGS_PREFIX
":thousands-separator" );
682 readDoubleAttr( "Value", XMLNS_DIALOGS_PREFIX
":value" );
683 readDoubleAttr( "ValueMin", XMLNS_DIALOGS_PREFIX
":value-min" );
684 readDoubleAttr( "ValueMax", XMLNS_DIALOGS_PREFIX
":value-max" );
685 readDoubleAttr( "ValueStep", XMLNS_DIALOGS_PREFIX
":value-step" );
686 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
687 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
688 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
689 readBoolAttr("PrependCurrencySymbol", XMLNS_DIALOGS_PREFIX
":prepend-symbol" );
690 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
694 void ElementDescriptor::readDateFieldModel( StyleBag
* all_styles
)
697 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
698 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
700 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
702 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
704 if (readBorderProps( this, aStyle
))
706 if (readFontProps( this, aStyle
))
710 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
715 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
716 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
717 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
718 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
719 readDateFormatAttr( "DateFormat", XMLNS_DIALOGS_PREFIX
":date-format" );
720 readBoolAttr( "DateShowCentury", XMLNS_DIALOGS_PREFIX
":show-century" );
721 readDateAttr( "Date", XMLNS_DIALOGS_PREFIX
":value" );
722 readDateAttr( "DateMin", XMLNS_DIALOGS_PREFIX
":value-min" );
723 readDateAttr( "DateMax", XMLNS_DIALOGS_PREFIX
":value-max" );
724 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
725 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
726 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
727 readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX
":dropdown" );
728 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":text" );
729 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
733 void ElementDescriptor::readNumericFieldModel( StyleBag
* all_styles
)
736 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
737 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
739 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
741 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
743 if (readBorderProps( this, aStyle
))
745 if (readFontProps( this, aStyle
))
749 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
754 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
755 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
756 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
757 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
758 readShortAttr( "DecimalAccuracy", XMLNS_DIALOGS_PREFIX
":decimal-accuracy" );
759 readBoolAttr( "ShowThousandsSeparator", XMLNS_DIALOGS_PREFIX
":thousands-separator" );
760 readDoubleAttr( "Value", XMLNS_DIALOGS_PREFIX
":value" );
761 readDoubleAttr( "ValueMin", XMLNS_DIALOGS_PREFIX
":value-min" );
762 readDoubleAttr( "ValueMax", XMLNS_DIALOGS_PREFIX
":value-max" );
763 readDoubleAttr( "ValueStep", XMLNS_DIALOGS_PREFIX
":value-step" );
764 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
765 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
766 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
767 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
771 void ElementDescriptor::readTimeFieldModel( StyleBag
* all_styles
)
774 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
775 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
777 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
779 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
781 if (readBorderProps( this, aStyle
))
783 if (readFontProps( this, aStyle
))
787 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
792 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop");
793 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
794 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
795 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
796 readTimeFormatAttr( "TimeFormat", XMLNS_DIALOGS_PREFIX
":time-format" );
797 readTimeAttr( "Time", XMLNS_DIALOGS_PREFIX
":value" );
798 readTimeAttr( "TimeMin", XMLNS_DIALOGS_PREFIX
":value-min" );
799 readTimeAttr( "TimeMax", XMLNS_DIALOGS_PREFIX
":value-max" );
800 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
801 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
802 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
803 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":text" );
804 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
808 void ElementDescriptor::readPatternFieldModel( StyleBag
* all_styles
)
811 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
812 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
814 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
816 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
818 if (readBorderProps( this, aStyle
))
820 if (readFontProps( this, aStyle
))
824 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
829 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
830 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
831 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
832 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
833 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
834 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
835 readStringAttr( "EditMask", XMLNS_DIALOGS_PREFIX
":edit-mask" );
836 readStringAttr( "LiteralMask", XMLNS_DIALOGS_PREFIX
":literal-mask" );
840 void ElementDescriptor::readFormattedFieldModel( StyleBag
* all_styles
)
843 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
844 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
846 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
848 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
850 if (readBorderProps( this, aStyle
))
852 if (readFontProps( this, aStyle
))
856 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
861 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
862 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
863 readBoolAttr( "HideInactiveSelection",XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
864 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
865 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":text" );
866 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
867 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
868 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
869 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
870 readLongAttr( "RepeatDelay",XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
872 Any
a( readProp( "EffectiveDefault" ) );
873 switch (a
.getValueTypeClass())
875 case TypeClass_DOUBLE
:
876 addAttribute( XMLNS_DIALOGS_PREFIX
":value-default", OUString::number( *static_cast<double const *>(a
.getValue()) ) );
878 case TypeClass_STRING
:
879 addAttribute( XMLNS_DIALOGS_PREFIX
":value-default", *static_cast<OUString
const *>(a
.getValue()) );
884 readDoubleAttr( "EffectiveMin", XMLNS_DIALOGS_PREFIX
":value-min" );
885 readDoubleAttr( "EffectiveMax", XMLNS_DIALOGS_PREFIX
":value-max" );
886 readDoubleAttr( "EffectiveValue", XMLNS_DIALOGS_PREFIX
":value" );
890 if (readProp( "FormatKey" ) >>= nKey
)
892 Reference
< util::XNumberFormatsSupplier
> xSupplier
;
893 if (readProp( "FormatsSupplier" ) >>= xSupplier
)
896 xSupplier
->getNumberFormats()->getByKey( nKey
) );
899 readBoolAttr( "TreatAsNumber", XMLNS_DIALOGS_PREFIX
":treat-as-number" );
900 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
905 void ElementDescriptor::readSpinButtonModel( StyleBag
* all_styles
)
908 Style
aStyle( 0x1 | 0x4 );
909 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
911 if (readBorderProps( this, aStyle
))
915 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
920 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX
":align" );
921 readLongAttr( "SpinIncrement", XMLNS_DIALOGS_PREFIX
":increment" );
922 readLongAttr( "SpinValue", XMLNS_DIALOGS_PREFIX
":curval" );
923 readLongAttr( "SpinValueMax", XMLNS_DIALOGS_PREFIX
":maxval" );
924 readLongAttr( "SpinValueMin", XMLNS_DIALOGS_PREFIX
":minval" );
925 readLongAttr( "Repeat", XMLNS_DIALOGS_PREFIX
":repeat" );
926 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat-delay" );
927 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
928 readHexLongAttr( "SymbolColor", XMLNS_DIALOGS_PREFIX
":symbol-color" );
929 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
933 void ElementDescriptor::readFixedLineModel( StyleBag
* all_styles
)
936 Style
aStyle( 0x2 | 0x8 | 0x20 );
937 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
939 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
941 if (readFontProps( this, aStyle
))
945 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
950 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
951 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX
":align" );
955 void ElementDescriptor::readProgressBarModel( StyleBag
* all_styles
)
958 Style
aStyle( 0x1 | 0x4 | 0x10 );
959 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
961 if (readBorderProps( this, aStyle
))
963 if (readProp( "FillColor" ) >>= aStyle
._descr
)
967 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
972 readLongAttr( "ProgressValue", XMLNS_DIALOGS_PREFIX
":value" );
973 readLongAttr( "ProgressValueMin", XMLNS_DIALOGS_PREFIX
":value-min" );
974 readLongAttr( "ProgressValueMax", XMLNS_DIALOGS_PREFIX
":value-max" );
978 void ElementDescriptor::readScrollBarModel( StyleBag
* all_styles
)
981 Style
aStyle( 0x1 | 0x4 );
982 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
984 if (readBorderProps( this, aStyle
))
988 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
993 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX
":align" );
994 readLongAttr( "BlockIncrement", XMLNS_DIALOGS_PREFIX
":pageincrement" );
995 readLongAttr( "LineIncrement", XMLNS_DIALOGS_PREFIX
":increment" );
996 readLongAttr( "ScrollValue", XMLNS_DIALOGS_PREFIX
":curpos" );
997 readLongAttr( "ScrollValueMax", XMLNS_DIALOGS_PREFIX
":maxpos" );
998 readLongAttr( "ScrollValueMin", XMLNS_DIALOGS_PREFIX
":minpos" );
999 readLongAttr( "VisibleSize", XMLNS_DIALOGS_PREFIX
":visible-size" );
1000 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat" );
1001 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
1002 readBoolAttr( "LiveScroll", XMLNS_DIALOGS_PREFIX
":live-scroll" );
1003 readHexLongAttr( "SymbolColor", XMLNS_DIALOGS_PREFIX
":symbol-color" );
1004 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
1008 void ElementDescriptor::readDialogModel( StyleBag
* all_styles
)
1011 addAttribute( "xmlns:" XMLNS_DIALOGS_PREFIX
, XMLNS_DIALOGS_URI
);
1012 addAttribute( "xmlns:" XMLNS_SCRIPT_PREFIX
, XMLNS_SCRIPT_URI
);
1015 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
1016 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
1018 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
1020 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
1021 aStyle
._set
|= 0x20;
1022 if (readFontProps( this, aStyle
))
1026 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
1030 readDefaults( false, false );
1031 readBoolAttr("Closeable", XMLNS_DIALOGS_PREFIX
":closeable" );
1032 readBoolAttr( "Moveable", XMLNS_DIALOGS_PREFIX
":moveable" );
1033 readBoolAttr( "Sizeable", XMLNS_DIALOGS_PREFIX
":resizeable" );
1034 readStringAttr( "Title", XMLNS_DIALOGS_PREFIX
":title" );
1036 readScrollableSettings();
1037 Any
aDecorationAny( _xProps
->getPropertyValue( "Decoration" ) );
1038 bool bDecoration
= false;
1039 if ( (aDecorationAny
>>= bDecoration
) && !bDecoration
)
1040 addAttribute( XMLNS_DIALOGS_PREFIX
":withtitlebar", "false" );
1041 readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX
":image-src" );
1045 void ElementDescriptor::readBullitinBoard( StyleBag
* all_styles
)
1048 ::std::vector
< ElementDescriptor
* > all_elements
;
1049 // read out all props
1050 Reference
< container::XNameContainer
> xDialogModel( _xProps
, UNO_QUERY
);
1051 if ( !xDialogModel
.is() )
1052 return; // #TODO throw???
1053 Sequence
< OUString
> aElements( xDialogModel
->getElementNames() );
1054 OUString
const * pElements
= aElements
.getConstArray();
1056 ElementDescriptor
* pRadioGroup
= 0;
1059 for ( nPos
= 0; nPos
< aElements
.getLength(); ++nPos
)
1061 Any
aControlModel( xDialogModel
->getByName( pElements
[ nPos
] ) );
1062 Reference
< beans::XPropertySet
> xProps
;
1063 OSL_VERIFY( aControlModel
>>= xProps
);
1066 Reference
< beans::XPropertyState
> xPropState( xProps
, UNO_QUERY
);
1067 OSL_ENSURE( xPropState
.is(), "no XPropertyState!" );
1068 if (! xPropState
.is())
1070 Reference
< lang::XServiceInfo
> xServiceInfo( xProps
, UNO_QUERY
);
1071 OSL_ENSURE( xServiceInfo
.is(), "no XServiceInfo!" );
1072 if (! xServiceInfo
.is())
1075 ElementDescriptor
* pElem
= 0;
1077 // group up radio buttons
1078 if ( xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) )
1080 if (! pRadioGroup
) // open radiogroup
1082 pRadioGroup
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":radiogroup", _xDocument
);
1083 all_elements
.push_back( pRadioGroup
);
1086 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":radio", _xDocument
);
1087 pElem
->readRadioButtonModel( all_styles
);
1088 pRadioGroup
->addSubElement( pElem
);
1092 pRadioGroup
= 0; // close radiogroup
1094 if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlButtonModel" ) )
1096 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":button", _xDocument
);
1097 pElem
->readButtonModel( all_styles
);
1099 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) )
1101 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":checkbox", _xDocument
);
1102 pElem
->readCheckBoxModel( all_styles
);
1104 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlComboBoxModel" ) )
1106 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":combobox", _xDocument
);
1107 pElem
->readComboBoxModel( all_styles
);
1109 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlListBoxModel" ) )
1111 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":menulist", _xDocument
);
1112 pElem
->readListBoxModel( all_styles
);
1114 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ) )
1116 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":titledbox", _xDocument
);
1117 pElem
->readGroupBoxModel( all_styles
);
1119 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoMultiPageModel" ) )
1121 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":multipage", _xDocument
);
1122 pElem
->readMultiPageModel( all_styles
);
1124 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoFrameModel" ) )
1126 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":frame", _xDocument
);
1127 pElem
->readFrameModel( all_styles
);
1129 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoPageModel" ) )
1131 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":page", _xDocument
);
1132 pElem
->readPageModel( all_styles
);
1134 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ) )
1136 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":text", _xDocument
);
1137 pElem
->readFixedTextModel( all_styles
);
1139 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlEditModel" ) )
1141 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":textfield", _xDocument
);
1142 pElem
->readEditModel( all_styles
);
1145 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) )
1147 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":linklabel", _xDocument
);
1148 pElem
->readFixedHyperLinkModel( all_styles
);
1150 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlImageControlModel" ) )
1152 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":img", _xDocument
);
1153 pElem
->readImageControlModel( all_styles
);
1155 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFileControlModel" ) )
1157 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":filecontrol", _xDocument
);
1158 pElem
->readFileControlModel( all_styles
);
1160 else if (xServiceInfo
->supportsService( "com.sun.star.awt.tree.TreeControlModel" ) )
1162 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":treecontrol", _xDocument
);
1163 pElem
->readTreeControlModel( all_styles
);
1165 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" ) )
1167 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":currencyfield", _xDocument
);
1168 pElem
->readCurrencyFieldModel( all_styles
);
1170 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlDateFieldModel" ) )
1172 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":datefield", _xDocument
);
1173 pElem
->readDateFieldModel( all_styles
);
1175 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" ) )
1177 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":numericfield", _xDocument
);
1178 pElem
->readNumericFieldModel( all_styles
);
1180 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" ) )
1182 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":timefield", _xDocument
);
1183 pElem
->readTimeFieldModel( all_styles
);
1185 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" ) )
1187 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":patternfield", _xDocument
);
1188 pElem
->readPatternFieldModel( all_styles
);
1190 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ) )
1192 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":formattedfield", _xDocument
);
1193 pElem
->readFormattedFieldModel( all_styles
);
1195 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFixedLineModel" ) )
1197 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":fixedline", _xDocument
);
1198 pElem
->readFixedLineModel( all_styles
);
1200 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlScrollBarModel" ) )
1202 pElem
= new ElementDescriptor(xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":scrollbar", _xDocument
);
1203 pElem
->readScrollBarModel( all_styles
);
1205 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlSpinButtonModel" ) )
1207 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":spinbutton", _xDocument
);
1208 pElem
->readSpinButtonModel( all_styles
);
1210 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlProgressBarModel" ) )
1212 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":progressmeter", _xDocument
);
1213 pElem
->readProgressBarModel( all_styles
);
1218 all_elements
.push_back( pElem
);
1222 OSL_FAIL( "unknown control type!" );
1227 if (! all_elements
.empty())
1229 for ( std::size_t n
= 0; n
< all_elements
.size(); ++n
)
1231 addSubElement( all_elements
[ n
] );
1238 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */