Bump for 3.6-28
[LibreOffice.git] / xmlscript / source / xmldlg_imexp / xmldlg_impmodels.cxx
blob5f0ae626e299d083f2055bae1021cd0a0beb0bd8
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 "imp_share.hxx"
30 #include <com/sun/star/form/binding/XBindableValue.hpp>
31 #include <com/sun/star/form/binding/XValueBinding.hpp>
32 #include <com/sun/star/form/binding/XListEntrySink.hpp>
33 #include <com/sun/star/beans/NamedValue.hpp>
34 #include <com/sun/star/table/CellAddress.hpp>
35 #include <com/sun/star/table/CellRangeAddress.hpp>
36 #include <com/sun/star/beans/XPropertySet.hpp>
37 #include <com/sun/star/beans/XPropertyState.hpp>
38 #include <com/sun/star/document/XStorageBasedDocument.hpp>
39 #include <com/sun/star/document/XGraphicObjectResolver.hpp>
40 #include <com/sun/star/script/vba/XVBACompatibility.hpp>
42 #include <comphelper/componentcontext.hxx>
43 #include <comphelper/processfactory.hxx>
44 using namespace ::com::sun::star;
45 using namespace ::com::sun::star::uno;
46 using ::rtl::OUString;
48 namespace xmlscript
51 Reference< xml::input::XElement > Frame::startChildElement(
52 sal_Int32 nUid, OUString const & rLocalName,
53 Reference< xml::input::XAttributes > const & xAttributes )
54 throw (xml::sax::SAXException, RuntimeException)
56 if ( !m_xContainer.is() )
57 m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( rtl::OUString( "com.sun.star.awt.UnoFrameModel" ) ), UNO_QUERY );
58 // event
59 if (_pImport->isEventElement( nUid, rLocalName ))
61 return new EventElement(
62 nUid, rLocalName, xAttributes, this, _pImport );
64 else if ( rLocalName == "bulletinboard" )
66 // Create new DialogImport for this container
67 DialogImport* pFrameImport = new DialogImport( *_pImport );
68 pFrameImport->_xDialogModel = m_xContainer;
69 return new BulletinBoardElement( rLocalName, xAttributes, this, pFrameImport );
71 else if ( rLocalName == "title" )
73 getStringAttr( &_label,
74 OUString( "value" ),
75 xAttributes,
76 _pImport->XMLNS_DIALOGS_UID );
78 return new ElementBase(
79 _pImport->XMLNS_DIALOGS_UID,
80 rLocalName, xAttributes, this, _pImport );
82 else
84 OSL_TRACE("****** ARGGGGG!!!! **********");
85 throw xml::sax::SAXException(
86 OUString( "expected event element!" ),
87 Reference< XInterface >(), Any() );
90 //__________________________________________________________________________________________________
92 void Frame::endElement()
93 throw (xml::sax::SAXException, RuntimeException)
95 if ( !m_xContainer.is() )
96 m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( rtl::OUString( "com.sun.star.awt.UnoFrameModel" ) ), UNO_QUERY );
97 Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
98 // _pImport is what we need to add to ( e.g. the dialog in this case )
99 ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ) );
101 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
103 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
104 if (xStyle.is())
106 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
107 pStyle->importTextColorStyle( xControlModel );
108 pStyle->importTextLineColorStyle( xControlModel );
109 pStyle->importFontStyle( xControlModel );
112 ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
113 if (!_label.isEmpty())
115 xControlModel->setPropertyValue( OUString( "Label" ),
116 makeAny( _label ) );
118 ctx.importEvents( _events );
119 // avoid ring-reference:
120 // vector< event elements > holding event elements holding this (via _pParent)
121 _events.clear();
124 //===
125 Reference< xml::input::XElement > MultiPage::startChildElement(
126 sal_Int32 nUid, OUString const & rLocalName,
127 Reference< xml::input::XAttributes > const & xAttributes )
128 throw (xml::sax::SAXException, RuntimeException)
130 // event
131 if (_pImport->isEventElement( nUid, rLocalName ))
133 return new EventElement(
134 nUid, rLocalName, xAttributes, this, _pImport );
136 else if ( rLocalName == "bulletinboard" )
138 // Create new DialogImport for this container
140 DialogImport* pMultiPageImport = new DialogImport( *_pImport );
141 pMultiPageImport->_xDialogModel = m_xContainer;
142 return new BulletinBoardElement( rLocalName, xAttributes, this, pMultiPageImport );
144 else
147 throw xml::sax::SAXException(
148 OUString( "expected event element!" ),
149 Reference< XInterface >(), Any() );
152 //__________________________________________________________________________________________________
154 void MultiPage::endElement()
155 throw (xml::sax::SAXException, RuntimeException)
157 Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
158 // _pImport is what we need to add to ( e.g. the dialog in this case )
159 ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ));
161 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
163 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
164 if (xStyle.is())
166 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
167 pStyle->importTextColorStyle( xControlModel );
168 pStyle->importTextLineColorStyle( xControlModel );
169 pStyle->importFontStyle( xControlModel );
170 pStyle->importBackgroundColorStyle( xControlModel );
173 ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
174 ctx.importLongProperty( OUString( "MultiPageValue" ),
175 OUString( "value" ),
176 _xAttributes );
177 ctx.importBooleanProperty(
178 OUString( "Decoration" ),
179 OUString( "withtabs" ),
180 _xAttributes );
181 ctx.importEvents( _events );
182 // avoid ring-reference:
183 // vector< event elements > holding event elements holding this (via _pParent)
184 _events.clear();
187 Reference< xml::input::XElement > Page::startChildElement(
188 sal_Int32 nUid, OUString const & rLocalName,
189 Reference< xml::input::XAttributes > const & xAttributes )
190 throw (xml::sax::SAXException, RuntimeException)
192 // event
193 if (_pImport->isEventElement( nUid, rLocalName ))
195 return new EventElement(
196 nUid, rLocalName, xAttributes, this, _pImport );
198 else if ( rLocalName == "bulletinboard" )
201 DialogImport* pPageImport = new DialogImport( *_pImport );
202 pPageImport->_xDialogModel = m_xContainer;
203 return new BulletinBoardElement( rLocalName, xAttributes, this, pPageImport );
205 else
208 throw xml::sax::SAXException(
209 OUString( "expected event element!" ),
210 Reference< XInterface >(), Any() );
213 //__________________________________________________________________________________________________
215 void Page::endElement()
216 throw (xml::sax::SAXException, RuntimeException)
218 Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW );
220 ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ));
222 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
224 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
225 if (xStyle.is())
227 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
228 pStyle->importTextColorStyle( xControlModel );
229 pStyle->importTextLineColorStyle( xControlModel );
230 pStyle->importFontStyle( xControlModel );
231 pStyle->importBackgroundColorStyle( xControlModel );
234 ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
235 ctx.importStringProperty( OUString( "Title" ), OUString( "title" ), _xAttributes );
236 ctx.importEvents( _events );
237 // avoid ring-reference:
238 // vector< event elements > holding event elements holding this (via _pParent)
239 _events.clear();
242 // progessmeter
243 //__________________________________________________________________________________________________
244 Reference< xml::input::XElement > ProgressBarElement::startChildElement(
245 sal_Int32 nUid, OUString const & rLocalName,
246 Reference< xml::input::XAttributes > const & xAttributes )
247 throw (xml::sax::SAXException, RuntimeException)
249 // event
250 if (_pImport->isEventElement( nUid, rLocalName ))
252 return new EventElement(
253 nUid, rLocalName, xAttributes, this, _pImport );
255 else
257 throw xml::sax::SAXException(
258 OUString( "expected event element!" ),
259 Reference< XInterface >(), Any() );
262 //__________________________________________________________________________________________________
263 void ProgressBarElement::endElement()
264 throw (xml::sax::SAXException, RuntimeException)
266 ControlImportContext ctx(
267 _pImport, getControlId( _xAttributes ),
268 OUString( "com.sun.star.awt.UnoControlProgressBarModel" ) );
270 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
271 if (xStyle.is())
273 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
274 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
275 pStyle->importBackgroundColorStyle( xControlModel );
276 pStyle->importBorderStyle( xControlModel );
277 pStyle->importFillColorStyle( xControlModel );
280 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
281 ctx.importLongProperty( OUString( "ProgressValue" ),
282 OUString( "value" ),
283 _xAttributes );
284 ctx.importLongProperty( OUString( "ProgressValueMin" ),
285 OUString( "value-min" ),
286 _xAttributes );
287 ctx.importLongProperty( OUString( "ProgressValueMax" ),
288 OUString( "value-max" ),
289 _xAttributes );
290 ctx.importEvents( _events );
291 // avoid ring-reference:
292 // vector< event elements > holding event elements holding this (via _pParent)
293 _events.clear();
296 //##################################################################################################
298 // scrollbar
299 //__________________________________________________________________________________________________
300 Reference< xml::input::XElement > ScrollBarElement::startChildElement(
301 sal_Int32 nUid, OUString const & rLocalName,
302 Reference< xml::input::XAttributes > const & xAttributes )
303 throw (xml::sax::SAXException, RuntimeException)
305 // event
306 if (_pImport->isEventElement( nUid, rLocalName ))
308 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
310 else
312 throw xml::sax::SAXException(
313 OUString( "expected event element!" ),
314 Reference< XInterface >(), Any() );
317 //__________________________________________________________________________________________________
318 void ScrollBarElement::endElement()
319 throw (xml::sax::SAXException, RuntimeException)
321 ControlImportContext ctx(
322 _pImport, getControlId( _xAttributes ),
323 getControlModelName( OUString( "com.sun.star.awt.UnoControlScrollBarModel" ), _xAttributes ) );
325 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
326 if (xStyle.is())
328 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
329 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
330 pStyle->importBackgroundColorStyle( xControlModel );
331 pStyle->importBorderStyle( xControlModel );
334 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
335 ctx.importOrientationProperty( OUString( "Orientation" ),
336 OUString( "align" ),
337 _xAttributes );
338 ctx.importLongProperty( OUString( "BlockIncrement" ),
339 OUString( "pageincrement" ),
340 _xAttributes );
341 ctx.importLongProperty( OUString( "LineIncrement" ),
342 OUString( "increment" ),
343 _xAttributes );
344 ctx.importLongProperty( OUString( "ScrollValue" ),
345 OUString( "curpos" ),
346 _xAttributes );
347 ctx.importLongProperty( OUString( "ScrollValueMax" ),
348 OUString( "maxpos" ),
349 _xAttributes );
350 ctx.importLongProperty( OUSTR("ScrollValueMin"), OUSTR("minpos"),
351 _xAttributes );
352 ctx.importLongProperty( OUString( "VisibleSize" ),
353 OUString( "visible-size" ),
354 _xAttributes );
355 ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
356 _xAttributes );
357 ctx.importBooleanProperty( OUString( "Tabstop" ),
358 OUString( "tabstop" ),
359 _xAttributes );
360 ctx.importBooleanProperty( OUString( "LiveScroll" ),
361 OUString( "live-scroll" ),
362 _xAttributes );
363 ctx.importHexLongProperty( OUString( "SymbolColor" ),
364 OUString( "symbol-color" ),
365 _xAttributes );
367 ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes );
368 ctx.importEvents( _events );
369 // avoid ring-reference:
370 // vector< event elements > holding event elements holding this (via _pParent)
371 _events.clear();
374 //##################################################################################################
376 // spinbutton
377 //__________________________________________________________________________________________________
378 Reference< xml::input::XElement > SpinButtonElement::startChildElement(
379 sal_Int32 nUid, OUString const & rLocalName,
380 Reference< xml::input::XAttributes > const & xAttributes )
381 throw (xml::sax::SAXException, RuntimeException)
383 // event
384 if (_pImport->isEventElement( nUid, rLocalName ))
386 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
388 else
390 throw xml::sax::SAXException(
391 OUString( "expected event element!" ),
392 Reference< XInterface >(), Any() );
395 //__________________________________________________________________________________________________
396 void SpinButtonElement::endElement()
397 throw (xml::sax::SAXException, RuntimeException)
399 ControlImportContext ctx(
400 _pImport, getControlId( _xAttributes ),
401 getControlModelName( OUString( "com.sun.star.awt.UnoControlSpinButtonModel" ), _xAttributes ) );
403 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
404 if (xStyle.is())
406 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
407 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
408 pStyle->importBackgroundColorStyle( xControlModel );
409 pStyle->importBorderStyle( xControlModel );
412 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
413 ctx.importOrientationProperty( OUString( "Orientation" ),
414 OUString( "align" ),
415 _xAttributes );
416 ctx.importLongProperty( OUString( "SpinIncrement" ),
417 OUString( "increment" ),
418 _xAttributes );
419 ctx.importLongProperty( OUString( "SpinValue" ),
420 OUString( "curval" ),_xAttributes );
421 ctx.importLongProperty( OUString( "SpinValueMax" ),
422 OUString( "maxval" ), _xAttributes );
423 ctx.importLongProperty( OUSTR("SpinValueMin"), OUSTR("minval"),
424 _xAttributes );
425 ctx.importLongProperty( OUSTR("Repeat"), OUSTR("repeat"), _xAttributes );
426 ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat-delay"),
427 _xAttributes );
428 ctx.importBooleanProperty( OUString( "Tabstop" ),
429 OUString( "tabstop" ), _xAttributes );
430 ctx.importHexLongProperty( OUString( "SymbolColor" ),
431 OUString( "symbol-color" ), _xAttributes );
432 ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes );
433 ctx.importEvents( _events );
434 // avoid ring-reference:
435 // vector< event elements > holding event elements holding this (via _pParent)
436 _events.clear();
439 //##################################################################################################
441 // fixedline
442 //__________________________________________________________________________________________________
443 Reference< xml::input::XElement > FixedLineElement::startChildElement(
444 sal_Int32 nUid, OUString const & rLocalName,
445 Reference< xml::input::XAttributes > const & xAttributes )
446 throw (xml::sax::SAXException, RuntimeException)
448 // event
449 if (_pImport->isEventElement( nUid, rLocalName ))
451 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
453 else
455 throw xml::sax::SAXException(
456 OUString( "expected event element!" ),
457 Reference< XInterface >(), Any() );
460 //__________________________________________________________________________________________________
461 void FixedLineElement::endElement()
462 throw (xml::sax::SAXException, RuntimeException)
464 ControlImportContext ctx(
465 _pImport, getControlId( _xAttributes ),
466 OUString( "com.sun.star.awt.UnoControlFixedLineModel" ) );
468 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
469 if (xStyle.is())
471 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
472 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
473 pStyle->importTextColorStyle( xControlModel );
474 pStyle->importTextLineColorStyle( xControlModel );
475 pStyle->importFontStyle( xControlModel );
478 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
479 ctx.importStringProperty( OUString( "Label" ),
480 OUString( "value" ),
481 _xAttributes );
482 ctx.importOrientationProperty( OUString( "Orientation" ),
483 OUString( "align" ),
484 _xAttributes );
485 ctx.importEvents( _events );
486 // avoid ring-reference:
487 // vector< event elements > holding event elements holding this (via _pParent)
488 _events.clear();
491 //##################################################################################################
493 // patternfield
494 //__________________________________________________________________________________________________
495 Reference< xml::input::XElement > PatternFieldElement::startChildElement(
496 sal_Int32 nUid, OUString const & rLocalName,
497 Reference< xml::input::XAttributes > const & xAttributes )
498 throw (xml::sax::SAXException, RuntimeException)
500 // event
501 if (_pImport->isEventElement( nUid, rLocalName ))
503 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
505 else
507 throw xml::sax::SAXException(
508 OUString( "expected event element!" ),
509 Reference< XInterface >(), Any() );
512 //__________________________________________________________________________________________________
513 void PatternFieldElement::endElement()
514 throw (xml::sax::SAXException, RuntimeException)
516 ControlImportContext ctx(
517 _pImport, getControlId( _xAttributes ),
518 OUString( "com.sun.star.awt.UnoControlPatternFieldModel" ) );
520 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
521 if (xStyle.is())
523 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
524 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
525 pStyle->importBackgroundColorStyle( xControlModel );
526 pStyle->importTextColorStyle( xControlModel );
527 pStyle->importTextLineColorStyle( xControlModel );
528 pStyle->importBorderStyle( xControlModel );
529 pStyle->importFontStyle( xControlModel );
532 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
533 ctx.importBooleanProperty( OUString( "Tabstop" ),
534 OUString( "tabstop" ),
535 _xAttributes );
536 ctx.importBooleanProperty( OUString( "ReadOnly" ),
537 OUString( "readonly" ),
538 _xAttributes );
539 ctx.importBooleanProperty( OUString( "StrictFormat" ),
540 OUString( "strict-format" ),
541 _xAttributes );
542 ctx.importBooleanProperty(
543 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
544 _xAttributes );
545 ctx.importStringProperty( OUString( "Text" ),
546 OUString( "value" ),
547 _xAttributes );
548 ctx.importShortProperty( OUString( "MaxTextLen" ),
549 OUString( "maxlength" ),
550 _xAttributes );
551 ctx.importStringProperty( OUString( "EditMask" ),
552 OUString( "edit-mask" ),
553 _xAttributes );
554 ctx.importStringProperty( OUString( "LiteralMask" ),
555 OUString( "literal-mask" ),
556 _xAttributes );
557 ctx.importEvents( _events );
558 // avoid ring-reference:
559 // vector< event elements > holding event elements holding this (via _pParent)
560 _events.clear();
563 //##################################################################################################
565 // formattedfield
566 //__________________________________________________________________________________________________
567 Reference< xml::input::XElement > FormattedFieldElement::startChildElement(
568 sal_Int32 nUid, OUString const & rLocalName,
569 Reference< xml::input::XAttributes > const & xAttributes )
570 throw (xml::sax::SAXException, RuntimeException)
572 // event
573 if (_pImport->isEventElement( nUid, rLocalName ))
575 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
577 else
579 throw xml::sax::SAXException(
580 OUString( "expected event element!" ),
581 Reference< XInterface >(), Any() );
584 //__________________________________________________________________________________________________
585 void FormattedFieldElement::endElement()
586 throw (xml::sax::SAXException, RuntimeException)
588 ControlImportContext ctx(
589 _pImport, getControlId( _xAttributes ),
590 OUString( "com.sun.star.awt.UnoControlFormattedFieldModel" ) );
592 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
593 if (xStyle.is())
595 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
596 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
597 pStyle->importBackgroundColorStyle( xControlModel );
598 pStyle->importTextColorStyle( xControlModel );
599 pStyle->importTextLineColorStyle( xControlModel );
600 pStyle->importBorderStyle( xControlModel );
601 pStyle->importFontStyle( xControlModel );
604 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
605 ctx.importBooleanProperty( OUString( "Tabstop" ),
606 OUString( "tabstop" ),
607 _xAttributes );
608 ctx.importBooleanProperty( OUString( "ReadOnly" ),
609 OUString( "readonly" ),
610 _xAttributes );
611 ctx.importBooleanProperty( OUString( "StrictFormat" ),
612 OUString( "strict-format" ),
613 _xAttributes );
614 ctx.importBooleanProperty(
615 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
616 _xAttributes );
617 ctx.importAlignProperty( OUString( "Align" ),
618 OUString( "align" ),
619 _xAttributes );
620 ctx.importDoubleProperty( OUString( "EffectiveMin" ),
621 OUString( "value-min" ),
622 _xAttributes );
623 ctx.importDoubleProperty( OUString( "EffectiveMax" ),
624 OUString( "value-max" ),
625 _xAttributes );
626 ctx.importDoubleProperty( OUString( "EffectiveValue" ),
627 OUString( "value" ),
628 _xAttributes );
629 ctx.importStringProperty( OUString( "Text" ),
630 OUString( "text" ),
631 _xAttributes );
632 ctx.importShortProperty( OUString( "MaxTextLen" ),
633 OUString( "maxlength" ),
634 _xAttributes );
635 ctx.importBooleanProperty( OUString( "Spin" ),
636 OUString( "spin" ),
637 _xAttributes );
638 if (ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
639 _xAttributes ))
640 ctx.getControlModel()->setPropertyValue(
641 OUSTR("Repeat"), makeAny(true) );
643 OUString sDefault(
644 _xAttributes->getValueByUidName(
645 _pImport->XMLNS_DIALOGS_UID,
646 OUString( "value-default" ) ) );
647 if (!sDefault.isEmpty())
649 double d = sDefault.toDouble();
650 if (d != 0.0 ||
651 sDefault.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("0") ) ||
652 sDefault.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("0.0") ))
654 ctx.getControlModel()->setPropertyValue(
655 OUString( "EffectiveDefault" ),
656 makeAny( d ) );
658 else // treat as string
660 ctx.getControlModel()->setPropertyValue(
661 OUString( "EffectiveDefault" ),
662 makeAny( sDefault ) );
666 // format spec
667 ctx.getControlModel()->setPropertyValue(
668 OUString( "FormatsSupplier" ),
669 makeAny( _pImport->getNumberFormatsSupplier() ) );
671 OUString sFormat(
672 _xAttributes->getValueByUidName(
673 _pImport->XMLNS_DIALOGS_UID,
674 OUString( "format-code" ) ) );
675 if (!sFormat.isEmpty())
677 lang::Locale locale;
679 OUString sLocale(
680 _xAttributes->getValueByUidName(
681 _pImport->XMLNS_DIALOGS_UID,
682 OUString( "format-locale" ) ) );
683 if (!sLocale.isEmpty())
685 // split locale
686 sal_Int32 semi0 = sLocale.indexOf( ';' );
687 if (semi0 < 0) // no semi at all, just try language
689 locale.Language = sLocale;
691 else
693 sal_Int32 semi1 = sLocale.indexOf( ';', semi0 +1 );
694 if (semi1 > semi0) // language;country;variant
696 locale.Language = sLocale.copy( 0, semi0 );
697 locale.Country = sLocale.copy( semi0 +1, semi1 - semi0 -1 );
698 locale.Variant = sLocale.copy( semi1 +1 );
700 else // try language;country
702 locale.Language = sLocale.copy( 0, semi0 );
703 locale.Country = sLocale.copy( semi0 +1 );
710 Reference< util::XNumberFormats > xFormats(
711 _pImport->getNumberFormatsSupplier()->getNumberFormats() );
712 sal_Int32 nKey = xFormats->queryKey( sFormat, locale, sal_True );
713 if (-1 == nKey)
715 nKey = xFormats->addNew( sFormat, locale );
717 ctx.getControlModel()->setPropertyValue(
718 OUString( "FormatKey" ), makeAny( nKey ) );
720 catch (const util::MalformedNumberFormatException & exc)
722 OSL_FAIL( "### util::MalformedNumberFormatException occurred!" );
723 // rethrow
724 throw xml::sax::SAXException( exc.Message, Reference< XInterface >(), Any() );
727 ctx.importBooleanProperty(
728 OUString( "TreatAsNumber" ),
729 OUString( "treat-as-number" ),
730 _xAttributes );
731 ctx.importBooleanProperty( OUString( "EnforceFormat" ),
732 OUString( "enforce-format" ),
733 _xAttributes );
735 ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes );
736 ctx.importEvents( _events );
737 // avoid ring-reference:
738 // vector< event elements > holding event elements holding this (via _pParent)
739 _events.clear();
742 //##################################################################################################
744 // timefield
745 //__________________________________________________________________________________________________
746 Reference< xml::input::XElement > TimeFieldElement::startChildElement(
747 sal_Int32 nUid, OUString const & rLocalName,
748 Reference< xml::input::XAttributes > const & xAttributes )
749 throw (xml::sax::SAXException, RuntimeException)
751 // event
752 if (_pImport->isEventElement( nUid, rLocalName ))
754 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
756 else
758 throw xml::sax::SAXException(
759 OUString( "expected event element!" ),
760 Reference< XInterface >(), Any() );
763 //__________________________________________________________________________________________________
764 void TimeFieldElement::endElement()
765 throw (xml::sax::SAXException, RuntimeException)
767 ControlImportContext ctx(
768 _pImport, getControlId( _xAttributes ),
769 OUString( "com.sun.star.awt.UnoControlTimeFieldModel" ) );
771 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
772 if (xStyle.is())
774 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
775 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
776 pStyle->importBackgroundColorStyle( xControlModel );
777 pStyle->importTextColorStyle( xControlModel );
778 pStyle->importTextLineColorStyle( xControlModel );
779 pStyle->importBorderStyle( xControlModel );
780 pStyle->importFontStyle( xControlModel );
783 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
784 ctx.importBooleanProperty( OUString( "Tabstop" ),
785 OUString( "tabstop" ),
786 _xAttributes );
787 ctx.importBooleanProperty( OUString( "ReadOnly" ),
788 OUString( "readonly" ),
789 _xAttributes );
790 ctx.importBooleanProperty( OUString( "StrictFormat" ),
791 OUString( "strict-format" ),
792 _xAttributes );
793 ctx.importBooleanProperty(
794 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
795 _xAttributes );
796 ctx.importTimeFormatProperty( OUString( "TimeFormat" ),
797 OUString( "time-format" ),
798 _xAttributes );
799 ctx.importLongProperty( OUString( "Time" ),
800 OUString( "value" ),
801 _xAttributes );
802 ctx.importLongProperty( OUString( "TimeMin" ),
803 OUString( "value-min" ),
804 _xAttributes );
805 ctx.importLongProperty( OUString( "TimeMax" ),
806 OUString( "value-max" ),
807 _xAttributes );
808 ctx.importBooleanProperty( OUString( "Spin" ),
809 OUString( "spin" ),
810 _xAttributes );
811 if (ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
812 _xAttributes ))
813 ctx.getControlModel()->setPropertyValue(
814 OUSTR("Repeat"), makeAny(true) );
815 ctx.importStringProperty( OUString( "Text" ),
816 OUString( "text" ),
817 _xAttributes );
818 ctx.importBooleanProperty( OUString( "EnforceFormat" ),
819 OUString( "enforce-format" ),
820 _xAttributes );
822 ctx.importEvents( _events );
823 // avoid ring-reference:
824 // vector< event elements > holding event elements holding this (via _pParent)
825 _events.clear();
828 //##################################################################################################
830 // numericfield
831 //__________________________________________________________________________________________________
832 Reference< xml::input::XElement > NumericFieldElement::startChildElement(
833 sal_Int32 nUid, OUString const & rLocalName,
834 Reference< xml::input::XAttributes > const & xAttributes )
835 throw (xml::sax::SAXException, RuntimeException)
837 // event
838 if (_pImport->isEventElement( nUid, rLocalName ))
840 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
842 else
844 throw xml::sax::SAXException(
845 OUString( "expected event element!" ),
846 Reference< XInterface >(), Any() );
849 //__________________________________________________________________________________________________
850 void NumericFieldElement::endElement()
851 throw (xml::sax::SAXException, RuntimeException)
853 ControlImportContext ctx(
854 _pImport, getControlId( _xAttributes ),
855 OUString( "com.sun.star.awt.UnoControlNumericFieldModel" ) );
857 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
858 if (xStyle.is())
860 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
861 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
862 pStyle->importBackgroundColorStyle( xControlModel );
863 pStyle->importTextColorStyle( xControlModel );
864 pStyle->importTextLineColorStyle( xControlModel );
865 pStyle->importBorderStyle( xControlModel );
866 pStyle->importFontStyle( xControlModel );
869 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
870 ctx.importBooleanProperty( OUString( "Tabstop" ),
871 OUString( "tabstop" ),
872 _xAttributes );
873 ctx.importBooleanProperty( OUString( "ReadOnly" ),
874 OUString( "readonly" ),
875 _xAttributes );
876 ctx.importBooleanProperty( OUString( "StrictFormat" ),
877 OUString( "strict-format" ),
878 _xAttributes );
879 ctx.importBooleanProperty(
880 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
881 _xAttributes );
882 ctx.importShortProperty( OUString( "DecimalAccuracy" ),
883 OUString( "decimal-accuracy" ),
884 _xAttributes );
885 ctx.importBooleanProperty( OUString( "ShowThousandsSeparator" ),
886 OUString( "thousands-separator" ),
887 _xAttributes );
888 ctx.importDoubleProperty( OUString( "Value" ),
889 OUString( "value" ),
890 _xAttributes );
891 ctx.importDoubleProperty( OUString( "ValueMin" ),
892 OUString( "value-min" ),
893 _xAttributes );
894 ctx.importDoubleProperty( OUString( "ValueMax" ),
895 OUString( "value-max" ),
896 _xAttributes );
897 ctx.importDoubleProperty( OUString( "ValueStep" ),
898 OUString( "value-step" ),
899 _xAttributes );
900 ctx.importBooleanProperty( OUString( "Spin" ),
901 OUString( "spin" ),
902 _xAttributes );
903 if (ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
904 _xAttributes ))
905 ctx.getControlModel()->setPropertyValue(
906 OUSTR("Repeat"), makeAny(true) );
907 ctx.importBooleanProperty( OUString( "EnforceFormat" ),
908 OUString( "enforce-format" ),
909 _xAttributes );
910 ctx.importEvents( _events );
911 // avoid ring-reference:
912 // vector< event elements > holding event elements holding this (via _pParent)
913 _events.clear();
916 //##################################################################################################
918 // datefield
919 //__________________________________________________________________________________________________
920 Reference< xml::input::XElement > DateFieldElement::startChildElement(
921 sal_Int32 nUid, OUString const & rLocalName,
922 Reference< xml::input::XAttributes > const & xAttributes )
923 throw (xml::sax::SAXException, RuntimeException)
925 // event
926 if (_pImport->isEventElement( nUid, rLocalName ))
928 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
930 else
932 throw xml::sax::SAXException(
933 OUString( "expected event element!" ),
934 Reference< XInterface >(), Any() );
937 //__________________________________________________________________________________________________
938 void DateFieldElement::endElement()
939 throw (xml::sax::SAXException, RuntimeException)
941 ControlImportContext ctx(
942 _pImport, getControlId( _xAttributes ),
943 OUString( "com.sun.star.awt.UnoControlDateFieldModel" ) );
945 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
946 if (xStyle.is())
948 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
949 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
950 pStyle->importBackgroundColorStyle( xControlModel );
951 pStyle->importTextColorStyle( xControlModel );
952 pStyle->importTextLineColorStyle( xControlModel );
953 pStyle->importBorderStyle( xControlModel );
954 pStyle->importFontStyle( xControlModel );
957 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
958 ctx.importBooleanProperty( OUString( "Tabstop" ),
959 OUString( "tabstop" ),
960 _xAttributes );
961 ctx.importBooleanProperty( OUString( "ReadOnly" ),
962 OUString( "readonly" ),
963 _xAttributes );
964 ctx.importBooleanProperty( OUString( "StrictFormat" ),
965 OUString( "strict-format" ),
966 _xAttributes );
967 ctx.importBooleanProperty(
968 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
969 _xAttributes );
970 ctx.importDateFormatProperty( OUString( "DateFormat" ),
971 OUString( "date-format" ),
972 _xAttributes );
973 ctx.importBooleanProperty( OUString( "DateShowCentury" ),
974 OUString( "show-century" ),
975 _xAttributes );
976 ctx.importLongProperty( OUString( "Date" ),
977 OUString( "value" ),
978 _xAttributes );
979 ctx.importLongProperty( OUString( "DateMin" ),
980 OUString( "value-min" ),
981 _xAttributes );
982 ctx.importLongProperty( OUString( "DateMax" ),
983 OUString( "value-max" ),
984 _xAttributes );
985 ctx.importBooleanProperty( OUString( "Spin" ),
986 OUString( "spin" ),
987 _xAttributes );
988 if (ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
989 _xAttributes ))
990 ctx.getControlModel()->setPropertyValue(
991 OUSTR("Repeat"), makeAny(true) );
992 ctx.importBooleanProperty( OUString( "Dropdown" ),
993 OUString( "dropdown" ),
994 _xAttributes );
995 ctx.importStringProperty( OUString( "Text" ),
996 OUString( "text" ),
997 _xAttributes );
998 ctx.importBooleanProperty( OUString( "EnforceFormat" ),
999 OUString( "enforce-format" ),
1000 _xAttributes );
1001 ctx.importEvents( _events );
1002 // avoid ring-reference:
1003 // vector< event elements > holding event elements holding this (via _pParent)
1004 _events.clear();
1007 //##################################################################################################
1009 // currencyfield
1010 //__________________________________________________________________________________________________
1011 Reference< xml::input::XElement > CurrencyFieldElement::startChildElement(
1012 sal_Int32 nUid, OUString const & rLocalName,
1013 Reference< xml::input::XAttributes > const & xAttributes )
1014 throw (xml::sax::SAXException, RuntimeException)
1016 // event
1017 if (_pImport->isEventElement( nUid, rLocalName ))
1019 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1021 else
1023 throw xml::sax::SAXException(
1024 OUString( "expected event element!" ),
1025 Reference< XInterface >(), Any() );
1028 //__________________________________________________________________________________________________
1029 void CurrencyFieldElement::endElement()
1030 throw (xml::sax::SAXException, RuntimeException)
1032 ControlImportContext ctx(
1033 _pImport, getControlId( _xAttributes ),
1034 OUString( "com.sun.star.awt.UnoControlCurrencyFieldModel" ) );
1036 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1037 if (xStyle.is())
1039 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1040 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1041 pStyle->importBackgroundColorStyle( xControlModel );
1042 pStyle->importTextColorStyle( xControlModel );
1043 pStyle->importTextLineColorStyle( xControlModel );
1044 pStyle->importBorderStyle( xControlModel );
1045 pStyle->importFontStyle( xControlModel );
1048 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1049 ctx.importBooleanProperty( OUString( "Tabstop" ),
1050 OUString( "tabstop" ),
1051 _xAttributes );
1052 ctx.importBooleanProperty( OUString( "ReadOnly" ),
1053 OUString( "readonly" ),
1054 _xAttributes );
1055 ctx.importBooleanProperty( OUString( "StrictFormat" ),
1056 OUString( "strict-format" ),
1057 _xAttributes );
1058 ctx.importBooleanProperty(
1059 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
1060 _xAttributes );
1061 ctx.importStringProperty( OUString( "CurrencySymbol" ),
1062 OUString( "currency-symbol" ),
1063 _xAttributes );
1064 ctx.importShortProperty( OUString( "DecimalAccuracy" ),
1065 OUString( "decimal-accuracy" ),
1066 _xAttributes );
1067 ctx.importBooleanProperty( OUString( "ShowThousandsSeparator" ),
1068 OUString( "thousands-separator" ),
1069 _xAttributes );
1070 ctx.importDoubleProperty( OUString( "Value" ),
1071 OUString( "value" ),
1072 _xAttributes );
1073 ctx.importDoubleProperty( OUString( "ValueMin" ),
1074 OUString( "value-min" ),
1075 _xAttributes );
1076 ctx.importDoubleProperty( OUString( "ValueMax" ),
1077 OUString( "value-max" ),
1078 _xAttributes );
1079 ctx.importDoubleProperty( OUString( "ValueStep" ),
1080 OUString( "value-step" ),
1081 _xAttributes );
1082 ctx.importBooleanProperty( OUString( "Spin" ),
1083 OUString( "spin" ),
1084 _xAttributes );
1085 if (ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
1086 _xAttributes ))
1087 ctx.getControlModel()->setPropertyValue(
1088 OUSTR("Repeat"), makeAny(true) );
1089 ctx.importBooleanProperty( OUString( "PrependCurrencySymbol" ),
1090 OUString( "prepend-symbol" ),
1091 _xAttributes );
1092 ctx.importBooleanProperty( OUString( "EnforceFormat" ),
1093 OUString( "enforce-format" ),
1094 _xAttributes );
1095 ctx.importEvents( _events );
1096 // avoid ring-reference:
1097 // vector< event elements > holding event elements holding this (via _pParent)
1098 _events.clear();
1101 //##################################################################################################
1103 // filecontrol
1104 //__________________________________________________________________________________________________
1105 Reference< xml::input::XElement > FileControlElement::startChildElement(
1106 sal_Int32 nUid, OUString const & rLocalName,
1107 Reference< xml::input::XAttributes > const & xAttributes )
1108 throw (xml::sax::SAXException, RuntimeException)
1110 // event
1111 if (_pImport->isEventElement( nUid, rLocalName ))
1113 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1115 else
1117 throw xml::sax::SAXException(
1118 OUString( "expected event element!" ),
1119 Reference< XInterface >(), Any() );
1122 //__________________________________________________________________________________________________
1123 void FileControlElement::endElement()
1124 throw (xml::sax::SAXException, RuntimeException)
1126 ControlImportContext ctx(
1127 _pImport, getControlId( _xAttributes ),
1128 OUString( "com.sun.star.awt.UnoControlFileControlModel" ) );
1130 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1131 if (xStyle.is())
1133 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1134 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1135 pStyle->importBackgroundColorStyle( xControlModel );
1136 pStyle->importTextColorStyle( xControlModel );
1137 pStyle->importTextLineColorStyle( xControlModel );
1138 pStyle->importBorderStyle( xControlModel );
1139 pStyle->importFontStyle( xControlModel );
1142 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1143 ctx.importBooleanProperty( OUString( "Tabstop" ),
1144 OUString( "tabstop" ),
1145 _xAttributes );
1146 ctx.importBooleanProperty(
1147 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
1148 _xAttributes );
1149 ctx.importStringProperty( OUString( "Text" ),
1150 OUString( "value" ),
1151 _xAttributes );
1152 ctx.importBooleanProperty( OUString( "ReadOnly" ),
1153 OUString( "readonly" ),
1154 _xAttributes );
1155 ctx.importEvents( _events );
1156 // avoid ring-reference:
1157 // vector< event elements > holding event elements holding this (via _pParent)
1158 _events.clear();
1160 //##################################################################################################
1162 // treecontrol
1163 //__________________________________________________________________________________________________
1164 Reference< xml::input::XElement > TreeControlElement::startChildElement(
1165 sal_Int32 nUid, OUString const & rLocalName,
1166 Reference< xml::input::XAttributes > const & xAttributes )
1167 throw (xml::sax::SAXException, RuntimeException)
1169 // event
1170 if (_pImport->isEventElement( nUid, rLocalName ))
1172 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1174 else
1176 throw xml::sax::SAXException(
1177 OUString( "expected event element!" ),
1178 Reference< XInterface >(), Any() );
1181 //__________________________________________________________________________________________________
1182 void TreeControlElement::endElement()
1183 throw (xml::sax::SAXException, RuntimeException)
1185 ControlImportContext ctx(
1186 _pImport, getControlId( _xAttributes ),
1187 OUString( "com.sun.star.awt.tree.TreeControlModel" ) );
1189 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1190 if (xStyle.is())
1192 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1193 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1194 pStyle->importBackgroundColorStyle( xControlModel );
1195 pStyle->importBorderStyle( xControlModel );
1198 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1199 ctx.importBooleanProperty( OUString( "Tabstop" ),
1200 OUString( "tabstop" ),
1201 _xAttributes );
1202 ctx.importSelectionTypeProperty( OUString( "SelectionType" ),
1203 OUString( "selectiontype" ),
1204 _xAttributes );
1205 ctx.importBooleanProperty( OUString( "RootDisplayed" ),
1206 OUString( "rootdisplayed" ),
1207 _xAttributes );
1208 ctx.importBooleanProperty( OUString( "ShowsHandles" ),
1209 OUString( "showshandles" ),
1210 _xAttributes );
1211 ctx.importBooleanProperty( OUString( "ShowsRootHandles" ),
1212 OUString( "showsroothandles" ),
1213 _xAttributes );
1214 ctx.importBooleanProperty( OUString( "Editable" ),
1215 OUString( "editable" ),
1216 _xAttributes );
1217 ctx.importBooleanProperty( OUString( "RowHeight" ),
1218 OUString( "readonly" ),
1219 _xAttributes );
1220 ctx.importBooleanProperty( OUString( "InvokesStopNodeEditing" ),
1221 OUString( "invokesstopnodeediting" ),
1222 _xAttributes );
1224 ctx.importEvents( _events );
1225 // avoid ring-reference:
1226 // vector< event elements > holding event elements holding this (via _pParent)
1227 _events.clear();
1230 //##################################################################################################
1232 // imagecontrol
1233 //__________________________________________________________________________________________________
1234 Reference< xml::input::XElement > ImageControlElement::startChildElement(
1235 sal_Int32 nUid, OUString const & rLocalName,
1236 Reference< xml::input::XAttributes > const & xAttributes )
1237 throw (xml::sax::SAXException, RuntimeException)
1239 // event
1240 if (_pImport->isEventElement( nUid, rLocalName ))
1242 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1244 else
1246 throw xml::sax::SAXException(
1247 OUString( "expected event element!" ),
1248 Reference< XInterface >(), Any() );
1251 //__________________________________________________________________________________________________
1252 void ImageControlElement::endElement()
1253 throw (xml::sax::SAXException, RuntimeException)
1255 ControlImportContext ctx(
1256 _pImport, getControlId( _xAttributes ),
1257 OUString( "com.sun.star.awt.UnoControlImageControlModel" ) );
1259 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1260 if (xStyle.is())
1262 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1263 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1264 pStyle->importBackgroundColorStyle( xControlModel );
1265 pStyle->importBorderStyle( xControlModel );
1268 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1269 ctx.importBooleanProperty( OUString( "ScaleImage" ),
1270 OUString( "scale-image" ),
1271 _xAttributes );
1272 rtl::OUString sURL = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "src" ) );
1273 Reference< document::XStorageBasedDocument > xDocStorage( _pImport->getDocOwner(), UNO_QUERY );
1275 ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "src" ), _xAttributes );
1276 ctx.importBooleanProperty( OUString( "Tabstop" ),
1277 OUString( "tabstop" ),
1278 _xAttributes );
1279 ctx.importEvents( _events );
1280 // avoid ring-reference:
1281 // vector< event elements > holding event elements holding this (via _pParent)
1282 _events.clear();
1285 //##################################################################################################
1287 // textfield
1288 //__________________________________________________________________________________________________
1289 Reference< xml::input::XElement > TextElement::startChildElement(
1290 sal_Int32 nUid, OUString const & rLocalName,
1291 Reference< xml::input::XAttributes > const & xAttributes )
1292 throw (xml::sax::SAXException, RuntimeException)
1294 // event
1295 if (_pImport->isEventElement( nUid, rLocalName ))
1297 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1299 else
1301 throw xml::sax::SAXException(
1302 OUString( "expected event element!" ),
1303 Reference< XInterface >(), Any() );
1306 //__________________________________________________________________________________________________
1307 void TextElement::endElement()
1308 throw (xml::sax::SAXException, RuntimeException)
1310 ControlImportContext ctx(
1311 _pImport, getControlId( _xAttributes ),
1312 OUString( "com.sun.star.awt.UnoControlFixedTextModel" ) );
1314 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1315 if (xStyle.is())
1317 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1318 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1319 pStyle->importBackgroundColorStyle( xControlModel );
1320 pStyle->importTextColorStyle( xControlModel );
1321 pStyle->importTextLineColorStyle( xControlModel );
1322 pStyle->importBorderStyle( xControlModel );
1323 pStyle->importFontStyle( xControlModel );
1326 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1327 ctx.importStringProperty( OUString( "Label" ),
1328 OUString( "value" ),
1329 _xAttributes );
1330 ctx.importAlignProperty( OUString( "Align" ),
1331 OUString( "align" ),
1332 _xAttributes );
1333 ctx.importVerticalAlignProperty( OUString( "VerticalAlign" ),
1334 OUString( "valign" ),
1335 _xAttributes );
1336 ctx.importBooleanProperty( OUString( "MultiLine" ),
1337 OUString( "multiline" ),
1338 _xAttributes );
1339 ctx.importBooleanProperty( OUString( "Tabstop" ),
1340 OUString( "tabstop" ),
1341 _xAttributes );
1342 ctx.importBooleanProperty( OUString( "NoLabel" ),
1343 OUString( "nolabel" ),
1344 _xAttributes );
1345 ctx.importEvents( _events );
1346 // avoid ring-reference:
1347 // vector< event elements > holding event elements holding this (via _pParent)
1348 _events.clear();
1351 //##################################################################################################
1352 // FixedHyperLink
1353 //__________________________________________________________________________________________________
1354 Reference< xml::input::XElement > FixedHyperLinkElement::startChildElement(
1355 sal_Int32 nUid, OUString const & rLocalName,
1356 Reference< xml::input::XAttributes > const & xAttributes )
1357 throw (xml::sax::SAXException, RuntimeException)
1359 // event
1360 if (_pImport->isEventElement( nUid, rLocalName ))
1362 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1364 else
1366 throw xml::sax::SAXException(
1367 OUString( "expected event element!" ),
1368 Reference< XInterface >(), Any() );
1371 //__________________________________________________________________________________________________
1372 void FixedHyperLinkElement::endElement()
1373 throw (xml::sax::SAXException, RuntimeException)
1375 ControlImportContext ctx(
1376 _pImport, getControlId( _xAttributes ),
1377 OUString( "com.sun.star.awt.UnoControlFixedHyperlinkModel" ) );
1379 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1380 if (xStyle.is())
1382 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1383 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1384 pStyle->importBackgroundColorStyle( xControlModel );
1385 pStyle->importTextColorStyle( xControlModel );
1386 pStyle->importTextLineColorStyle( xControlModel );
1387 pStyle->importBorderStyle( xControlModel );
1388 pStyle->importFontStyle( xControlModel );
1391 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1392 ctx.importStringProperty( OUString( "Label" ),
1393 OUString( "value" ),
1394 _xAttributes );
1395 ctx.importStringProperty( OUString( "URL" ),
1396 OUString( "url" ),
1397 _xAttributes );
1398 ctx.importStringProperty( OUString( "Description" ),
1399 OUString( "description" ),
1400 _xAttributes );
1402 ctx.importAlignProperty( OUString( "Align" ),
1403 OUString( "align" ),
1404 _xAttributes );
1405 ctx.importVerticalAlignProperty( OUString( "VerticalAlign" ),
1406 OUString( "valign" ),
1407 _xAttributes );
1408 ctx.importBooleanProperty( OUString( "MultiLine" ),
1409 OUString( "multiline" ),
1410 _xAttributes );
1411 ctx.importBooleanProperty( OUString( "Tabstop" ),
1412 OUString( "tabstop" ),
1413 _xAttributes );
1414 ctx.importBooleanProperty( OUString( "NoLabel" ),
1415 OUString( "nolabel" ),
1416 _xAttributes );
1417 ctx.importEvents( _events );
1418 // avoid ring-reference:
1419 // vector< event elements > holding event elements holding this (via _pParent)
1420 _events.clear();
1423 //##################################################################################################
1425 // edit
1426 //__________________________________________________________________________________________________
1427 Reference< xml::input::XElement > TextFieldElement::startChildElement(
1428 sal_Int32 nUid, OUString const & rLocalName,
1429 Reference< xml::input::XAttributes > const & xAttributes )
1430 throw (xml::sax::SAXException, RuntimeException)
1432 // event
1433 if (_pImport->isEventElement( nUid, rLocalName ))
1435 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1437 else
1439 throw xml::sax::SAXException(
1440 OUString( "expected event element!" ),
1441 Reference< XInterface >(), Any() );
1444 //__________________________________________________________________________________________________
1445 void TextFieldElement::endElement()
1446 throw (xml::sax::SAXException, RuntimeException)
1448 ControlImportContext ctx(
1449 _pImport, getControlId( _xAttributes ),
1450 OUString( "com.sun.star.awt.UnoControlEditModel" ) );
1451 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1453 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1454 if (xStyle.is())
1456 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1457 pStyle->importBackgroundColorStyle( xControlModel );
1458 pStyle->importTextColorStyle( xControlModel );
1459 pStyle->importTextLineColorStyle( xControlModel );
1460 pStyle->importBorderStyle( xControlModel );
1461 pStyle->importFontStyle( xControlModel );
1464 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1465 ctx.importBooleanProperty( OUString( "Tabstop" ),
1466 OUString( "tabstop" ),
1467 _xAttributes );
1468 ctx.importAlignProperty( OUString( "Align" ),
1469 OUString( "align" ),
1470 _xAttributes );
1471 ctx.importBooleanProperty( OUString( "HardLineBreaks" ),
1472 OUString( "hard-linebreaks" ),
1473 _xAttributes );
1474 ctx.importBooleanProperty( OUString( "HScroll" ),
1475 OUString( "hscroll" ),
1476 _xAttributes );
1477 ctx.importBooleanProperty( OUString( "VScroll" ),
1478 OUString( "vscroll" ),
1479 _xAttributes );
1480 ctx.importBooleanProperty(
1481 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
1482 _xAttributes );
1483 ctx.importShortProperty( OUString( "MaxTextLen" ),
1484 OUString( "maxlength" ),
1485 _xAttributes );
1486 ctx.importBooleanProperty( OUString( "MultiLine" ),
1487 OUString( "multiline" ),
1488 _xAttributes );
1489 ctx.importBooleanProperty( OUString( "ReadOnly" ),
1490 OUString( "readonly" ),
1491 _xAttributes );
1492 ctx.importStringProperty( OUString( "Text" ),
1493 OUString( "value" ),
1494 _xAttributes );
1495 ctx.importLineEndFormatProperty( OUString( "LineEndFormat" ),
1496 OUString( "lineend-format" ),
1497 _xAttributes );
1498 OUString aValue;
1499 if (getStringAttr( &aValue,
1500 OUString( "echochar" ),
1501 _xAttributes,
1502 _pImport->XMLNS_DIALOGS_UID ) &&
1503 !aValue.isEmpty() )
1505 OSL_ENSURE( aValue.getLength() == 1, "### more than one character given for echochar!" );
1506 sal_Int16 nChar = (sal_Int16)aValue[ 0 ];
1507 xControlModel->setPropertyValue( OUString( "EchoChar" ),
1508 makeAny( nChar ) );
1511 ctx.importEvents( _events );
1512 // avoid ring-reference:
1513 // vector< event elements > holding event elements holding this (via _pParent)
1514 _events.clear();
1517 //##################################################################################################
1519 // titledbox
1520 //__________________________________________________________________________________________________
1521 Reference< xml::input::XElement > TitledBoxElement::startChildElement(
1522 sal_Int32 nUid, OUString const & rLocalName,
1523 Reference< xml::input::XAttributes > const & xAttributes )
1524 throw (xml::sax::SAXException, RuntimeException)
1526 // event
1527 if (_pImport->isEventElement( nUid, rLocalName ))
1529 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1531 else if (_pImport->XMLNS_DIALOGS_UID != nUid)
1533 throw xml::sax::SAXException(
1534 OUString( "illegal namespace!" ),
1535 Reference< XInterface >(), Any() );
1537 // title
1538 else if ( rLocalName == "title" )
1540 getStringAttr( &_label,
1541 OUString( "value" ),
1542 xAttributes,
1543 _pImport->XMLNS_DIALOGS_UID );
1545 return new ElementBase(
1546 _pImport->XMLNS_DIALOGS_UID,
1547 rLocalName, xAttributes, this, _pImport );
1549 // radio
1550 else if ( rLocalName == "radio" )
1552 // dont create radios here, => titledbox must be inserted first due to radio grouping,
1553 // possible predecessors!
1554 Reference< xml::input::XElement > xRet(
1555 new RadioElement( rLocalName, xAttributes, this, _pImport ) );
1556 _radios.push_back( xRet );
1557 return xRet;
1559 // event
1560 else if (_pImport->isEventElement( nUid, rLocalName ))
1562 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1564 else
1566 return BulletinBoardElement::startChildElement( nUid, rLocalName, xAttributes );
1569 //__________________________________________________________________________________________________
1570 void TitledBoxElement::endElement()
1571 throw (xml::sax::SAXException, RuntimeException)
1574 ControlImportContext ctx(
1575 _pImport, getControlId( _xAttributes ),
1576 OUString( "com.sun.star.awt.UnoControlGroupBoxModel" ) );
1577 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1579 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1580 if (xStyle.is())
1582 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1583 pStyle->importTextColorStyle( xControlModel );
1584 pStyle->importTextLineColorStyle( xControlModel );
1585 pStyle->importFontStyle( xControlModel );
1588 ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
1590 if (!_label.isEmpty())
1592 xControlModel->setPropertyValue( OUString( "Label" ),
1593 makeAny( _label ) );
1596 ctx.importEvents( _events );
1597 // avoid ring-reference:
1598 // vector< event elements > holding event elements holding this (via _pParent)
1599 _events.clear();
1602 // create radios AFTER group box!
1603 for ( size_t nPos = 0; nPos < _radios.size(); ++nPos )
1605 Reference< xml::input::XElement > xRadio( _radios[ nPos ] );
1606 Reference< xml::input::XAttributes > xAttributes(
1607 xRadio->getAttributes() );
1609 ControlImportContext ctx(
1610 _pImport, getControlId( xAttributes ),
1611 getControlModelName( OUString( "com.sun.star.awt.UnoControlRadioButtonModel" ), xAttributes ) );
1612 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1614 Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) );
1615 if (xStyle.is())
1617 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1618 pStyle->importBackgroundColorStyle( xControlModel );
1619 pStyle->importTextColorStyle( xControlModel );
1620 pStyle->importTextLineColorStyle( xControlModel );
1621 pStyle->importFontStyle( xControlModel );
1622 pStyle->importVisualEffectStyle( xControlModel );
1625 ctx.importDefaults( _nBasePosX, _nBasePosY, xAttributes );
1626 ctx.importBooleanProperty( OUString( "Tabstop" ),
1627 OUString( "tabstop" ),
1628 xAttributes );
1629 ctx.importStringProperty( OUString( "Label" ),
1630 OUString( "value" ),
1631 xAttributes );
1632 ctx.importAlignProperty( OUString( "Align" ),
1633 OUString( "align" ),
1634 xAttributes );
1635 ctx.importVerticalAlignProperty( OUString( "VerticalAlign" ),
1636 OUString( "valign" ),
1637 xAttributes );
1638 ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes );
1639 ctx.importImagePositionProperty( OUString( "ImagePosition" ),
1640 OUString( "image-position" ),
1641 xAttributes );
1642 ctx.importBooleanProperty( OUString( "MultiLine" ),
1643 OUString( "multiline" ),
1644 xAttributes );
1645 ctx.importStringProperty( OUString( "GroupName" ),
1646 OUString( "group-name" ),
1647 xAttributes );
1649 sal_Int16 nVal = 0;
1650 sal_Bool bChecked = sal_False;
1651 if (getBoolAttr( &bChecked,
1652 OUString( "checked" ),
1653 xAttributes,
1654 _pImport->XMLNS_DIALOGS_UID ) &&
1655 bChecked)
1657 nVal = 1;
1659 xControlModel->setPropertyValue( OUString( "State" ),
1660 makeAny( nVal ) );
1661 ctx.importDataAwareProperty( OUSTR("linked-cell" ), xAttributes );
1662 ::std::vector< Reference< xml::input::XElement > > * radioEvents =
1663 static_cast< RadioElement * >( xRadio.get() )->getEvents();
1664 ctx.importEvents( *radioEvents );
1665 // avoid ring-reference:
1666 // vector< event elements > holding event elements holding this (via _pParent)
1667 radioEvents->clear();
1669 // avoid ring-reference:
1670 // vector< radio elements > holding radio elements holding this (via _pParent)
1671 _radios.clear();
1674 //##################################################################################################
1676 // radio
1677 //__________________________________________________________________________________________________
1678 Reference< xml::input::XElement > RadioElement::startChildElement(
1679 sal_Int32 nUid, OUString const & rLocalName,
1680 Reference< xml::input::XAttributes > const & xAttributes )
1681 throw (xml::sax::SAXException, RuntimeException)
1683 // event
1684 if (_pImport->isEventElement( nUid, rLocalName ))
1686 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1688 else
1690 throw xml::sax::SAXException(
1691 OUString( "expected event element!" ),
1692 Reference< XInterface >(), Any() );
1696 //##################################################################################################
1698 // radiogroup
1699 //__________________________________________________________________________________________________
1700 Reference< xml::input::XElement > RadioGroupElement::startChildElement(
1701 sal_Int32 nUid, OUString const & rLocalName,
1702 Reference< xml::input::XAttributes > const & xAttributes )
1703 throw (xml::sax::SAXException, RuntimeException)
1705 if (_pImport->XMLNS_DIALOGS_UID != nUid)
1707 throw xml::sax::SAXException(
1708 OUString( "illegal namespace!" ),
1709 Reference< XInterface >(), Any() );
1711 // radio
1712 else if ( rLocalName == "radio" )
1714 // dont create radios here, => titledbox must be inserted first due to radio grouping,
1715 // possible predecessors!
1716 Reference< xml::input::XElement > xRet(
1717 new RadioElement( rLocalName, xAttributes, this, _pImport ) );
1718 _radios.push_back( xRet );
1719 return xRet;
1721 else
1723 throw xml::sax::SAXException(
1724 OUString( "expected radio element!" ),
1725 Reference< XInterface >(), Any() );
1728 //__________________________________________________________________________________________________
1729 void RadioGroupElement::endElement()
1730 throw (xml::sax::SAXException, RuntimeException)
1732 for ( size_t nPos = 0; nPos < _radios.size(); ++nPos )
1734 Reference< xml::input::XElement > xRadio( _radios[ nPos ] );
1735 Reference< xml::input::XAttributes > xAttributes(
1736 xRadio->getAttributes() );
1738 ControlImportContext ctx(
1739 _pImport, getControlId( xAttributes ),
1740 getControlModelName( OUString( "com.sun.star.awt.UnoControlRadioButtonModel" ), xAttributes ) );
1741 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1743 Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) );
1744 if (xStyle.is())
1746 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1747 pStyle->importBackgroundColorStyle( xControlModel );
1748 pStyle->importTextColorStyle( xControlModel );
1749 pStyle->importTextLineColorStyle( xControlModel );
1750 pStyle->importFontStyle( xControlModel );
1751 pStyle->importVisualEffectStyle( xControlModel );
1754 ctx.importDefaults( _nBasePosX, _nBasePosY, xAttributes );
1755 ctx.importBooleanProperty( OUString( "Tabstop" ),
1756 OUString( "tabstop" ),
1757 xAttributes );
1758 ctx.importStringProperty( OUString( "Label" ),
1759 OUString( "value" ),
1760 xAttributes );
1761 ctx.importAlignProperty( OUString( "Align" ),
1762 OUString( "align" ),
1763 xAttributes );
1764 ctx.importVerticalAlignProperty( OUString( "VerticalAlign" ),
1765 OUString( "valign" ),
1766 xAttributes );
1767 ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), xAttributes );
1768 ctx.importImagePositionProperty( OUString( "ImagePosition" ),
1769 OUString( "image-position" ),
1770 xAttributes );
1771 ctx.importBooleanProperty( OUString( "MultiLine" ),
1772 OUString( "multiline" ),
1773 xAttributes );
1774 ctx.importStringProperty( OUString( "GroupName" ),
1775 OUString( "group-name" ),
1776 xAttributes );
1777 sal_Int16 nVal = 0;
1778 sal_Bool bChecked = sal_False;
1779 if (getBoolAttr( &bChecked,
1780 OUString( "checked" ),
1781 xAttributes,
1782 _pImport->XMLNS_DIALOGS_UID ) &&
1783 bChecked)
1785 nVal = 1;
1787 xControlModel->setPropertyValue( OUString( "State" ),
1788 makeAny( nVal ) );
1790 ctx.importDataAwareProperty( OUSTR("linked-cell" ), xAttributes );
1792 ::std::vector< Reference< xml::input::XElement > > * radioEvents =
1793 static_cast< RadioElement * >( xRadio.get() )->getEvents();
1794 ctx.importEvents( *radioEvents );
1795 // avoid ring-reference:
1796 // vector< event elements > holding event elements holding this (via _pParent)
1797 radioEvents->clear();
1799 // avoid ring-reference:
1800 // vector< radio elements > holding radio elements holding this (via _pParent)
1801 _radios.clear();
1804 //##################################################################################################
1806 // menupopup
1807 //__________________________________________________________________________________________________
1808 Reference< xml::input::XElement > MenuPopupElement::startChildElement(
1809 sal_Int32 nUid, OUString const & rLocalName,
1810 Reference< xml::input::XAttributes > const & xAttributes )
1811 throw (xml::sax::SAXException, RuntimeException)
1813 if (_pImport->XMLNS_DIALOGS_UID != nUid)
1815 throw xml::sax::SAXException(
1816 OUString( "illegal namespace!" ),
1817 Reference< XInterface >(), Any() );
1819 // menuitem
1820 else if ( rLocalName == "menuitem" )
1822 OUString aValue(
1823 xAttributes->getValueByUidName(
1824 _pImport->XMLNS_DIALOGS_UID,
1825 OUString( "value" ) ) );
1826 OSL_ENSURE( !aValue.isEmpty(), "### menuitem has no value?" );
1827 if (!aValue.isEmpty())
1829 _itemValues.push_back( aValue );
1831 OUString aSel(
1832 xAttributes->getValueByUidName(
1833 _pImport->XMLNS_DIALOGS_UID,
1834 OUString( "selected" ) ) );
1835 if (!aSel.isEmpty() && aSel.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
1837 _itemSelected.push_back(
1838 static_cast<sal_Int16>(_itemValues.size()) -1 );
1841 return new ElementBase(
1842 _pImport->XMLNS_DIALOGS_UID,
1843 rLocalName, xAttributes, this, _pImport );
1845 else
1847 throw xml::sax::SAXException(
1848 OUString( "expected menuitem!" ),
1849 Reference< XInterface >(), Any() );
1852 //__________________________________________________________________________________________________
1853 Sequence< OUString > MenuPopupElement::getItemValues()
1855 Sequence< OUString > aRet( _itemValues.size() );
1856 OUString * pRet = aRet.getArray();
1857 for ( size_t nPos = _itemValues.size(); nPos--; )
1859 pRet[ nPos ] = _itemValues[ nPos ];
1861 return aRet;
1863 //__________________________________________________________________________________________________
1864 Sequence< sal_Int16 > MenuPopupElement::getSelectedItems()
1866 Sequence< sal_Int16 > aRet( _itemSelected.size() );
1867 sal_Int16 * pRet = aRet.getArray();
1868 for ( size_t nPos = _itemSelected.size(); nPos--; )
1870 pRet[ nPos ] = _itemSelected[ nPos ];
1872 return aRet;
1875 //##################################################################################################
1877 // menulist
1878 //__________________________________________________________________________________________________
1879 Reference< xml::input::XElement > MenuListElement::startChildElement(
1880 sal_Int32 nUid, OUString const & rLocalName,
1881 Reference< xml::input::XAttributes > const & xAttributes )
1882 throw (xml::sax::SAXException, RuntimeException)
1884 // event
1885 if (_pImport->isEventElement( nUid, rLocalName ))
1887 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1889 else if (_pImport->XMLNS_DIALOGS_UID != nUid)
1891 throw xml::sax::SAXException(
1892 OUString( "illegal namespace!" ),
1893 Reference< XInterface >(), Any() );
1895 // menupopup
1896 else if ( rLocalName == "menupopup" )
1898 _popup = new MenuPopupElement( rLocalName, xAttributes, this, _pImport );
1899 return _popup;
1901 else
1903 throw xml::sax::SAXException(
1904 OUString( "expected event or menupopup element!" ),
1905 Reference< XInterface >(), Any() );
1908 //__________________________________________________________________________________________________
1909 void MenuListElement::endElement()
1910 throw (xml::sax::SAXException, RuntimeException)
1912 ControlImportContext ctx(
1913 _pImport, getControlId( _xAttributes ),
1915 getControlModelName( OUString( "com.sun.star.awt.UnoControlListBoxModel" ), _xAttributes ) );
1916 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
1918 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
1919 if (xStyle.is())
1921 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
1922 pStyle->importBackgroundColorStyle( xControlModel );
1923 pStyle->importTextColorStyle( xControlModel );
1924 pStyle->importTextLineColorStyle( xControlModel );
1925 pStyle->importBorderStyle( xControlModel );
1926 pStyle->importFontStyle( xControlModel );
1929 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
1930 ctx.importBooleanProperty( OUString( "Tabstop" ),
1931 OUString( "tabstop" ),
1932 _xAttributes );
1933 ctx.importBooleanProperty( OUString( "MultiSelection" ),
1934 OUString( "multiselection" ),
1935 _xAttributes );
1936 ctx.importBooleanProperty( OUString( "ReadOnly" ),
1937 OUString( "readonly" ),
1938 _xAttributes );
1939 ctx.importBooleanProperty( OUString( "Dropdown" ),
1940 OUString( "spin" ),
1941 _xAttributes );
1942 ctx.importShortProperty( OUString( "LineCount" ),
1943 OUString( "linecount" ),
1944 _xAttributes );
1945 ctx.importAlignProperty( OUString( "Align" ),
1946 OUString( "align" ),
1947 _xAttributes );
1948 bool bHasLinkedCell = ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes );
1949 bool bHasSrcRange = ctx.importDataAwareProperty( OUSTR("source-cell-range" ), _xAttributes );
1950 if (_popup.is())
1952 MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() );
1953 if ( !bHasSrcRange )
1954 xControlModel->setPropertyValue( OUString( "StringItemList" ), makeAny( p->getItemValues() ) );
1955 if ( !bHasLinkedCell )
1956 xControlModel->setPropertyValue( OUString( "SelectedItems" ), makeAny( p->getSelectedItems() ) );
1959 ctx.importEvents( _events );
1960 // avoid ring-reference:
1961 // vector< event elements > holding event elements holding this (via _pParent)
1962 _events.clear();
1965 //##################################################################################################
1967 // combobox
1968 //__________________________________________________________________________________________________
1969 Reference< xml::input::XElement > ComboBoxElement::startChildElement(
1970 sal_Int32 nUid, OUString const & rLocalName,
1971 Reference< xml::input::XAttributes > const & xAttributes )
1972 throw (xml::sax::SAXException, RuntimeException)
1974 // event
1975 if (_pImport->isEventElement( nUid, rLocalName ))
1977 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
1979 else if (_pImport->XMLNS_DIALOGS_UID != nUid)
1981 throw xml::sax::SAXException(
1982 OUString( "illegal namespace!" ),
1983 Reference< XInterface >(), Any() );
1985 // menupopup
1986 else if ( rLocalName == "menupopup" )
1988 _popup = new MenuPopupElement( rLocalName, xAttributes, this, _pImport );
1989 return _popup;
1991 else
1993 throw xml::sax::SAXException(
1994 OUString( "expected event or menupopup element!" ),
1995 Reference< XInterface >(), Any() );
1998 //__________________________________________________________________________________________________
1999 void ComboBoxElement::endElement()
2000 throw (xml::sax::SAXException, RuntimeException)
2002 ControlImportContext ctx(
2003 _pImport, getControlId( _xAttributes ),
2004 getControlModelName( OUString( "com.sun.star.awt.UnoControlComboBoxModel" ), _xAttributes ) );
2005 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
2007 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
2008 if (xStyle.is())
2010 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
2011 pStyle->importBackgroundColorStyle( xControlModel );
2012 pStyle->importTextColorStyle( xControlModel );
2013 pStyle->importTextLineColorStyle( xControlModel );
2014 pStyle->importBorderStyle( xControlModel );
2015 pStyle->importFontStyle( xControlModel );
2018 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
2019 ctx.importBooleanProperty( OUString( "Tabstop" ),
2020 OUString( "tabstop" ),
2021 _xAttributes );
2022 ctx.importBooleanProperty( OUString( "ReadOnly" ),
2023 OUString( "readonly" ),
2024 _xAttributes );
2025 ctx.importBooleanProperty( OUString( "Autocomplete" ),
2026 OUString( "autocomplete" ),
2027 _xAttributes );
2028 ctx.importBooleanProperty( OUString( "Dropdown" ),
2029 OUString( "spin" ),
2030 _xAttributes );
2031 ctx.importBooleanProperty(
2032 OUSTR("HideInactiveSelection"), OUSTR("hide-inactive-selection"),
2033 _xAttributes );
2034 ctx.importShortProperty( OUString( "MaxTextLen" ),
2035 OUString( "maxlength" ),
2036 _xAttributes );
2037 ctx.importShortProperty( OUString( "LineCount" ),
2038 OUString( "linecount" ),
2039 _xAttributes );
2040 ctx.importStringProperty( OUString( "Text" ),
2041 OUString( "value" ),
2042 _xAttributes );
2043 ctx.importAlignProperty( OUString( "Align" ),
2044 OUString( "align" ),
2045 _xAttributes );
2046 ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes );
2047 bool bHasSrcRange = ctx.importDataAwareProperty( OUSTR("source-cell-range" ), _xAttributes );
2048 if (_popup.is() && !bHasSrcRange )
2050 MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() );
2051 xControlModel->setPropertyValue( OUString( "StringItemList" ),
2052 makeAny( p->getItemValues() ) );
2055 ctx.importEvents( _events );
2056 // avoid ring-reference:
2057 // vector< event elements > holding event elements holding this (via _pParent)
2058 _events.clear();
2061 //##################################################################################################
2063 // checkbox
2064 //__________________________________________________________________________________________________
2065 Reference< xml::input::XElement > CheckBoxElement::startChildElement(
2066 sal_Int32 nUid, OUString const & rLocalName,
2067 Reference< xml::input::XAttributes > const & xAttributes )
2068 throw (xml::sax::SAXException, RuntimeException)
2070 // event
2071 if (_pImport->isEventElement( nUid, rLocalName ))
2073 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
2075 else
2077 throw xml::sax::SAXException(
2078 OUString( "expected event element!" ),
2079 Reference< XInterface >(), Any() );
2082 //__________________________________________________________________________________________________
2083 void CheckBoxElement::endElement()
2084 throw (xml::sax::SAXException, RuntimeException)
2086 ControlImportContext ctx(
2087 _pImport, getControlId( _xAttributes ),
2088 OUString( "com.sun.star.awt.UnoControlCheckBoxModel" ) );
2089 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
2091 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
2092 if (xStyle.is())
2094 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
2095 pStyle->importBackgroundColorStyle( xControlModel );
2096 pStyle->importTextColorStyle( xControlModel );
2097 pStyle->importTextLineColorStyle( xControlModel );
2098 pStyle->importFontStyle( xControlModel );
2099 pStyle->importVisualEffectStyle( xControlModel );
2102 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
2103 ctx.importBooleanProperty( OUString( "Tabstop" ),
2104 OUString( "tabstop" ),
2105 _xAttributes );
2106 ctx.importStringProperty( OUString( "Label" ),
2107 OUString( "value" ),
2108 _xAttributes );
2109 ctx.importAlignProperty( OUString( "Align" ),
2110 OUString( "align" ),
2111 _xAttributes );
2112 ctx.importVerticalAlignProperty( OUString( "VerticalAlign" ),
2113 OUString( "valign" ),
2114 _xAttributes );
2115 ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes );
2116 ctx.importImagePositionProperty( OUString( "ImagePosition" ),
2117 OUString( "image-position" ),
2118 _xAttributes );
2119 ctx.importBooleanProperty( OUString( "MultiLine" ),
2120 OUString( "multiline" ),
2121 _xAttributes );
2124 sal_Bool bTriState = sal_False;
2125 if (getBoolAttr( &bTriState,
2126 OUString( "tristate" ),
2127 _xAttributes,
2128 _pImport->XMLNS_DIALOGS_UID ))
2130 xControlModel->setPropertyValue( OUString( "TriState" ),
2131 makeAny( bTriState ) );
2133 sal_Bool bChecked = sal_False;
2134 if (getBoolAttr( &bChecked,
2135 OUString( "checked" ),
2136 _xAttributes,
2137 _pImport->XMLNS_DIALOGS_UID ))
2139 // has "checked" attribute
2140 sal_Int16 nVal = (bChecked ? 1 : 0);
2141 xControlModel->setPropertyValue( OUString( "State" ),
2142 makeAny( nVal ) );
2144 else
2146 sal_Int16 nVal = (bTriState ? 2 : 0); // if tristate set, but checked omitted => dont know!
2147 xControlModel->setPropertyValue( OUString( "State" ),
2148 makeAny( nVal ) );
2151 ctx.importEvents( _events );
2152 // avoid ring-reference:
2153 // vector< event elements > holding event elements holding this (via _pParent)
2154 _events.clear();
2157 //##################################################################################################
2159 // button
2160 //__________________________________________________________________________________________________
2161 Reference< xml::input::XElement > ButtonElement::startChildElement(
2162 sal_Int32 nUid, OUString const & rLocalName,
2163 Reference< xml::input::XAttributes > const & xAttributes )
2164 throw (xml::sax::SAXException, RuntimeException)
2166 // event
2167 if (_pImport->isEventElement( nUid, rLocalName ))
2169 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
2171 else
2173 throw xml::sax::SAXException(
2174 OUString( "expected event element!" ),
2175 Reference< XInterface >(), Any() );
2178 //__________________________________________________________________________________________________
2179 void ButtonElement::endElement()
2180 throw (xml::sax::SAXException, RuntimeException)
2182 ControlImportContext ctx(
2183 _pImport, getControlId( _xAttributes ),
2184 OUString( "com.sun.star.awt.UnoControlButtonModel" ) );
2186 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
2187 if (xStyle.is())
2189 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
2190 Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
2191 pStyle->importBackgroundColorStyle( xControlModel );
2192 pStyle->importTextColorStyle( xControlModel );
2193 pStyle->importTextLineColorStyle( xControlModel );
2194 pStyle->importFontStyle( xControlModel );
2197 ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
2198 ctx.importBooleanProperty( OUString( "Tabstop" ),
2199 OUString( "tabstop" ),
2200 _xAttributes );
2201 ctx.importStringProperty( OUString( "Label" ),
2202 OUString( "value" ),
2203 _xAttributes );
2204 ctx.importAlignProperty( OUString( "Align" ),
2205 OUString( "align" ),
2206 _xAttributes );
2207 ctx.importVerticalAlignProperty( OUString( "VerticalAlign" ),
2208 OUString( "valign" ),
2209 _xAttributes );
2210 ctx.importBooleanProperty( OUString( "DefaultButton" ),
2211 OUString( "default" ),
2212 _xAttributes );
2213 ctx.importButtonTypeProperty( OUString( "PushButtonType" ),
2214 OUString( "button-type" ),
2215 _xAttributes );
2216 ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes );
2217 ctx.importImagePositionProperty( OUString( "ImagePosition" ),
2218 OUString( "image-position" ),
2219 _xAttributes );
2220 ctx.importImageAlignProperty( OUString( "ImageAlign" ),
2221 OUString( "image-align" ),
2222 _xAttributes );
2223 if (ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat"),
2224 _xAttributes ))
2225 ctx.getControlModel()->setPropertyValue(
2226 OUSTR("Repeat"), makeAny(true) );
2227 sal_Int32 toggled = 0;
2228 if (getLongAttr( &toggled, OUSTR("toggled"), _xAttributes,
2229 _pImport->XMLNS_DIALOGS_UID ) && toggled == 1)
2230 ctx.getControlModel()->setPropertyValue(OUSTR("Toggle"), makeAny(true));
2231 ctx.importBooleanProperty( OUSTR("FocusOnClick"), OUSTR("grab-focus"),
2232 _xAttributes );
2233 ctx.importBooleanProperty( OUString( "MultiLine" ),
2234 OUString( "multiline" ),
2235 _xAttributes );
2236 // State
2237 sal_Bool bChecked = sal_False;
2238 if (getBoolAttr(
2239 &bChecked,
2240 OUString( "checked" ),
2241 _xAttributes,
2242 _pImport->XMLNS_DIALOGS_UID ) &&
2243 bChecked)
2245 sal_Int16 nVal = 1;
2246 ctx.getControlModel()->setPropertyValue(
2247 OUString( "State" ), makeAny( nVal ) );
2250 ctx.importEvents( _events );
2251 // avoid ring-reference:
2252 // vector< event elements > holding event elements holding this (via _pParent)
2253 _events.clear();
2256 //##################################################################################################
2258 // bulletinboard
2259 //__________________________________________________________________________________________________
2260 Reference< xml::input::XElement > BulletinBoardElement::startChildElement(
2261 sal_Int32 nUid, OUString const & rLocalName,
2262 Reference< xml::input::XAttributes > const & xAttributes )
2263 throw (xml::sax::SAXException, RuntimeException)
2265 if (_pImport->XMLNS_DIALOGS_UID != nUid)
2267 throw xml::sax::SAXException(
2268 OUString( "illegal namespace!" ),
2269 Reference< XInterface >(), Any() );
2271 // button
2272 else if ( rLocalName == "button" )
2274 return new ButtonElement( rLocalName, xAttributes, this, _pImport );
2276 // checkbox
2277 else if ( rLocalName == "checkbox" )
2279 return new CheckBoxElement( rLocalName, xAttributes, this, _pImport );
2281 // combobox
2282 else if ( rLocalName == "combobox" )
2284 return new ComboBoxElement( rLocalName, xAttributes, this, _pImport );
2286 // listbox
2287 else if ( rLocalName == "menulist" )
2289 return new MenuListElement( rLocalName, xAttributes, this, _pImport );
2291 // radiogroup
2292 else if ( rLocalName == "radiogroup" )
2294 return new RadioGroupElement( rLocalName, xAttributes, this, _pImport );
2296 // titledbox
2297 else if ( rLocalName == "titledbox" )
2299 return new TitledBoxElement( rLocalName, xAttributes, this, _pImport );
2301 // text
2302 else if ( rLocalName == "text" )
2304 return new TextElement( rLocalName, xAttributes, this, _pImport );
2306 else if ( rLocalName == "linklabel" )
2308 return new FixedHyperLinkElement( rLocalName, xAttributes, this, _pImport );
2310 // textfield
2311 else if ( rLocalName == "textfield" )
2313 return new TextFieldElement( rLocalName, xAttributes, this, _pImport );
2315 // img
2316 else if ( rLocalName == "img" )
2318 return new ImageControlElement( rLocalName, xAttributes, this, _pImport );
2320 // filecontrol
2321 else if ( rLocalName == "filecontrol" )
2323 return new FileControlElement( rLocalName, xAttributes, this, _pImport );
2325 // treecontrol
2326 else if ( rLocalName == "treecontrol" )
2328 return new TreeControlElement( rLocalName, xAttributes, this, _pImport );
2330 // currencyfield
2331 else if ( rLocalName == "currencyfield" )
2333 return new CurrencyFieldElement( rLocalName, xAttributes, this, _pImport );
2335 // datefield
2336 else if ( rLocalName == "datefield" )
2338 return new DateFieldElement( rLocalName, xAttributes, this, _pImport );
2340 // datefield
2341 else if ( rLocalName == "numericfield" )
2343 return new NumericFieldElement( rLocalName, xAttributes, this, _pImport );
2345 // timefield
2346 else if ( rLocalName == "timefield" )
2348 return new TimeFieldElement( rLocalName, xAttributes, this, _pImport );
2350 // patternfield
2351 else if ( rLocalName == "patternfield" )
2353 return new PatternFieldElement( rLocalName, xAttributes, this, _pImport );
2355 // formattedfield
2356 else if ( rLocalName == "formattedfield" )
2358 return new FormattedFieldElement( rLocalName, xAttributes, this, _pImport );
2360 // fixedline
2361 else if ( rLocalName == "fixedline" )
2363 return new FixedLineElement( rLocalName, xAttributes, this, _pImport );
2365 // scrollbar
2366 else if ( rLocalName == "scrollbar" )
2368 return new ScrollBarElement( rLocalName, xAttributes, this, _pImport );
2370 // spinbutton
2371 else if ( rLocalName == "spinbutton" )
2373 return new SpinButtonElement( rLocalName, xAttributes, this, _pImport );
2375 // progressmeter
2376 else if ( rLocalName == "progressmeter" )
2378 return new ProgressBarElement( rLocalName, xAttributes, this, _pImport );
2380 else if ( rLocalName == "multipage" )
2382 return new MultiPage( rLocalName, xAttributes, this, _pImport );
2384 else if ( rLocalName == "frame" )
2386 return new Frame( rLocalName, xAttributes, this, _pImport );
2388 else if ( rLocalName == "page" )
2390 return new Page( rLocalName, xAttributes, this, _pImport );
2392 // bulletinboard
2393 else if ( rLocalName == "bulletinboard" )
2395 return new BulletinBoardElement( rLocalName, xAttributes, this, _pImport );
2397 else
2399 throw xml::sax::SAXException(
2400 OUString( "expected styles, bulletinboard or bulletinboard element, not: " ) + rLocalName,
2401 Reference< XInterface >(), Any() );
2404 //__________________________________________________________________________________________________
2405 BulletinBoardElement::BulletinBoardElement(
2406 OUString const & rLocalName,
2407 Reference< xml::input::XAttributes > const & xAttributes,
2408 ElementBase * pParent, DialogImport * pImport )
2409 SAL_THROW(())
2410 : ControlElement( rLocalName, xAttributes, pParent, pImport )
2412 OUString aValue(
2413 _xAttributes->getValueByUidName(
2414 _pImport->XMLNS_DIALOGS_UID,
2415 OUString( "left" ) ) );
2416 if (!aValue.isEmpty())
2418 _nBasePosX += toInt32( aValue );
2420 aValue = _xAttributes->getValueByUidName(
2421 _pImport->XMLNS_DIALOGS_UID,
2422 OUString( "top" ) );
2423 if (!aValue.isEmpty())
2425 _nBasePosY += toInt32( aValue );
2429 //##################################################################################################
2431 // style
2432 //__________________________________________________________________________________________________
2433 Reference< xml::input::XElement > StyleElement::startChildElement(
2434 sal_Int32 /*nUid*/, OUString const & /*rLocalName*/,
2435 Reference< xml::input::XAttributes > const & /*xAttributes*/ )
2436 throw (xml::sax::SAXException, RuntimeException)
2438 throw xml::sax::SAXException(
2439 OUString( "unexpected sub elements of style!" ),
2440 Reference< XInterface >(), Any() );
2442 //__________________________________________________________________________________________________
2443 void StyleElement::endElement()
2444 throw (xml::sax::SAXException, RuntimeException)
2446 Reference< xml::input::XAttributes > xStyle;
2447 OUString aStyleId(
2448 _xAttributes->getValueByUidName(
2449 _pImport->XMLNS_DIALOGS_UID,
2450 OUString( "style-id" ) ) );
2451 if (!aStyleId.isEmpty())
2453 _pImport->addStyle( aStyleId, this );
2455 else
2457 throw xml::sax::SAXException(
2458 OUString( "missing style-id attribute!" ),
2459 Reference< XInterface >(), Any() );
2463 //##################################################################################################
2465 // styles
2466 //__________________________________________________________________________________________________
2467 Reference< xml::input::XElement > StylesElement::startChildElement(
2468 sal_Int32 nUid, OUString const & rLocalName,
2469 Reference< xml::input::XAttributes > const & xAttributes )
2470 throw (xml::sax::SAXException, RuntimeException)
2472 if (_pImport->XMLNS_DIALOGS_UID != nUid)
2474 throw xml::sax::SAXException(
2475 OUString( "illegal namespace!" ),
2476 Reference< XInterface >(), Any() );
2478 // style
2479 else if ( rLocalName == "style" )
2481 return new StyleElement( rLocalName, xAttributes, this, _pImport );
2483 else
2485 throw xml::sax::SAXException(
2486 OUString( "expected style element!" ),
2487 Reference< XInterface >(), Any() );
2491 //##################################################################################################
2493 // window
2494 //__________________________________________________________________________________________________
2495 Reference< xml::input::XElement > WindowElement::startChildElement(
2496 sal_Int32 nUid, OUString const & rLocalName,
2497 Reference< xml::input::XAttributes > const & xAttributes )
2498 throw (xml::sax::SAXException, RuntimeException)
2500 // event
2501 if (_pImport->isEventElement( nUid, rLocalName ))
2503 return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
2505 else if (_pImport->XMLNS_DIALOGS_UID != nUid)
2507 throw xml::sax::SAXException(
2508 OUString( "illegal namespace!" ),
2509 Reference< XInterface >(), Any() );
2511 // styles
2512 else if ( rLocalName == "styles" )
2514 return new StylesElement( rLocalName, xAttributes, this, _pImport );
2516 // bulletinboard
2517 else if ( rLocalName == "bulletinboard" )
2519 return new BulletinBoardElement( rLocalName, xAttributes, this, _pImport );
2521 else
2523 throw xml::sax::SAXException(
2524 OUString( "expected styles ot bulletinboard element!" ),
2525 Reference< XInterface >(), Any() );
2528 //__________________________________________________________________________________________________
2529 void WindowElement::endElement()
2530 throw (xml::sax::SAXException, RuntimeException)
2532 Reference< beans::XPropertySet > xProps(
2533 _pImport->_xDialogModel, UNO_QUERY_THROW );
2534 ImportContext ctx( _pImport, xProps, getControlId( _xAttributes ) );
2536 Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
2537 if (xStyle.is())
2539 StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
2540 pStyle->importBackgroundColorStyle( xProps );
2541 pStyle->importTextColorStyle( xProps );
2542 pStyle->importTextLineColorStyle( xProps );
2543 pStyle->importFontStyle( xProps );
2546 ctx.importDefaults( 0, 0, _xAttributes, false );
2547 ctx.importBooleanProperty(
2548 OUString( "Closeable" ),
2549 OUString( "closeable" ),
2550 _xAttributes );
2551 ctx.importBooleanProperty(
2552 OUString( "Moveable" ),
2553 OUString( "moveable" ),
2554 _xAttributes );
2555 ctx.importBooleanProperty(
2556 OUString( "Sizeable" ),
2557 OUString( "resizeable" ),
2558 _xAttributes );
2559 ctx.importStringProperty(
2560 OUString( "Title" ),
2561 OUString( "title" ),
2562 _xAttributes );
2563 ctx.importBooleanProperty(
2564 OUString( "Decoration" ),
2565 OUString( "withtitlebar" ),
2566 _xAttributes );
2567 ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes );
2568 ctx.importEvents( _events );
2569 // avoid ring-reference:
2570 // vector< event elements > holding event elements holding this (via _pParent)
2571 _events.clear();
2576 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */