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 .
21 #include "exp_share.hxx"
23 #include <xmlscript/xmlns.h>
25 #include <com/sun/star/container/XNameContainer.hpp>
26 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <o3tl/any.hxx>
29 #include <rtl/ref.hxx>
31 using namespace ::com::sun::star
;
32 using namespace ::com::sun::star::uno
;
37 static bool readBorderProps(
38 ElementDescriptor
* element
, Style
& style
)
40 if (element
->readProp( &style
._border
, "Border" )) {
41 if (style
._border
== BORDER_SIMPLE
/* simple */)
43 if (element
->readProp( &style
._borderColor
, "BorderColor" ))
44 style
._border
= BORDER_SIMPLE_COLOR
;
51 static bool readFontProps( ElementDescriptor
* element
, Style
& style
)
53 bool ret
= element
->readProp(
54 &style
._descr
, "FontDescriptor" );
55 ret
|= element
->readProp(
56 &style
._fontEmphasisMark
, "FontEmphasisMark" );
57 ret
|= element
->readProp(
58 &style
._fontRelief
, "FontRelief" );
62 void ElementDescriptor::readMultiPageModel( StyleBag
* all_styles
)
65 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
66 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
68 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
70 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
72 if (readFontProps( this, aStyle
))
76 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id" , all_styles
->getStyleId( aStyle
) );
81 readLongAttr( "MultiPageValue", XMLNS_DIALOGS_PREFIX
":value" );
82 Any
aDecorationAny( _xProps
->getPropertyValue( "Decoration" ) );
83 bool bDecoration
= true;
84 if ( (aDecorationAny
>>= bDecoration
) && !bDecoration
)
85 addAttribute( XMLNS_DIALOGS_PREFIX
":withtabs", "false" );
88 uno::Reference
< container::XNameContainer
> xPagesContainer( _xProps
, uno::UNO_QUERY
);
89 if ( xPagesContainer
.is() && xPagesContainer
->getElementNames().hasElements() )
91 rtl::Reference
<ElementDescriptor
> pElem
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":bulletinboard", _xDocument
);
92 pElem
->readBullitinBoard( all_styles
);
93 addSubElement( pElem
);
97 void ElementDescriptor::readFrameModel( StyleBag
* all_styles
)
100 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
102 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
104 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
106 if (readFontProps( this, aStyle
))
110 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
117 if ( readProp( "Label" ) >>= aTitle
)
119 rtl::Reference
<ElementDescriptor
> title
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":title", _xDocument
);
120 title
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", aTitle
);
121 addSubElement( title
);
123 uno::Reference
< container::XNameContainer
> xControlContainer( _xProps
, uno::UNO_QUERY
);
124 if ( xControlContainer
.is() && xControlContainer
->getElementNames().hasElements() )
126 rtl::Reference
<ElementDescriptor
> pElem
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":bulletinboard", _xDocument
);
127 pElem
->readBullitinBoard( all_styles
);
128 addSubElement( pElem
);
133 void ElementDescriptor::readPageModel( StyleBag
* all_styles
)
136 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
137 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
139 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
141 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
143 if (readFontProps( this, aStyle
))
147 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
152 readStringAttr( "Title", XMLNS_DIALOGS_PREFIX
":title" );
153 uno::Reference
< container::XNameContainer
> xControlContainer( _xProps
, uno::UNO_QUERY
);
154 if ( xControlContainer
.is() && xControlContainer
->getElementNames().hasElements() )
156 rtl::Reference
<ElementDescriptor
> pElem
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":bulletinboard", _xDocument
);
157 pElem
->readBullitinBoard( all_styles
);
158 addSubElement( pElem
);
163 void ElementDescriptor::readButtonModel( StyleBag
* all_styles
)
166 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
167 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
169 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
171 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
173 if (readFontProps( this, aStyle
))
177 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
182 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
183 readBoolAttr( "DefaultButton", XMLNS_DIALOGS_PREFIX
":default" );
184 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
185 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
186 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
187 readButtonTypeAttr( "PushButtonType", XMLNS_DIALOGS_PREFIX
":button-type" );
188 readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX
":image-src");
189 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX
":image-position" );
190 readImageAlignAttr( "ImageAlign", XMLNS_DIALOGS_PREFIX
":image-align" );
192 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
193 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
195 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Toggle" ) ))
196 addAttribute( XMLNS_DIALOGS_PREFIX
":toggled", "1" );
198 readBoolAttr( "FocusOnClick", XMLNS_DIALOGS_PREFIX
":grab-focus" );
199 readBoolAttr( "MultiLine",XMLNS_DIALOGS_PREFIX
":multiline" );
202 sal_Int16 nState
= 0;
203 if (readProp( "State" ) >>= nState
)
208 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "false" );
211 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "true" );
214 OSL_FAIL( "### unexpected radio state!" );
222 void ElementDescriptor::readCheckBoxModel( StyleBag
* all_styles
)
225 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
226 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
228 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
230 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
232 if (readFontProps( this, aStyle
))
234 if (readProp( "VisualEffect" ) >>= aStyle
._visualEffect
)
238 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
243 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
244 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
245 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
246 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
247 readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX
":image-src");
248 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX
":image-position" );
249 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
251 bool bTriState
= false;
252 if ((readProp( "TriState" ) >>= bTriState
) && bTriState
)
254 addAttribute( XMLNS_DIALOGS_PREFIX
":tristate", "true" );
256 sal_Int16 nState
= 0;
257 if (_xProps
->getPropertyValue( "State" ) >>= nState
)
262 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "false" );
265 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "true" );
267 case 2: // tristate=true exported, checked omitted => don't know!
268 OSL_ENSURE( bTriState
, "### detected tristate value, but TriState is not set!" );
271 OSL_FAIL( "### unexpected checkbox state!" );
278 void ElementDescriptor::readComboBoxModel( StyleBag
* all_styles
)
281 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
282 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
284 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
286 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
288 if (readBorderProps( this, aStyle
))
290 if (readFontProps( this, aStyle
))
294 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
299 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
300 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
301 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
302 readBoolAttr( "Autocomplete", XMLNS_DIALOGS_PREFIX
":autocomplete" );
303 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
304 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
305 readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX
":spin" );
306 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
307 readShortAttr( "LineCount", XMLNS_DIALOGS_PREFIX
":linecount" );
308 // Cell Range, Ref Cell etc.
309 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
310 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":source-cell-range" );
313 Sequence
< OUString
> itemValues
;
314 if ((readProp( "StringItemList" ) >>= itemValues
) && itemValues
.hasElements())
316 rtl::Reference
<ElementDescriptor
> popup
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menupopup", _xDocument
);
318 for ( const auto& rItemValue
: std::as_const(itemValues
) )
320 rtl::Reference
<ElementDescriptor
> item
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menuitem", _xDocument
);
321 item
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", rItemValue
);
322 popup
->addSubElement( item
);
325 addSubElement( popup
);
330 void ElementDescriptor::readListBoxModel( StyleBag
* all_styles
)
333 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
334 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
336 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
338 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
340 if (readBorderProps( this, aStyle
))
342 if (readFontProps( this, aStyle
))
346 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
351 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
352 readBoolAttr( "MultiSelection", XMLNS_DIALOGS_PREFIX
":multiselection" );
353 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
354 readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX
":spin" );
355 readShortAttr( "LineCount", XMLNS_DIALOGS_PREFIX
":linecount" );
356 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
357 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
358 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":source-cell-range" );
360 Sequence
< OUString
> itemValues
;
361 if ((readProp( "StringItemList" ) >>= itemValues
) && itemValues
.hasElements())
363 rtl::Reference
<ElementDescriptor
> popup
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menupopup", _xDocument
);
365 for ( const auto& rItemValue
: std::as_const(itemValues
) )
367 rtl::Reference
<ElementDescriptor
> item
= new ElementDescriptor(_xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":menuitem", _xDocument
);
368 item
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", rItemValue
);
369 popup
->addSubElement( item
);
372 Sequence
< sal_Int16
> selected
;
373 if (readProp( "SelectedItems" ) >>= selected
)
375 sal_Int16
const * pSelected
= selected
.getConstArray();
376 for ( sal_Int32 nPos
= selected
.getLength(); nPos
--; )
378 ElementDescriptor
* item
= static_cast< ElementDescriptor
* >(
379 popup
->getSubElement( pSelected
[ nPos
] ).get() );
380 item
->addAttribute( XMLNS_DIALOGS_PREFIX
":selected", "true" );
384 addSubElement( popup
);
389 void ElementDescriptor::readRadioButtonModel( StyleBag
* all_styles
)
392 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
393 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
395 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
397 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
399 if (readFontProps( this, aStyle
))
401 if (readProp( "VisualEffect" ) >>= aStyle
._visualEffect
)
405 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id" , all_styles
->getStyleId( aStyle
) );
410 readBoolAttr("Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
411 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
412 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
413 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
414 readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX
":image-src");
415 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX
":image-position" );
416 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
417 readStringAttr( "GroupName", XMLNS_DIALOGS_PREFIX
":group-name" );
419 sal_Int16 nState
= 0;
420 if (readProp( "State" ) >>= nState
)
425 addAttribute(XMLNS_DIALOGS_PREFIX
":checked", "false" );
428 addAttribute( XMLNS_DIALOGS_PREFIX
":checked", "true" );
431 OSL_FAIL( "### unexpected radio state!" );
435 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
439 void ElementDescriptor::readGroupBoxModel( StyleBag
* all_styles
)
442 Style
aStyle( 0x2 | 0x8 | 0x20 );
443 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
445 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
447 if (readFontProps( this, aStyle
))
451 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
458 if (readProp( "Label" ) >>= aTitle
)
460 rtl::Reference
<ElementDescriptor
> title
= new ElementDescriptor( _xProps
, _xPropState
, XMLNS_DIALOGS_PREFIX
":title", _xDocument
);
461 title
->addAttribute( XMLNS_DIALOGS_PREFIX
":value", aTitle
);
462 addSubElement( title
);
468 void ElementDescriptor::readFixedTextModel( StyleBag
* all_styles
)
471 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
472 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
474 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
476 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
478 if (readBorderProps( this, aStyle
))
480 if (readFontProps( this, aStyle
))
484 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
489 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
490 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
491 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
492 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
493 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
494 readBoolAttr( "NoLabel", XMLNS_DIALOGS_PREFIX
":nolabel" );
498 void ElementDescriptor::readFixedHyperLinkModel( StyleBag
* all_styles
)
501 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
502 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
504 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
506 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
508 if (readBorderProps( this, aStyle
))
510 if (readFontProps( this, aStyle
))
514 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
519 readStringAttr( "Label",XMLNS_DIALOGS_PREFIX
":value" );
520 readStringAttr( "URL", XMLNS_DIALOGS_PREFIX
":url" );
521 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
522 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
523 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
524 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
525 readBoolAttr( "NoLabel", XMLNS_DIALOGS_PREFIX
":nolabel" );
529 void ElementDescriptor::readEditModel( StyleBag
* all_styles
)
532 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
533 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
535 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
537 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
539 if (readBorderProps( this, aStyle
))
541 if (readFontProps( this, aStyle
))
545 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
550 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
551 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
552 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
553 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
554 readBoolAttr( "HardLineBreaks", XMLNS_DIALOGS_PREFIX
":hard-linebreaks" );
555 readBoolAttr( "HScroll", XMLNS_DIALOGS_PREFIX
":hscroll" );
556 readBoolAttr( "VScroll", XMLNS_DIALOGS_PREFIX
":vscroll" );
557 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
558 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX
":multiline" );
559 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
560 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
561 readLineEndFormatAttr( "LineEndFormat", XMLNS_DIALOGS_PREFIX
":lineend-format" );
563 if (readProp( "EchoChar" ) >>= nEcho
)
565 sal_Unicode cEcho
= static_cast<sal_Unicode
>(nEcho
);
566 addAttribute( XMLNS_DIALOGS_PREFIX
":echochar", OUString( &cEcho
, 1 ) );
568 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
572 void ElementDescriptor::readImageControlModel( StyleBag
* all_styles
)
575 Style
aStyle( 0x1 | 0x4 );
576 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
578 if (readBorderProps( this, aStyle
))
582 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
587 readBoolAttr( "ScaleImage", XMLNS_DIALOGS_PREFIX
":scale-image" );
588 readImageScaleModeAttr( "ScaleMode", XMLNS_DIALOGS_PREFIX
":scale-mode" );
589 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
590 readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX
":src");
594 void ElementDescriptor::readFileControlModel( StyleBag
* all_styles
)
597 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
598 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
600 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
602 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
604 if (readBorderProps( this, aStyle
))
606 if (readFontProps( this, aStyle
))
610 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
615 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
616 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
617 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
618 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
622 void ElementDescriptor::readTreeControlModel( StyleBag
* all_styles
)
625 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
626 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
628 if (readBorderProps( this, aStyle
))
632 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
637 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
638 readSelectionTypeAttr( "SelectionType", XMLNS_DIALOGS_PREFIX
":selectiontype" );
640 readBoolAttr( "RootDisplayed", XMLNS_DIALOGS_PREFIX
":rootdisplayed" );
641 readBoolAttr( "ShowsHandles", XMLNS_DIALOGS_PREFIX
":showshandles" );
642 readBoolAttr( "ShowsRootHandles", XMLNS_DIALOGS_PREFIX
":showsroothandles" );
643 readBoolAttr( "Editable", XMLNS_DIALOGS_PREFIX
":editable" );
644 readBoolAttr( "InvokesStopNodeEditing", XMLNS_DIALOGS_PREFIX
":invokesstopnodeediting" );
645 readLongAttr( "RowHeight", XMLNS_DIALOGS_PREFIX
":rowheight" );
649 void ElementDescriptor::readCurrencyFieldModel( StyleBag
* all_styles
)
652 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
653 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
655 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
657 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
659 if (readBorderProps( this, aStyle
))
661 if (readFontProps( this, aStyle
))
665 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
670 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
671 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
672 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
673 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
674 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
675 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
676 readStringAttr( "CurrencySymbol", XMLNS_DIALOGS_PREFIX
":currency-symbol" );
677 readShortAttr( "DecimalAccuracy", XMLNS_DIALOGS_PREFIX
":decimal-accuracy" );
678 readBoolAttr( "ShowThousandsSeparator", XMLNS_DIALOGS_PREFIX
":thousands-separator" );
679 readDoubleAttr( "Value", XMLNS_DIALOGS_PREFIX
":value" );
680 readDoubleAttr( "ValueMin", XMLNS_DIALOGS_PREFIX
":value-min" );
681 readDoubleAttr( "ValueMax", XMLNS_DIALOGS_PREFIX
":value-max" );
682 readDoubleAttr( "ValueStep", XMLNS_DIALOGS_PREFIX
":value-step" );
683 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
684 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
685 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
686 readBoolAttr("PrependCurrencySymbol", XMLNS_DIALOGS_PREFIX
":prepend-symbol" );
687 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
691 void ElementDescriptor::readDateFieldModel( StyleBag
* all_styles
)
694 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
695 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
697 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
699 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
701 if (readBorderProps( this, aStyle
))
703 if (readFontProps( this, aStyle
))
707 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
712 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
713 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
714 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
715 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
716 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
717 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
718 readDateFormatAttr( "DateFormat", XMLNS_DIALOGS_PREFIX
":date-format" );
719 readBoolAttr( "DateShowCentury", XMLNS_DIALOGS_PREFIX
":show-century" );
720 readDateAttr( "Date", XMLNS_DIALOGS_PREFIX
":value" );
721 readDateAttr( "DateMin", XMLNS_DIALOGS_PREFIX
":value-min" );
722 readDateAttr( "DateMax", XMLNS_DIALOGS_PREFIX
":value-max" );
723 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
724 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
725 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
726 readBoolAttr( "Dropdown", XMLNS_DIALOGS_PREFIX
":dropdown" );
727 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":text" );
728 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
732 void ElementDescriptor::readNumericFieldModel( StyleBag
* all_styles
)
735 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
736 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
738 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
740 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
742 if (readBorderProps( this, aStyle
))
744 if (readFontProps( this, aStyle
))
748 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
753 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
754 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign" );
755 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
756 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
757 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
758 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
759 readShortAttr( "DecimalAccuracy", XMLNS_DIALOGS_PREFIX
":decimal-accuracy" );
760 readBoolAttr( "ShowThousandsSeparator", XMLNS_DIALOGS_PREFIX
":thousands-separator" );
761 readDoubleAttr( "Value", XMLNS_DIALOGS_PREFIX
":value" );
762 readDoubleAttr( "ValueMin", XMLNS_DIALOGS_PREFIX
":value-min" );
763 readDoubleAttr( "ValueMax", XMLNS_DIALOGS_PREFIX
":value-max" );
764 readDoubleAttr( "ValueStep", XMLNS_DIALOGS_PREFIX
":value-step" );
765 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
766 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
767 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
768 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
772 void ElementDescriptor::readTimeFieldModel( StyleBag
* all_styles
)
775 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
776 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
778 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
780 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
782 if (readBorderProps( this, aStyle
))
784 if (readFontProps( this, aStyle
))
788 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
793 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop");
794 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
795 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
796 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
797 readTimeFormatAttr( "TimeFormat", XMLNS_DIALOGS_PREFIX
":time-format" );
798 readTimeAttr( "Time", XMLNS_DIALOGS_PREFIX
":value" );
799 readTimeAttr( "TimeMin", XMLNS_DIALOGS_PREFIX
":value-min" );
800 readTimeAttr( "TimeMax", XMLNS_DIALOGS_PREFIX
":value-max" );
801 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
802 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
803 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
804 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":text" );
805 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
809 void ElementDescriptor::readPatternFieldModel( StyleBag
* all_styles
)
812 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
813 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
815 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
817 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
819 if (readBorderProps( this, aStyle
))
821 if (readFontProps( this, aStyle
))
825 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
830 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
831 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
832 readBoolAttr( "HideInactiveSelection", XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
833 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
834 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":value" );
835 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
836 readStringAttr( "EditMask", XMLNS_DIALOGS_PREFIX
":edit-mask" );
837 readStringAttr( "LiteralMask", XMLNS_DIALOGS_PREFIX
":literal-mask" );
841 void ElementDescriptor::readFormattedFieldModel( StyleBag
* all_styles
)
844 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
845 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
847 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
849 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
851 if (readBorderProps( this, aStyle
))
853 if (readFontProps( this, aStyle
))
857 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
862 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
863 readBoolAttr( "ReadOnly", XMLNS_DIALOGS_PREFIX
":readonly" );
864 readBoolAttr( "HideInactiveSelection",XMLNS_DIALOGS_PREFIX
":hide-inactive-selection" );
865 readBoolAttr( "StrictFormat", XMLNS_DIALOGS_PREFIX
":strict-format" );
866 readStringAttr( "Text", XMLNS_DIALOGS_PREFIX
":text" );
867 readAlignAttr( "Align", XMLNS_DIALOGS_PREFIX
":align" );
868 readShortAttr( "MaxTextLen", XMLNS_DIALOGS_PREFIX
":maxlength" );
869 readBoolAttr( "Spin", XMLNS_DIALOGS_PREFIX
":spin" );
870 if (extract_throw
<bool>( _xProps
->getPropertyValue( "Repeat" ) ))
871 readLongAttr( "RepeatDelay",XMLNS_DIALOGS_PREFIX
":repeat", true /* force */ );
873 Any
a( readProp( "EffectiveDefault" ) );
874 switch (a
.getValueTypeClass())
876 case TypeClass_DOUBLE
:
877 addAttribute( XMLNS_DIALOGS_PREFIX
":value-default", OUString::number( *o3tl::forceAccess
<double>(a
) ) );
879 case TypeClass_STRING
:
880 addAttribute( XMLNS_DIALOGS_PREFIX
":value-default", *o3tl::forceAccess
<OUString
>(a
) );
885 readDoubleAttr( "EffectiveMin", XMLNS_DIALOGS_PREFIX
":value-min" );
886 readDoubleAttr( "EffectiveMax", XMLNS_DIALOGS_PREFIX
":value-max" );
887 readDoubleAttr( "EffectiveValue", XMLNS_DIALOGS_PREFIX
":value" );
891 if (readProp( "FormatKey" ) >>= nKey
)
893 Reference
< util::XNumberFormatsSupplier
> xSupplier
;
894 if (readProp( "FormatsSupplier" ) >>= xSupplier
)
897 xSupplier
->getNumberFormats()->getByKey( nKey
) );
900 readBoolAttr( "TreatAsNumber", XMLNS_DIALOGS_PREFIX
":treat-as-number" );
901 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX
":enforce-format" );
906 void ElementDescriptor::readSpinButtonModel( StyleBag
* all_styles
)
909 Style
aStyle( 0x1 | 0x4 );
910 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
912 if (readBorderProps( this, aStyle
))
916 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
921 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX
":align" );
922 readLongAttr( "SpinIncrement", XMLNS_DIALOGS_PREFIX
":increment" );
923 readLongAttr( "SpinValue", XMLNS_DIALOGS_PREFIX
":curval" );
924 readLongAttr( "SpinValueMax", XMLNS_DIALOGS_PREFIX
":maxval" );
925 readLongAttr( "SpinValueMin", XMLNS_DIALOGS_PREFIX
":minval" );
926 readLongAttr( "Repeat", XMLNS_DIALOGS_PREFIX
":repeat" );
927 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat-delay" );
928 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
929 readHexLongAttr( "SymbolColor", XMLNS_DIALOGS_PREFIX
":symbol-color" );
930 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
934 void ElementDescriptor::readFixedLineModel( StyleBag
* all_styles
)
937 Style
aStyle( 0x2 | 0x8 | 0x20 );
938 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
940 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
942 if (readFontProps( this, aStyle
))
946 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
951 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX
":value" );
952 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX
":align" );
956 void ElementDescriptor::readProgressBarModel( StyleBag
* all_styles
)
959 Style
aStyle( 0x1 | 0x4 | 0x10 );
960 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
962 if (readBorderProps( this, aStyle
))
964 if (readProp( "FillColor" ) >>= aStyle
._descr
)
968 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
973 readLongAttr( "ProgressValue", XMLNS_DIALOGS_PREFIX
":value" );
974 readLongAttr( "ProgressValueMin", XMLNS_DIALOGS_PREFIX
":value-min" );
975 readLongAttr( "ProgressValueMax", XMLNS_DIALOGS_PREFIX
":value-max" );
979 void ElementDescriptor::readScrollBarModel( StyleBag
* all_styles
)
982 Style
aStyle( 0x1 | 0x4 );
983 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
985 if (readBorderProps( this, aStyle
))
989 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
994 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX
":align" );
995 readLongAttr( "BlockIncrement", XMLNS_DIALOGS_PREFIX
":pageincrement" );
996 readLongAttr( "LineIncrement", XMLNS_DIALOGS_PREFIX
":increment" );
997 readLongAttr( "ScrollValue", XMLNS_DIALOGS_PREFIX
":curpos" );
998 readLongAttr( "ScrollValueMax", XMLNS_DIALOGS_PREFIX
":maxpos" );
999 readLongAttr( "ScrollValueMin", XMLNS_DIALOGS_PREFIX
":minpos" );
1000 readLongAttr( "VisibleSize", XMLNS_DIALOGS_PREFIX
":visible-size" );
1001 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX
":repeat" );
1002 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop" );
1003 readBoolAttr( "LiveScroll", XMLNS_DIALOGS_PREFIX
":live-scroll" );
1004 readHexLongAttr( "SymbolColor", XMLNS_DIALOGS_PREFIX
":symbol-color" );
1005 readDataAwareAttr( XMLNS_DIALOGS_PREFIX
":linked-cell" );
1009 void ElementDescriptor::readGridControlModel( StyleBag
* all_styles
)
1012 Style
aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1013 if (readProp("BackgroundColor") >>= aStyle
._backgroundColor
)
1015 if (readBorderProps( this, aStyle
))
1017 if (readProp("TextColor") >>= aStyle
._textColor
)
1019 if (readProp("TextLineColor") >>= aStyle
._textLineColor
)
1020 aStyle
._set
|= 0x20;
1021 if (readFontProps( this, aStyle
))
1025 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id",all_styles
->getStyleId( aStyle
) );
1029 readBoolAttr("Tabstop", XMLNS_DIALOGS_PREFIX
":tabstop");
1030 readVerticalAlignAttr( "VerticalAlign", XMLNS_DIALOGS_PREFIX
":valign");
1031 readSelectionTypeAttr( "SelectionModel", XMLNS_DIALOGS_PREFIX
":selectiontype");
1032 readBoolAttr( "ShowColumnHeader", XMLNS_DIALOGS_PREFIX
":showcolumnheader");
1033 readBoolAttr( "ShowRowHeader", XMLNS_DIALOGS_PREFIX
":showrowheader");
1034 readHexLongAttr( "GridLineColor", XMLNS_DIALOGS_PREFIX
":gridline-color");
1035 readBoolAttr( "UseGridLines", XMLNS_DIALOGS_PREFIX
":usegridlines" );
1036 readHexLongAttr( "HeaderBackgroundColor", XMLNS_DIALOGS_PREFIX
":headerbackground-color");
1037 readHexLongAttr( "HeaderTextColor", XMLNS_DIALOGS_PREFIX
":headertext-color");
1038 readHexLongAttr( "ActiveSelectionBackgroundColor", XMLNS_DIALOGS_PREFIX
":activeselectionbackground-color");
1039 readHexLongAttr( "ActiveSelectionTextColor", XMLNS_DIALOGS_PREFIX
":activeselectiontext-color");
1040 readHexLongAttr( "InactiveSelectionBackgroundColor", XMLNS_DIALOGS_PREFIX
":inactiveselectionbackground-color");
1041 readHexLongAttr( "InactiveSelectionTextColor", XMLNS_DIALOGS_PREFIX
":inactiveselectiontext-color");
1045 void ElementDescriptor::readDialogModel( StyleBag
* all_styles
)
1048 addAttribute( "xmlns:" XMLNS_DIALOGS_PREFIX
, XMLNS_DIALOGS_URI
);
1049 addAttribute( "xmlns:" XMLNS_SCRIPT_PREFIX
, XMLNS_SCRIPT_URI
);
1052 Style
aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
1053 if (readProp( "BackgroundColor" ) >>= aStyle
._backgroundColor
)
1055 if (readProp( "TextColor" ) >>= aStyle
._textColor
)
1057 if (readProp( "TextLineColor" ) >>= aStyle
._textLineColor
)
1058 aStyle
._set
|= 0x20;
1059 if (readFontProps( this, aStyle
))
1063 addAttribute( XMLNS_DIALOGS_PREFIX
":style-id", all_styles
->getStyleId( aStyle
) );
1067 readDefaults( false, false );
1068 readBoolAttr("Closeable", XMLNS_DIALOGS_PREFIX
":closeable" );
1069 readBoolAttr( "Moveable", XMLNS_DIALOGS_PREFIX
":moveable" );
1070 readBoolAttr( "Sizeable", XMLNS_DIALOGS_PREFIX
":resizeable" );
1071 readStringAttr( "Title", XMLNS_DIALOGS_PREFIX
":title" );
1073 readScrollableSettings();
1074 Any
aDecorationAny( _xProps
->getPropertyValue( "Decoration" ) );
1075 bool bDecoration
= false;
1076 if ( (aDecorationAny
>>= bDecoration
) && !bDecoration
)
1077 addAttribute( XMLNS_DIALOGS_PREFIX
":withtitlebar", "false" );
1078 readImageOrGraphicAttr(XMLNS_DIALOGS_PREFIX
":image-src");
1082 void ElementDescriptor::readBullitinBoard( StyleBag
* all_styles
)
1085 ::std::vector
< rtl::Reference
<ElementDescriptor
> > all_elements
;
1086 // read out all props
1087 Reference
< container::XNameContainer
> xDialogModel( _xProps
, UNO_QUERY
);
1088 if ( !xDialogModel
.is() )
1089 return; // #TODO throw???
1090 const Sequence
< OUString
> aElements( xDialogModel
->getElementNames() );
1092 rtl::Reference
<ElementDescriptor
> pRadioGroup
;
1094 for ( const auto& rElement
: aElements
)
1096 Any
aControlModel( xDialogModel
->getByName( rElement
) );
1097 Reference
< beans::XPropertySet
> xProps
;
1098 OSL_VERIFY( aControlModel
>>= xProps
);
1101 Reference
< beans::XPropertyState
> xPropState( xProps
, UNO_QUERY
);
1102 OSL_ENSURE( xPropState
.is(), "no XPropertyState!" );
1103 if (! xPropState
.is())
1105 Reference
< lang::XServiceInfo
> xServiceInfo( xProps
, UNO_QUERY
);
1106 OSL_ENSURE( xServiceInfo
.is(), "no XServiceInfo!" );
1107 if (! xServiceInfo
.is())
1110 rtl::Reference
<ElementDescriptor
> pElem
;
1112 // group up radio buttons
1113 if ( xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) )
1115 if (! pRadioGroup
) // open radiogroup
1117 pRadioGroup
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":radiogroup", _xDocument
);
1118 all_elements
.push_back( pRadioGroup
);
1121 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":radio", _xDocument
);
1122 pElem
->readRadioButtonModel( all_styles
);
1123 pRadioGroup
->addSubElement( pElem
);
1127 pRadioGroup
= nullptr; // close radiogroup
1129 if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlButtonModel" ) )
1131 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":button", _xDocument
);
1132 pElem
->readButtonModel( all_styles
);
1134 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) )
1136 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":checkbox", _xDocument
);
1137 pElem
->readCheckBoxModel( all_styles
);
1139 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlComboBoxModel" ) )
1141 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":combobox", _xDocument
);
1142 pElem
->readComboBoxModel( all_styles
);
1144 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlListBoxModel" ) )
1146 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":menulist", _xDocument
);
1147 pElem
->readListBoxModel( all_styles
);
1149 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ) )
1151 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":titledbox", _xDocument
);
1152 pElem
->readGroupBoxModel( all_styles
);
1154 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoMultiPageModel" ) )
1156 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":multipage", _xDocument
);
1157 pElem
->readMultiPageModel( all_styles
);
1159 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoFrameModel" ) )
1161 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":frame", _xDocument
);
1162 pElem
->readFrameModel( all_styles
);
1164 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoPageModel" ) )
1166 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":page", _xDocument
);
1167 pElem
->readPageModel( all_styles
);
1169 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ) )
1171 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":text", _xDocument
);
1172 pElem
->readFixedTextModel( all_styles
);
1174 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlEditModel" ) )
1176 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":textfield", _xDocument
);
1177 pElem
->readEditModel( all_styles
);
1180 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) )
1182 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":linklabel", _xDocument
);
1183 pElem
->readFixedHyperLinkModel( all_styles
);
1185 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlImageControlModel" ) )
1187 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":img", _xDocument
);
1188 pElem
->readImageControlModel( all_styles
);
1190 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFileControlModel" ) )
1192 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":filecontrol", _xDocument
);
1193 pElem
->readFileControlModel( all_styles
);
1195 else if (xServiceInfo
->supportsService( "com.sun.star.awt.tree.TreeControlModel" ) )
1197 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":treecontrol", _xDocument
);
1198 pElem
->readTreeControlModel( all_styles
);
1200 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" ) )
1202 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":currencyfield", _xDocument
);
1203 pElem
->readCurrencyFieldModel( all_styles
);
1205 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlDateFieldModel" ) )
1207 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":datefield", _xDocument
);
1208 pElem
->readDateFieldModel( all_styles
);
1210 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" ) )
1212 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":numericfield", _xDocument
);
1213 pElem
->readNumericFieldModel( all_styles
);
1215 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" ) )
1217 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":timefield", _xDocument
);
1218 pElem
->readTimeFieldModel( all_styles
);
1220 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" ) )
1222 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":patternfield", _xDocument
);
1223 pElem
->readPatternFieldModel( all_styles
);
1225 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ) )
1227 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":formattedfield", _xDocument
);
1228 pElem
->readFormattedFieldModel( all_styles
);
1230 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlFixedLineModel" ) )
1232 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":fixedline", _xDocument
);
1233 pElem
->readFixedLineModel( all_styles
);
1235 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlScrollBarModel" ) )
1237 pElem
= new ElementDescriptor(xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":scrollbar", _xDocument
);
1238 pElem
->readScrollBarModel( all_styles
);
1240 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlSpinButtonModel" ) )
1242 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":spinbutton", _xDocument
);
1243 pElem
->readSpinButtonModel( all_styles
);
1245 else if (xServiceInfo
->supportsService( "com.sun.star.awt.UnoControlProgressBarModel" ) )
1247 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":progressmeter", _xDocument
);
1248 pElem
->readProgressBarModel( all_styles
);
1250 else if (xServiceInfo
->supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ) )
1252 pElem
= new ElementDescriptor( xProps
, xPropState
, XMLNS_DIALOGS_PREFIX
":table", _xDocument
);
1253 pElem
->readGridControlModel( all_styles
);
1258 all_elements
.push_back( pElem
);
1262 OSL_FAIL( "unknown control type!" );
1267 for (const rtl::Reference
<ElementDescriptor
> & p
: all_elements
)
1275 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */