LibreOffice Module xmlscript (master) 1
xmldlg_expmodels.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include "common.hxx"
21#include "exp_share.hxx"
22#include <misc.hxx>
23#include <xmlscript/xmlns.h>
24
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>
30
31using namespace ::com::sun::star;
32using namespace ::com::sun::star::uno;
33
34namespace xmlscript
35{
36
37static bool readBorderProps(
38 ElementDescriptor * element, Style & style )
39{
40 if (element->readProp( &style._border, "Border" )) {
41 if (style._border == BORDER_SIMPLE /* simple */)
42 {
43 if (element->readProp( &style._borderColor, "BorderColor" ))
45 }
46 return true;
47 }
48 return false;
49}
50
51static bool readFontProps( ElementDescriptor * element, Style & style )
52{
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" );
59 return ret;
60}
61
63{
64 // collect styles
65 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
66 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
67 aStyle._set |= 0x1;
68 if (readProp( "TextColor" ) >>= aStyle._textColor)
69 aStyle._set |= 0x2;
70 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
71 aStyle._set |= 0x20;
72 if (readFontProps( this, aStyle ))
73 aStyle._set |= 0x8;
74 if (aStyle._set)
75 {
76 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id" , all_styles->getStyleId( aStyle ) );
77 }
78
79 // collect elements
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" );
86
87 readEvents();
88 uno::Reference< container::XNameContainer > xPagesContainer( _xProps, uno::UNO_QUERY );
89 if ( xPagesContainer.is() && xPagesContainer->getElementNames().hasElements() )
90 {
92 pElem->readBullitinBoard( all_styles );
93 addSubElement( pElem );
94 }
95}
96
98{
99 // collect styles
100 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
101
102 if (readProp( "TextColor" ) >>= aStyle._textColor)
103 aStyle._set |= 0x2;
104 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
105 aStyle._set |= 0x20;
106 if (readFontProps( this, aStyle ))
107 aStyle._set |= 0x8;
108 if (aStyle._set)
109 {
110 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
111 }
112
113 // collect elements
114 readDefaults();
115 OUString aTitle;
116
117 if ( readProp( "Label" ) >>= aTitle)
118 {
120 title->addAttribute( XMLNS_DIALOGS_PREFIX ":value", aTitle );
121 addSubElement( title );
122 }
123 uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY );
124 if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() )
125 {
127 pElem->readBullitinBoard( all_styles );
128 addSubElement( pElem );
129 }
130 readEvents();
131}
132
134{
135 // collect styles
136 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
137 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
138 aStyle._set |= 0x1;
139 if (readProp( "TextColor" ) >>= aStyle._textColor)
140 aStyle._set |= 0x2;
141 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
142 aStyle._set |= 0x20;
143 if (readFontProps( this, aStyle ))
144 aStyle._set |= 0x8;
145 if (aStyle._set)
146 {
147 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
148 }
149
150 // collect elements
151 readDefaults();
152 readStringAttr( "Title", XMLNS_DIALOGS_PREFIX ":title" );
153 uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY );
154 if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() )
155 {
157 pElem->readBullitinBoard( all_styles );
158 addSubElement( pElem );
159 }
160 readEvents();
161}
162
164{
165 // collect styles
166 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
167 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
168 aStyle._set |= 0x1;
169 if (readProp( "TextColor" ) >>= aStyle._textColor)
170 aStyle._set |= 0x2;
171 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
172 aStyle._set |= 0x20;
173 if (readFontProps( this, aStyle ))
174 aStyle._set |= 0x8;
175 if (aStyle._set)
176 {
177 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
178 }
179
180 // collect elements
181 readDefaults();
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" );
189 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
190 readImageAlignAttr( "ImageAlign", XMLNS_DIALOGS_PREFIX ":image-align" );
191
192 if (extract_throw<bool>( _xProps->getPropertyValue( "Repeat" ) ))
193 readLongAttr( "RepeatDelay", XMLNS_DIALOGS_PREFIX ":repeat", true /* force */ );
194
195 if (extract_throw<bool>( _xProps->getPropertyValue( "Toggle" ) ))
196 addAttribute( XMLNS_DIALOGS_PREFIX ":toggled", "1" );
197
198 readBoolAttr( "FocusOnClick", XMLNS_DIALOGS_PREFIX ":grab-focus" );
199 readBoolAttr( "MultiLine",XMLNS_DIALOGS_PREFIX ":multiline" );
200
201 // State
202 sal_Int16 nState = 0;
203 if (readProp( "State" ) >>= nState)
204 {
205 switch (nState)
206 {
207 case 0:
208 addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "false" );
209 break;
210 case 1:
211 addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "true" );
212 break;
213 default:
214 OSL_FAIL( "### unexpected radio state!" );
215 break;
216 }
217 }
218
219 readEvents();
220}
221
223{
224 // collect styles
225 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
226 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
227 aStyle._set |= 0x1;
228 if (readProp( "TextColor" ) >>= aStyle._textColor)
229 aStyle._set |= 0x2;
230 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
231 aStyle._set |= 0x20;
232 if (readFontProps( this, aStyle ))
233 aStyle._set |= 0x8;
234 if (readProp( "VisualEffect" ) >>= aStyle._visualEffect)
235 aStyle._set |= 0x40;
236 if (aStyle._set)
237 {
238 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
239 }
240
241 // collect elements
242 readDefaults();
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" );
248 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
249 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
250
251 bool bTriState = false;
252 if ((readProp( "TriState" ) >>= bTriState) && bTriState)
253 {
254 addAttribute( XMLNS_DIALOGS_PREFIX ":tristate", "true" );
255 }
256 sal_Int16 nState = 0;
257 if (_xProps->getPropertyValue( "State" ) >>= nState)
258 {
259 switch (nState)
260 {
261 case 0:
262 addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "false" );
263 break;
264 case 1:
265 addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "true" );
266 break;
267 case 2: // tristate=true exported, checked omitted => don't know!
268 OSL_ENSURE( bTriState, "### detected tristate value, but TriState is not set!" );
269 break;
270 default:
271 OSL_FAIL( "### unexpected checkbox state!" );
272 break;
273 }
274 }
275 readEvents();
276}
277
279{
280 // collect styles
281 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
282 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
283 aStyle._set |= 0x1;
284 if (readProp( "TextColor" ) >>= aStyle._textColor)
285 aStyle._set |= 0x2;
286 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
287 aStyle._set |= 0x20;
288 if (readBorderProps( this, aStyle ))
289 aStyle._set |= 0x4;
290 if (readFontProps( this, aStyle ))
291 aStyle._set |= 0x8;
292 if (aStyle._set)
293 {
294 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
295 }
296
297 // collect elements
298 readDefaults();
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" );
311
312 // string item list
313 Sequence< OUString > itemValues;
314 if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.hasElements())
315 {
317
318 for ( const auto& rItemValue : std::as_const(itemValues) )
319 {
321 item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue );
322 popup->addSubElement( item );
323 }
324
325 addSubElement( popup );
326 }
327 readEvents();
328}
329
331{
332 // collect styles
333 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
334 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
335 aStyle._set |= 0x1;
336 if (readProp( "TextColor" ) >>= aStyle._textColor)
337 aStyle._set |= 0x2;
338 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
339 aStyle._set |= 0x20;
340 if (readBorderProps( this, aStyle ))
341 aStyle._set |= 0x4;
342 if (readFontProps( this, aStyle ))
343 aStyle._set |= 0x8;
344 if (aStyle._set)
345 {
346 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
347 }
348
349 // collect elements
350 readDefaults();
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" );
359 // string item list
360 Sequence< OUString > itemValues;
361 if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.hasElements())
362 {
364
365 for ( const auto& rItemValue : std::as_const(itemValues) )
366 {
368 item->addAttribute( XMLNS_DIALOGS_PREFIX ":value", rItemValue );
369 popup->addSubElement( item );
370 }
371
372 Sequence< sal_Int16 > selected;
373 if (readProp( "SelectedItems" ) >>= selected)
374 {
375 sal_Int16 const * pSelected = selected.getConstArray();
376 for ( sal_Int32 nPos = selected.getLength(); nPos--; )
377 {
378 ElementDescriptor * item = static_cast< ElementDescriptor * >(
379 popup->getSubElement( pSelected[ nPos ] ).get() );
380 item->addAttribute( XMLNS_DIALOGS_PREFIX ":selected", "true" );
381 }
382 }
383
384 addSubElement( popup );
385 }
386 readEvents();
387}
388
390{
391 // collect styles
392 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 );
393 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
394 aStyle._set |= 0x1;
395 if (readProp( "TextColor" ) >>= aStyle._textColor)
396 aStyle._set |= 0x2;
397 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
398 aStyle._set |= 0x20;
399 if (readFontProps( this, aStyle ))
400 aStyle._set |= 0x8;
401 if (readProp( "VisualEffect" ) >>= aStyle._visualEffect)
402 aStyle._set |= 0x40;
403 if (aStyle._set)
404 {
405 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id" , all_styles->getStyleId( aStyle ) );
406 }
407
408 // collect elements
409 readDefaults();
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" );
415 readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
416 readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
417 readStringAttr( "GroupName", XMLNS_DIALOGS_PREFIX ":group-name" );
418
419 sal_Int16 nState = 0;
420 if (readProp( "State" ) >>= nState)
421 {
422 switch (nState)
423 {
424 case 0:
425 addAttribute(XMLNS_DIALOGS_PREFIX ":checked", "false" );
426 break;
427 case 1:
428 addAttribute( XMLNS_DIALOGS_PREFIX ":checked", "true" );
429 break;
430 default:
431 OSL_FAIL( "### unexpected radio state!" );
432 break;
433 }
434 }
435 readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
436 readEvents();
437}
438
440{
441 // collect styles
442 Style aStyle( 0x2 | 0x8 | 0x20 );
443 if (readProp( "TextColor" ) >>= aStyle._textColor)
444 aStyle._set |= 0x2;
445 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
446 aStyle._set |= 0x20;
447 if (readFontProps( this, aStyle ))
448 aStyle._set |= 0x8;
449 if (aStyle._set)
450 {
451 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
452 }
453
454 // collect elements
455 readDefaults();
456
457 OUString aTitle;
458 if (readProp( "Label" ) >>= aTitle)
459 {
461 title->addAttribute( XMLNS_DIALOGS_PREFIX ":value", aTitle );
462 addSubElement( title );
463 }
464
465 readEvents();
466}
467
469{
470 // collect styles
471 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
472 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
473 aStyle._set |= 0x1;
474 if (readProp( "TextColor" ) >>= aStyle._textColor)
475 aStyle._set |= 0x2;
476 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
477 aStyle._set |= 0x20;
478 if (readBorderProps( this, aStyle ))
479 aStyle._set |= 0x4;
480 if (readFontProps( this, aStyle ))
481 aStyle._set |= 0x8;
482 if (aStyle._set)
483 {
484 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
485 }
486
487 // collect elements
488 readDefaults();
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" );
495 readEvents();
496}
497
499{
500 // collect styles
501 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
502 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
503 aStyle._set |= 0x1;
504 if (readProp( "TextColor" ) >>= aStyle._textColor)
505 aStyle._set |= 0x2;
506 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
507 aStyle._set |= 0x20;
508 if (readBorderProps( this, aStyle ))
509 aStyle._set |= 0x4;
510 if (readFontProps( this, aStyle ))
511 aStyle._set |= 0x8;
512 if (aStyle._set)
513 {
514 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
515 }
516
517 // collect elements
518 readDefaults();
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" );
526 readEvents();
527}
528
530{
531 // collect styles
532 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
533 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
534 aStyle._set |= 0x1;
535 if (readProp( "TextColor" ) >>= aStyle._textColor)
536 aStyle._set |= 0x2;
537 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
538 aStyle._set |= 0x20;
539 if (readBorderProps( this, aStyle ))
540 aStyle._set |= 0x4;
541 if (readFontProps( this, aStyle ))
542 aStyle._set |= 0x8;
543 if (aStyle._set)
544 {
545 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
546 }
547
548 // collect elements
549 readDefaults();
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" );
562 sal_Int16 nEcho = 0;
563 if (readProp( "EchoChar" ) >>= nEcho)
564 {
565 sal_Unicode cEcho = static_cast<sal_Unicode>(nEcho);
566 addAttribute( XMLNS_DIALOGS_PREFIX ":echochar", OUString( &cEcho, 1 ) );
567 }
568 readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":linked-cell" );
569 readEvents();
570}
571
573{
574 // collect styles
575 Style aStyle( 0x1 | 0x4 );
576 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
577 aStyle._set |= 0x1;
578 if (readBorderProps( this, aStyle ))
579 aStyle._set |= 0x4;
580 if (aStyle._set)
581 {
582 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
583 }
584
585 // collect elements
586 readDefaults();
587 readBoolAttr( "ScaleImage", XMLNS_DIALOGS_PREFIX ":scale-image" );
588 readImageScaleModeAttr( "ScaleMode", XMLNS_DIALOGS_PREFIX ":scale-mode" );
589 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
591 readEvents();
592}
593
595{
596 // collect styles
597 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
598 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
599 aStyle._set |= 0x1;
600 if (readProp( "TextColor" ) >>= aStyle._textColor)
601 aStyle._set |= 0x2;
602 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
603 aStyle._set |= 0x20;
604 if (readBorderProps( this, aStyle ))
605 aStyle._set |= 0x4;
606 if (readFontProps( this, aStyle ))
607 aStyle._set |= 0x8;
608 if (aStyle._set)
609 {
610 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
611 }
612
613 // collect elements
614 readDefaults();
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" );
619 readEvents();
620}
621
623{
624 // collect styles
625 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
626 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
627 aStyle._set |= 0x1;
628 if (readBorderProps( this, aStyle ))
629 aStyle._set |= 0x4;
630 if (aStyle._set)
631 {
632 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
633 }
634
635 // collect elements
636 readDefaults();
637 readBoolAttr( "Tabstop", XMLNS_DIALOGS_PREFIX ":tabstop" );
638 readSelectionTypeAttr( "SelectionType", XMLNS_DIALOGS_PREFIX ":selectiontype" );
639
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" );
646 readEvents();
647}
648
650{
651 // collect styles
652 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
653 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
654 aStyle._set |= 0x1;
655 if (readProp( "TextColor" ) >>= aStyle._textColor)
656 aStyle._set |= 0x2;
657 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
658 aStyle._set |= 0x20;
659 if (readBorderProps( this, aStyle ))
660 aStyle._set |= 0x4;
661 if (readFontProps( this, aStyle ))
662 aStyle._set |= 0x8;
663 if (aStyle._set)
664 {
665 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
666 }
667
668 // collect elements
669 readDefaults();
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" );
688 readEvents();
689}
690
692{
693 // collect styles
694 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
695 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
696 aStyle._set |= 0x1;
697 if (readProp( "TextColor" ) >>= aStyle._textColor)
698 aStyle._set |= 0x2;
699 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
700 aStyle._set |= 0x20;
701 if (readBorderProps( this, aStyle ))
702 aStyle._set |= 0x4;
703 if (readFontProps( this, aStyle ))
704 aStyle._set |= 0x8;
705 if (aStyle._set)
706 {
707 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
708 }
709
710 // collect elements
711 readDefaults();
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" );
729 readEvents();
730}
731
733{
734 // collect styles
735 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
736 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
737 aStyle._set |= 0x1;
738 if (readProp( "TextColor" ) >>= aStyle._textColor)
739 aStyle._set |= 0x2;
740 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
741 aStyle._set |= 0x20;
742 if (readBorderProps( this, aStyle ))
743 aStyle._set |= 0x4;
744 if (readFontProps( this, aStyle ))
745 aStyle._set |= 0x8;
746 if (aStyle._set)
747 {
748 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
749 }
750
751 // collect elements
752 readDefaults();
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" );
769 readEvents();
770}
771
773{
774 // collect styles
775 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
776 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
777 aStyle._set |= 0x1;
778 if (readProp( "TextColor" ) >>= aStyle._textColor)
779 aStyle._set |= 0x2;
780 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
781 aStyle._set |= 0x20;
782 if (readBorderProps( this, aStyle ))
783 aStyle._set |= 0x4;
784 if (readFontProps( this, aStyle ))
785 aStyle._set |= 0x8;
786 if (aStyle._set)
787 {
788 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
789 }
790
791 // collect elements
792 readDefaults();
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" );
806 readEvents();
807}
808
810{
811 // collect styles
812 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
813 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
814 aStyle._set |= 0x1;
815 if (readProp( "TextColor" ) >>= aStyle._textColor)
816 aStyle._set |= 0x2;
817 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
818 aStyle._set |= 0x20;
819 if (readBorderProps( this, aStyle ))
820 aStyle._set |= 0x4;
821 if (readFontProps( this, aStyle ))
822 aStyle._set |= 0x8;
823 if (aStyle._set)
824 {
825 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
826 }
827
828 // collect elements
829 readDefaults();
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" );
838 readEvents();
839}
840
842{
843 // collect styles
844 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
845 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
846 aStyle._set |= 0x1;
847 if (readProp( "TextColor" ) >>= aStyle._textColor)
848 aStyle._set |= 0x2;
849 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
850 aStyle._set |= 0x20;
851 if (readBorderProps( this, aStyle ))
852 aStyle._set |= 0x4;
853 if (readFontProps( this, aStyle ))
854 aStyle._set |= 0x8;
855 if (aStyle._set)
856 {
857 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
858 }
859
860 // collect elements
861 readDefaults();
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 */ );
872
873 Any a( readProp( "EffectiveDefault" ) );
874 switch (a.getValueTypeClass())
875 {
876 case TypeClass_DOUBLE:
877 addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", OUString::number( *o3tl::forceAccess<double>(a) ) );
878 break;
879 case TypeClass_STRING:
880 addAttribute( XMLNS_DIALOGS_PREFIX ":value-default", *o3tl::forceAccess<OUString>(a) );
881 break;
882 default:
883 break;
884 }
885 readDoubleAttr( "EffectiveMin", XMLNS_DIALOGS_PREFIX ":value-min" );
886 readDoubleAttr( "EffectiveMax", XMLNS_DIALOGS_PREFIX ":value-max" );
887 readDoubleAttr( "EffectiveValue", XMLNS_DIALOGS_PREFIX ":value" );
888
889 // format spec
890 sal_Int32 nKey = 0;
891 if (readProp( "FormatKey" ) >>= nKey)
892 {
893 Reference< util::XNumberFormatsSupplier > xSupplier;
894 if (readProp( "FormatsSupplier" ) >>= xSupplier)
895 {
897 xSupplier->getNumberFormats()->getByKey( nKey ) );
898 }
899 }
900 readBoolAttr( "TreatAsNumber", XMLNS_DIALOGS_PREFIX ":treat-as-number" );
901 readBoolAttr( "EnforceFormat", XMLNS_DIALOGS_PREFIX ":enforce-format" );
902
903 readEvents();
904}
905
907{
908 // collect styles
909 Style aStyle( 0x1 | 0x4 );
910 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
911 aStyle._set |= 0x1;
912 if (readBorderProps( this, aStyle ))
913 aStyle._set |= 0x4;
914 if (aStyle._set)
915 {
916 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
917 }
918
919 // collect elements
920 readDefaults();
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" );
931 readEvents();
932}
933
935{
936 // collect styles
937 Style aStyle( 0x2 | 0x8 | 0x20 );
938 if (readProp( "TextColor" ) >>= aStyle._textColor)
939 aStyle._set |= 0x2;
940 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
941 aStyle._set |= 0x20;
942 if (readFontProps( this, aStyle ))
943 aStyle._set |= 0x8;
944 if (aStyle._set)
945 {
946 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
947 }
948
949 // collect elements
950 readDefaults();
951 readStringAttr( "Label", XMLNS_DIALOGS_PREFIX ":value" );
952 readOrientationAttr( "Orientation", XMLNS_DIALOGS_PREFIX ":align" );
953 readEvents();
954}
955
957{
958 // collect styles
959 Style aStyle( 0x1 | 0x4 | 0x10 );
960 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
961 aStyle._set |= 0x1;
962 if (readBorderProps( this, aStyle ))
963 aStyle._set |= 0x4;
964 if (readProp( "FillColor" ) >>= aStyle._descr)
965 aStyle._set |= 0x10;
966 if (aStyle._set)
967 {
968 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
969 }
970
971 // collect elements
972 readDefaults();
973 readLongAttr( "ProgressValue", XMLNS_DIALOGS_PREFIX ":value" );
974 readLongAttr( "ProgressValueMin", XMLNS_DIALOGS_PREFIX ":value-min" );
975 readLongAttr( "ProgressValueMax", XMLNS_DIALOGS_PREFIX ":value-max" );
976 readEvents();
977}
978
980{
981 // collect styles
982 Style aStyle( 0x1 | 0x4 );
983 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
984 aStyle._set |= 0x1;
985 if (readBorderProps( this, aStyle ))
986 aStyle._set |= 0x4;
987 if (aStyle._set)
988 {
989 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
990 }
991
992 // collect elements
993 readDefaults();
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" );
1006 readEvents();
1007}
1008
1010{
1011 // collect styles
1012 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 );
1013 if (readProp("BackgroundColor") >>= aStyle._backgroundColor)
1014 aStyle._set |= 0x1;
1015 if (readBorderProps( this, aStyle ))
1016 aStyle._set |= 0x4;
1017 if (readProp("TextColor") >>= aStyle._textColor)
1018 aStyle._set |= 0x2;
1019 if (readProp("TextLineColor") >>= aStyle._textLineColor)
1020 aStyle._set |= 0x20;
1021 if (readFontProps( this, aStyle ))
1022 aStyle._set |= 0x8;
1023 if (aStyle._set)
1024 {
1025 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id",all_styles->getStyleId( aStyle ) );
1026 }
1027 // collect elements
1028 readDefaults();
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");
1042 readEvents();
1043}
1044
1046{
1047 // collect elements
1050
1051 // collect styles
1052 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 );
1053 if (readProp( "BackgroundColor" ) >>= aStyle._backgroundColor)
1054 aStyle._set |= 0x1;
1055 if (readProp( "TextColor" ) >>= aStyle._textColor)
1056 aStyle._set |= 0x2;
1057 if (readProp( "TextLineColor" ) >>= aStyle._textLineColor)
1058 aStyle._set |= 0x20;
1059 if (readFontProps( this, aStyle ))
1060 aStyle._set |= 0x8;
1061 if (aStyle._set)
1062 {
1063 addAttribute( XMLNS_DIALOGS_PREFIX ":style-id", all_styles->getStyleId( aStyle ) );
1064 }
1065
1066 // collect elements
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" );
1072
1074 Any aDecorationAny( _xProps->getPropertyValue( "Decoration" ) );
1075 bool bDecoration = false;
1076 if ( (aDecorationAny >>= bDecoration) && !bDecoration )
1077 addAttribute( XMLNS_DIALOGS_PREFIX ":withtitlebar", "false" );
1079 readEvents();
1080}
1081
1083{
1084 // collect elements
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() );
1091
1093
1094 for ( const auto& rElement : aElements )
1095 {
1096 Any aControlModel( xDialogModel->getByName( rElement ) );
1097 Reference< beans::XPropertySet > xProps;
1098 OSL_VERIFY( aControlModel >>= xProps );
1099 if (! xProps.is())
1100 continue;
1101 Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY );
1102 OSL_ENSURE( xPropState.is(), "no XPropertyState!" );
1103 if (! xPropState.is())
1104 continue;
1105 Reference< lang::XServiceInfo > xServiceInfo( xProps, UNO_QUERY );
1106 OSL_ENSURE( xServiceInfo.is(), "no XServiceInfo!" );
1107 if (! xServiceInfo.is())
1108 continue;
1109
1111
1112 // group up radio buttons
1113 if ( xServiceInfo->supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) )
1114 {
1115 if (! pRadioGroup) // open radiogroup
1116 {
1117 pRadioGroup = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":radiogroup", _xDocument );
1118 all_elements.push_back( pRadioGroup );
1119 }
1120
1121 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":radio", _xDocument );
1122 pElem->readRadioButtonModel( all_styles );
1123 pRadioGroup->addSubElement( pElem );
1124 }
1125 else // no radio
1126 {
1127 pRadioGroup = nullptr; // close radiogroup
1128
1129 if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlButtonModel" ) )
1130 {
1131 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":button", _xDocument );
1132 pElem->readButtonModel( all_styles );
1133 }
1134 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) )
1135 {
1136 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":checkbox", _xDocument );
1137 pElem->readCheckBoxModel( all_styles );
1138 }
1139 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlComboBoxModel" ) )
1140 {
1141 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":combobox", _xDocument );
1142 pElem->readComboBoxModel( all_styles );
1143 }
1144 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlListBoxModel" ) )
1145 {
1146 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":menulist", _xDocument );
1147 pElem->readListBoxModel( all_styles );
1148 }
1149 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlGroupBoxModel" ) )
1150 {
1151 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":titledbox", _xDocument );
1152 pElem->readGroupBoxModel( all_styles );
1153 }
1154 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoMultiPageModel" ) )
1155 {
1156 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":multipage", _xDocument );
1157 pElem->readMultiPageModel( all_styles );
1158 }
1159 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoFrameModel" ) )
1160 {
1161 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":frame", _xDocument );
1162 pElem->readFrameModel( all_styles );
1163 }
1164 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoPageModel" ) )
1165 {
1166 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":page", _xDocument );
1167 pElem->readPageModel( all_styles );
1168 }
1169 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFixedTextModel" ) )
1170 {
1171 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":text", _xDocument );
1172 pElem->readFixedTextModel( all_styles );
1173 }
1174 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlEditModel" ) )
1175 {
1176 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":textfield", _xDocument );
1177 pElem->readEditModel( all_styles );
1178 }
1179 // FixedHyperLink
1180 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) )
1181 {
1182 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":linklabel", _xDocument );
1183 pElem->readFixedHyperLinkModel( all_styles );
1184 }
1185 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlImageControlModel" ) )
1186 {
1187 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":img", _xDocument );
1188 pElem->readImageControlModel( all_styles );
1189 }
1190 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFileControlModel" ) )
1191 {
1192 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":filecontrol", _xDocument );
1193 pElem->readFileControlModel( all_styles );
1194 }
1195 else if (xServiceInfo->supportsService( "com.sun.star.awt.tree.TreeControlModel" ) )
1196 {
1197 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":treecontrol", _xDocument );
1198 pElem->readTreeControlModel( all_styles );
1199 }
1200 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlCurrencyFieldModel" ) )
1201 {
1202 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":currencyfield", _xDocument );
1203 pElem->readCurrencyFieldModel( all_styles );
1204 }
1205 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlDateFieldModel" ) )
1206 {
1207 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":datefield", _xDocument );
1208 pElem->readDateFieldModel( all_styles );
1209 }
1210 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlNumericFieldModel" ) )
1211 {
1212 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":numericfield", _xDocument );
1213 pElem->readNumericFieldModel( all_styles );
1214 }
1215 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlTimeFieldModel" ) )
1216 {
1217 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":timefield", _xDocument);
1218 pElem->readTimeFieldModel( all_styles );
1219 }
1220 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlPatternFieldModel" ) )
1221 {
1222 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":patternfield", _xDocument );
1223 pElem->readPatternFieldModel( all_styles );
1224 }
1225 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFormattedFieldModel" ) )
1226 {
1227 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":formattedfield", _xDocument );
1228 pElem->readFormattedFieldModel( all_styles );
1229 }
1230 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlFixedLineModel" ) )
1231 {
1232 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":fixedline", _xDocument );
1233 pElem->readFixedLineModel( all_styles );
1234 }
1235 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlScrollBarModel" ) )
1236 {
1237 pElem = new ElementDescriptor(xProps, xPropState, XMLNS_DIALOGS_PREFIX ":scrollbar", _xDocument );
1238 pElem->readScrollBarModel( all_styles );
1239 }
1240 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlSpinButtonModel" ) )
1241 {
1242 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":spinbutton", _xDocument );
1243 pElem->readSpinButtonModel( all_styles );
1244 }
1245 else if (xServiceInfo->supportsService( "com.sun.star.awt.UnoControlProgressBarModel" ) )
1246 {
1247 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":progressmeter", _xDocument );
1248 pElem->readProgressBarModel( all_styles );
1249 }
1250 else if (xServiceInfo->supportsService( "com.sun.star.awt.grid.UnoControlGridModel" ) )
1251 {
1252 pElem = new ElementDescriptor( xProps, xPropState, XMLNS_DIALOGS_PREFIX ":table", _xDocument );
1253 pElem->readGridControlModel( all_styles );
1254 }
1255
1256 if (pElem)
1257 {
1258 all_elements.push_back( pElem );
1259 }
1260 else
1261 {
1262 OSL_FAIL( "unknown control type!" );
1263 continue;
1264 }
1265 }
1266 }
1267 for (const rtl::Reference<ElementDescriptor> & p : all_elements)
1268 {
1269 addSubElement( p );
1270 }
1271}
1272
1273}
1274
1275/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void readBoolAttr(OUString const &rPropName, OUString const &rAttrName)
Definition: exp_share.hxx:241
void readFrameModel(StyleBag *all_styles)
css::uno::Reference< css::beans::XPropertyState > _xPropState
Definition: exp_share.hxx:92
void readTimeAttr(OUString const &rPropName, OUString const &rAttrName)
void readLongAttr(OUString const &rPropName, OUString const &rAttrName, bool forceAttribute=false)
Definition: exp_share.hxx:125
void readBullitinBoard(StyleBag *all_styles)
void readImageControlModel(StyleBag *all_styles)
void readFixedHyperLinkModel(StyleBag *all_styles)
void readGridControlModel(StyleBag *all_styles)
void readDateAttr(OUString const &rPropName, OUString const &rAttrName)
void readImageOrGraphicAttr(OUString const &rAttrName)
void readDataAwareAttr(OUString const &rAttrName)
void readCheckBoxModel(StyleBag *all_styles)
void readDialogModel(StyleBag *all_styles)
void readDateFormatAttr(OUString const &rPropName, OUString const &rAttrName)
void readFileControlModel(StyleBag *all_styles)
void readListBoxModel(StyleBag *all_styles)
void readScrollBarModel(StyleBag *all_styles)
void readImageAlignAttr(OUString const &rPropName, OUString const &rAttrName)
void readAlignAttr(OUString const &rPropName, OUString const &rAttrName)
void readFormattedFieldModel(StyleBag *all_styles)
void readDateFieldModel(StyleBag *all_styles)
void readRadioButtonModel(StyleBag *all_styles)
void readDoubleAttr(OUString const &rPropName, OUString const &rAttrName)
Definition: exp_share.hxx:122
void readShortAttr(OUString const &rPropName, OUString const &rAttrName)
Definition: exp_share.hxx:131
void readMultiPageModel(StyleBag *all_styles)
void readPageModel(StyleBag *all_styles)
void readSpinButtonModel(StyleBag *all_styles)
css::uno::Reference< css::frame::XModel > _xDocument
Definition: exp_share.hxx:93
void readCurrencyFieldModel(StyleBag *all_styles)
void readSelectionTypeAttr(OUString const &rPropName, OUString const &rAttrName)
void readStringAttr(OUString const &rPropName, OUString const &rAttrName)
void readLineEndFormatAttr(OUString const &rPropName, OUString const &rAttrName)
void readProgressBarModel(StyleBag *all_styles)
void readTimeFormatAttr(OUString const &rPropName, OUString const &rAttrName)
void readVerticalAlignAttr(OUString const &rPropName, OUString const &rAttrName)
void addNumberFormatAttr(css::uno::Reference< css::beans::XPropertySet > const &xFormatProperties)
void readButtonTypeAttr(OUString const &rPropName, OUString const &rAttrName)
void readEditModel(StyleBag *all_styles)
void readTreeControlModel(StyleBag *all_styles)
void readTimeFieldModel(StyleBag *all_styles)
void readDefaults(bool supportPrintable=true, bool supportVisible=true)
css::uno::Reference< css::beans::XPropertySet > _xProps
Definition: exp_share.hxx:91
void readPatternFieldModel(StyleBag *all_styles)
void readFixedTextModel(StyleBag *all_styles)
void readNumericFieldModel(StyleBag *all_styles)
void readHexLongAttr(OUString const &rPropName, OUString const &rAttrName)
void readButtonModel(StyleBag *all_styles)
ElementDescriptor(css::uno::Reference< css::beans::XPropertySet > xProps, css::uno::Reference< css::beans::XPropertyState > xPropState, OUString const &name, css::uno::Reference< css::frame::XModel > xDocument)
Definition: exp_share.hxx:96
void readOrientationAttr(OUString const &rPropName, OUString const &rAttrName)
bool readProp(T *ret, OUString const &rPropName)
Definition: exp_share.hxx:248
void readFixedLineModel(StyleBag *all_styles)
void readImagePositionAttr(OUString const &rPropName, OUString const &rAttrName)
void readComboBoxModel(StyleBag *all_styles)
void readGroupBoxModel(StyleBag *all_styles)
void readImageScaleModeAttr(OUString const &rPropName, OUString const &rAttrName)
OUString getStyleId(Style const &rStyle)
void addAttribute(OUString const &rAttrName, OUString const &rValue)
Adds an attribute to elements.
Definition: xml_element.cxx:31
void addSubElement(css::uno::Reference< css::xml::sax::XAttributeList > const &xElem)
Adds a sub element of element.
Definition: xml_element.cxx:37
sal_Int32 nState
void * p
uno_Any a
sal_uInt16 nPos
const sal_Int16 BORDER_SIMPLE
Definition: common.hxx:28
static bool readBorderProps(ElementDescriptor *element, Style &style)
const sal_Int16 BORDER_SIMPLE_COLOR
Definition: common.hxx:29
static bool readFontProps(ElementDescriptor *element, Style &style)
css::awt::FontDescriptor _descr
Definition: exp_share.hxx:46
sal_uInt16 _fontEmphasisMark
Definition: exp_share.hxx:48
sal_uInt32 _textColor
Definition: exp_share.hxx:42
sal_Int16 _visualEffect
Definition: exp_share.hxx:50
sal_Int32 _borderColor
Definition: exp_share.hxx:45
sal_uInt32 _textLineColor
Definition: exp_share.hxx:43
sal_uInt16 _fontRelief
Definition: exp_share.hxx:47
sal_Int16 _border
Definition: exp_share.hxx:44
sal_uInt32 _backgroundColor
Definition: exp_share.hxx:41
sal_uInt16 sal_Unicode
#define XMLNS_SCRIPT_PREFIX
Definition: xmlns.h:27
#define XMLNS_DIALOGS_PREFIX
Definition: xmlns.h:24
constexpr OUStringLiteral XMLNS_DIALOGS_URI
Definition: xmlns.h:23
constexpr OUStringLiteral XMLNS_SCRIPT_URI
Definition: xmlns.h:26