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