1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <xmlscript/xmldlg_imexp.hxx>
24 #include <cppuhelper/implbase.hxx>
25 #include <com/sun/star/uno/XComponentContext.hpp>
26 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
27 #include <com/sun/star/container/XNameContainer.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
30 #include <com/sun/star/awt/XControlModel.hpp>
31 #include <com/sun/star/awt/FontDescriptor.hpp>
32 #include <com/sun/star/awt/FontEmphasisMark.hpp>
33 #include <com/sun/star/awt/FontRelief.hpp>
34 #include <com/sun/star/xml/input/XRoot.hpp>
35 #include <com/sun/star/xml/sax/SAXException.hpp>
36 #include <com/sun/star/container/ElementExistException.hpp>
37 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
38 #include <osl/diagnose.h>
39 #include <rtl/ref.hxx>
40 #include <o3tl/string_view.hxx>
47 inline sal_Int32
toInt32( std::u16string_view rStr
)
50 if (rStr
.size() > 2 && rStr
[ 0 ] == '0' && rStr
[ 1 ] == 'x')
51 nVal
= o3tl::toUInt32(rStr
.substr( 2 ), 16);
53 nVal
= o3tl::toInt32(rStr
);
57 inline bool getBoolAttr(
58 sal_Bool
* pRet
, OUString
const & rAttrName
,
59 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
62 OUString
aValue( xAttributes
->getValueByUidName( nUid
, rAttrName
) );
63 if (!aValue
.isEmpty())
65 if ( aValue
== "true" )
70 else if ( aValue
== "false" )
77 throw css::xml::sax::SAXException(
78 rAttrName
+ ": no boolean value (true|false)!",
79 css::uno::Reference
<css::uno::XInterface
>(), css::uno::Any() );
85 inline bool getStringAttr(
86 OUString
* pRet
, OUString
const & rAttrName
,
87 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
90 *pRet
= xAttributes
->getValueByUidName( nUid
, rAttrName
);
91 return (!pRet
->isEmpty());
94 inline bool getLongAttr(
95 sal_Int32
* pRet
, OUString
const & rAttrName
,
96 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
99 OUString
aValue( xAttributes
->getValueByUidName( nUid
, rAttrName
) );
100 if (!aValue
.isEmpty())
102 *pRet
= toInt32( aValue
);
111 : public ::cppu::WeakImplHelper
< css::xml::input::XRoot
>
113 friend class ImportContext
;
115 css::uno::Reference
< css::uno::XComponentContext
> _xContext
;
116 css::uno::Reference
< css::util::XNumberFormatsSupplier
> _xSupplier
;
118 std::shared_ptr
< std::vector
< OUString
> > _pStyleNames
;
119 std::shared_ptr
< std::vector
< css::uno::Reference
< css::xml::input::XElement
> > > _pStyles
;
121 css::uno::Reference
< css::frame::XModel
> _xDoc
;
123 css::uno::Reference
< css::container::XNameContainer
> _xDialogModel
;
124 css::uno::Reference
< css::lang::XMultiServiceFactory
> _xDialogModelFactory
;
126 sal_Int32 XMLNS_DIALOGS_UID
, XMLNS_SCRIPT_UID
;
129 sal_Int32 nUid
, std::u16string_view rLocalName
) const
131 return ((XMLNS_SCRIPT_UID
== nUid
&& (rLocalName
== u
"event" || rLocalName
== u
"listener-event" )) ||
132 (XMLNS_DIALOGS_UID
== nUid
&& rLocalName
== u
"event" ));
136 OUString
const & rStyleId
,
137 css::uno::Reference
< css::xml::input::XElement
> const & xStyle
);
138 css::uno::Reference
< css::xml::input::XElement
> getStyle(
139 std::u16string_view rStyleId
) const;
141 css::uno::Reference
< css::uno::XComponentContext
>
142 const & getComponentContext() const { return _xContext
; }
143 css::uno::Reference
< css::util::XNumberFormatsSupplier
>
144 const & getNumberFormatsSupplier();
147 css::uno::Reference
<css::uno::XComponentContext
> xContext
,
148 css::uno::Reference
<css::container::XNameContainer
>
149 const & xDialogModel
,
150 std::shared_ptr
< std::vector
< OUString
> > pStyleNames
,
151 std::shared_ptr
< std::vector
< css::uno::Reference
< css::xml::input::XElement
> > > pStyles
,
152 css::uno::Reference
<css::frame::XModel
> xDoc
)
153 : _xContext(std::move( xContext
))
154 , _pStyleNames(std::move( pStyleNames
))
155 , _pStyles(std::move( pStyles
))
156 , _xDoc(std::move( xDoc
))
157 , _xDialogModel( xDialogModel
)
158 , _xDialogModelFactory( xDialogModel
, css::uno::UNO_QUERY_THROW
)
159 , XMLNS_DIALOGS_UID( 0 )
160 , XMLNS_SCRIPT_UID( 0 )
161 { OSL_ASSERT( _xDialogModel
.is() && _xContext
.is() ); }
162 DialogImport( const DialogImport
& rOther
) :
163 ::cppu::WeakImplHelper
< css::xml::input::XRoot
>()
164 , _xContext( rOther
._xContext
)
165 , _xSupplier( rOther
._xSupplier
)
166 , _pStyleNames( rOther
._pStyleNames
)
167 , _pStyles( rOther
._pStyles
)
168 , _xDoc( rOther
._xDoc
)
169 , _xDialogModel( rOther
._xDialogModel
)
170 , _xDialogModelFactory( rOther
._xDialogModelFactory
)
171 , XMLNS_DIALOGS_UID( rOther
.XMLNS_DIALOGS_UID
)
172 , XMLNS_SCRIPT_UID( rOther
.XMLNS_SCRIPT_UID
) {}
174 virtual ~DialogImport() override
;
176 const css::uno::Reference
< css::frame::XModel
>& getDocOwner() const { return _xDoc
; }
179 virtual void SAL_CALL
startDocument(
180 css::uno::Reference
< css::xml::input::XNamespaceMapping
>
181 const & xNamespaceMapping
) override
;
182 virtual void SAL_CALL
endDocument() override
;
183 virtual void SAL_CALL
processingInstruction(
184 OUString
const & rTarget
, OUString
const & rData
) override
;
185 virtual void SAL_CALL
setDocumentLocator(
186 css::uno::Reference
< css::xml::sax::XLocator
> const & xLocator
) override
;
187 virtual css::uno::Reference
< css::xml::input::XElement
>
188 SAL_CALL
startRootElement(
189 sal_Int32 nUid
, OUString
const & rLocalName
,
190 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
194 : public ::cppu::WeakImplHelper
< css::xml::input::XElement
>
197 // We deliberately store these as raw pointers, otherwise we get reference cycles between DialogImport and the elements
198 DialogImport
* m_pImport
;
199 ElementBase
* m_pParent
;
201 const sal_Int32 _nUid
;
202 const OUString _aLocalName
;
204 const css::uno::Reference
< css::xml::input::XAttributes
> _xAttributes
;
208 sal_Int32 nUid
, OUString aLocalName
,
209 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
210 ElementBase
* pParent
, DialogImport
* pImport
);
211 virtual ~ElementBase() override
;
214 virtual css::uno::Reference
<css::xml::input::XElement
> SAL_CALL
getParent() override
;
215 virtual OUString SAL_CALL
getLocalName() override
;
216 virtual sal_Int32 SAL_CALL
getUid() override
;
217 virtual css::uno::Reference
< css::xml::input::XAttributes
>
218 SAL_CALL
getAttributes() override
;
219 virtual void SAL_CALL
ignorableWhitespace(
220 OUString
const & rWhitespaces
) override
;
221 virtual void SAL_CALL
characters( OUString
const & rChars
) override
;
222 virtual void SAL_CALL
processingInstruction(
223 OUString
const & Target
, OUString
const & Data
) override
;
224 virtual void SAL_CALL
endElement() override
;
225 virtual css::uno::Reference
< css::xml::input::XElement
>
226 SAL_CALL
startChildElement(
227 sal_Int32 nUid
, OUString
const & rLocalName
,
228 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
235 virtual css::uno::Reference
< css::xml::input::XElement
>
236 SAL_CALL
startChildElement(
237 sal_Int32 nUid
, OUString
const & rLocalName
,
238 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
241 OUString
const & rLocalName
,
242 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
243 ElementBase
* pParent
, DialogImport
* pImport
)
244 : ElementBase( pImport
->XMLNS_DIALOGS_UID
,
245 rLocalName
, xAttributes
, pParent
, pImport
)
252 sal_Int32 _backgroundColor
;
253 sal_Int32 _textColor
;
254 sal_Int32 _textLineColor
;
256 sal_Int32 _borderColor
;
257 css::awt::FontDescriptor _descr
;
258 sal_Int16 _fontRelief
;
259 sal_Int16 _fontEmphasisMark
;
260 sal_Int32 _fillColor
;
261 sal_Int16 _visualEffect
;
263 // current highest mask: 0x40
264 short _inited
, _hasValue
;
266 void setFontProperties(
267 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
) const;
270 virtual css::uno::Reference
< css::xml::input::XElement
>
271 SAL_CALL
startChildElement(
272 sal_Int32 nUid
, OUString
const & rLocalName
,
273 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
274 virtual void SAL_CALL
endElement() override
;
276 void importTextColorStyle(
277 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
278 void importTextLineColorStyle(
279 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
280 void importFillColorStyle(
281 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
282 void importBackgroundColorStyle(
283 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
284 void importFontStyle(
285 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
286 void importBorderStyle(
287 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
288 void importVisualEffectStyle(
289 css::uno::Reference
< css::beans::XPropertySet
> const & xProps
);
292 OUString
const & rLocalName
,
293 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
294 ElementBase
* pParent
, DialogImport
* pImport
)
295 : ElementBase( pImport
->XMLNS_DIALOGS_UID
,
296 rLocalName
, xAttributes
, pParent
, pImport
)
297 , _backgroundColor(0)
302 , _fontRelief( css::awt::FontRelief::NONE
)
303 , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE
)
312 class MenuPopupElement
315 std::vector
< OUString
> _itemValues
;
316 std::vector
< sal_Int16
> _itemSelected
;
317 bool _allowEmptyItems
;
319 css::uno::Sequence
< OUString
> getItemValues();
320 css::uno::Sequence
< sal_Int16
> getSelectedItems();
322 virtual css::uno::Reference
< css::xml::input::XElement
>
323 SAL_CALL
startChildElement(
324 sal_Int32 nUid
, OUString
const & rLocalName
,
325 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
328 OUString
const & rLocalName
,
329 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
330 ElementBase
* pParent
, DialogImport
* pImport
,
331 bool aAllowEmptyItems
)
332 : ElementBase( pImport
->XMLNS_DIALOGS_UID
,
333 rLocalName
, xAttributes
, pParent
, pImport
)
334 , _allowEmptyItems(aAllowEmptyItems
)
341 friend class EventElement
;
344 sal_Int32 _nBasePosX
, _nBasePosY
;
346 std::vector
< css::uno::Reference
< css::xml::input::XElement
> > _events
;
348 OUString
getControlId(
349 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
350 OUString
getControlModelName(
351 OUString
const& rDefaultModel
,
352 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
353 css::uno::Reference
< css::xml::input::XElement
> getStyle(
354 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
356 std::vector
<css::uno::Reference
< css::xml::input::XElement
> >& getEvents()
360 OUString
const & rLocalName
,
361 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
362 ElementBase
* pParent
, DialogImport
* pImport
);
368 DialogImport
* const _pImport
;
369 const css::uno::Reference
< css::beans::XPropertySet
> _xControlModel
;
374 DialogImport
* pImport
,
375 css::uno::Reference
< css::beans::XPropertySet
> xControlModel_
,
377 : _pImport( pImport
),
378 _xControlModel(std::move( xControlModel_
)),
379 _aId(std::move( id
))
380 { OSL_ASSERT( _xControlModel
.is() ); }
382 const css::uno::Reference
< css::beans::XPropertySet
>& getControlModel() const
383 { return _xControlModel
; }
385 void importScollableSettings( css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
);
387 sal_Int32 nBaseX
, sal_Int32 nBaseY
,
388 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
389 bool supportPrintable
= true );
391 std::vector
< css::uno::Reference
< css::xml::input::XElement
> >
394 bool importStringProperty(
395 OUString
const & rPropName
, OUString
const & rAttrName
,
396 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
397 bool importDoubleProperty(
398 OUString
const & rPropName
, OUString
const & rAttrName
,
399 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
400 bool importBooleanProperty(
401 OUString
const & rPropName
, OUString
const & rAttrName
,
402 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
403 bool importShortProperty(
404 OUString
const & rPropName
, OUString
const & rAttrName
,
405 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
406 bool importLongProperty(
407 OUString
const & rPropName
, OUString
const & rAttrName
,
408 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
409 bool importLongProperty(
411 OUString
const & rPropName
, OUString
const & rAttrName
,
412 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
413 bool importHexLongProperty(
414 OUString
const & rPropName
, OUString
const & rAttrName
,
415 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
416 bool importAlignProperty(
417 OUString
const & rPropName
, OUString
const & rAttrName
,
418 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
419 bool importVerticalAlignProperty(
420 OUString
const & rPropName
, OUString
const & rAttrName
,
421 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
422 bool importGraphicOrImageProperty(OUString
const & rAttrName
,
423 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
);
424 bool importImageAlignProperty(
425 OUString
const & rPropName
, OUString
const & rAttrName
,
426 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
427 bool importImagePositionProperty(
428 OUString
const & rPropName
, OUString
const & rAttrName
,
429 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
430 bool importDateProperty(
431 OUString
const & rPropName
, OUString
const & rAttrName
,
432 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
433 bool importDateFormatProperty(
434 OUString
const & rPropName
, OUString
const & rAttrName
,
435 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
436 bool importTimeProperty(
437 OUString
const & rPropName
, OUString
const & rAttrName
,
438 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
439 bool importTimeFormatProperty(
440 OUString
const & rPropName
, OUString
const & rAttrName
,
441 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
442 bool importOrientationProperty(
443 OUString
const & rPropName
, OUString
const & rAttrName
,
444 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
445 bool importButtonTypeProperty(
446 OUString
const & rPropName
, OUString
const & rAttrName
,
447 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
448 bool importLineEndFormatProperty(
449 OUString
const & rPropName
, OUString
const & rAttrName
,
450 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
451 bool importSelectionTypeProperty(
452 OUString
const & rPropName
, OUString
const & rAttrName
,
453 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
454 bool importDataAwareProperty(
455 OUString
const & rPropName
,
456 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
457 bool importImageScaleModeProperty(
458 OUString
const & rPropName
, OUString
const & rAttrName
,
459 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
);
462 class ControlImportContext
: public ImportContext
465 ControlImportContext(
466 DialogImport
* pImport
,
467 OUString
const & rId
, OUString
const & rControlName
)
470 css::uno::Reference
< css::beans::XPropertySet
>(
471 pImport
->_xDialogModelFactory
->createInstance( rControlName
),
472 css::uno::UNO_QUERY_THROW
), rId
)
474 ControlImportContext(
475 DialogImport
* pImport
,
476 const css::uno::Reference
< css::beans::XPropertySet
>& xProps
, OUString
const & rControlName
)
483 /// @throws css::xml::sax::SAXException
484 /// @throws css::uno::RuntimeException
489 _pImport
->_xDialogModel
->insertByName(
491 css::uno::Reference
<css::awt::XControlModel
>::query(
492 _xControlModel
) ) );
494 catch(const css::container::ElementExistException
&e
)
496 throw css::lang::WrappedTargetRuntimeException("", e
.Context
, css::uno::Any(e
));
502 : public ControlElement
505 virtual css::uno::Reference
< css::xml::input::XElement
>
506 SAL_CALL
startChildElement(
507 sal_Int32 nUid
, OUString
const & rLocalName
,
508 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
509 virtual void SAL_CALL
endElement() override
;
512 OUString
const & rLocalName
,
513 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
514 DialogImport
* pImport
)
515 : ControlElement( rLocalName
, xAttributes
, nullptr, pImport
)
523 virtual void SAL_CALL
endElement() override
;
526 sal_Int32 nUid
, OUString
const & rLocalName
,
527 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
528 ElementBase
* pParent
, DialogImport
* pImport
)
529 : ElementBase( nUid
, rLocalName
, xAttributes
, pParent
, pImport
)
533 class BulletinBoardElement
534 : public ControlElement
536 // we are the owner of this, so have to keep a reference to it
537 rtl::Reference
<DialogImport
> mxDialogImport
;
539 virtual css::uno::Reference
< css::xml::input::XElement
>
540 SAL_CALL
startChildElement(
541 sal_Int32 nUid
, OUString
const & rLocalName
,
542 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
544 BulletinBoardElement(
545 OUString
const & rLocalName
,
546 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
547 ElementBase
* pParent
, DialogImport
* pImport
);
551 : public ControlElement
554 virtual css::uno::Reference
< css::xml::input::XElement
>
555 SAL_CALL
startChildElement(
556 sal_Int32 nUid
, OUString
const & rLocalName
,
557 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
558 virtual void SAL_CALL
endElement() override
;
561 OUString
const & rLocalName
,
562 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
563 ElementBase
* pParent
, DialogImport
* pImport
)
564 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
568 class CheckBoxElement
569 : public ControlElement
572 virtual css::uno::Reference
< css::xml::input::XElement
>
573 SAL_CALL
startChildElement(
574 sal_Int32 nUid
, OUString
const & rLocalName
,
575 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
576 virtual void SAL_CALL
endElement() override
;
579 OUString
const & rLocalName
,
580 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
581 ElementBase
* pParent
, DialogImport
* pImport
)
582 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
586 class ComboBoxElement
587 : public ControlElement
589 css::uno::Reference
< css::xml::input::XElement
> _popup
;
591 virtual css::uno::Reference
< css::xml::input::XElement
>
592 SAL_CALL
startChildElement(
593 sal_Int32 nUid
, OUString
const & rLocalName
,
594 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
595 virtual void SAL_CALL
endElement() override
;
598 OUString
const & rLocalName
,
599 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
600 ElementBase
* pParent
, DialogImport
* pImport
)
601 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
605 class MenuListElement
606 : public ControlElement
608 css::uno::Reference
< css::xml::input::XElement
> _popup
;
610 virtual css::uno::Reference
< css::xml::input::XElement
>
611 SAL_CALL
startChildElement(
612 sal_Int32 nUid
, OUString
const & rLocalName
,
613 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
614 virtual void SAL_CALL
endElement() override
;
617 OUString
const & rLocalName
,
618 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
619 ElementBase
* pParent
, DialogImport
* pImport
)
620 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
625 : public ControlElement
628 virtual css::uno::Reference
< css::xml::input::XElement
>
629 SAL_CALL
startChildElement(
630 sal_Int32 nUid
, OUString
const & rLocalName
,
631 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
634 OUString
const & rLocalName
,
635 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
636 ElementBase
* pParent
, DialogImport
* pImport
)
637 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
641 class RadioGroupElement
642 : public ControlElement
644 std::vector
< css::uno::Reference
< css::xml::input::XElement
> > _radios
;
646 virtual css::uno::Reference
< css::xml::input::XElement
>
647 SAL_CALL
startChildElement(
648 sal_Int32 nUid
, OUString
const & rLocalName
,
649 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
650 void SAL_CALL
endElement() override
;
653 OUString
const & rLocalName
,
654 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
655 ElementBase
* pParent
, DialogImport
* pImport
)
656 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
660 class TitledBoxElement
661 : public BulletinBoardElement
664 std::vector
< css::uno::Reference
< css::xml::input::XElement
> > _radios
;
666 virtual css::uno::Reference
< css::xml::input::XElement
>
667 SAL_CALL
startChildElement(
668 sal_Int32 nUid
, OUString
const & rLocalName
,
669 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
670 virtual void SAL_CALL
endElement() override
;
673 OUString
const & rLocalName
,
674 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
675 ElementBase
* pParent
, DialogImport
* pImport
)
676 : BulletinBoardElement( rLocalName
, xAttributes
, pParent
, pImport
)
681 : public ControlElement
684 virtual css::uno::Reference
< css::xml::input::XElement
>
685 SAL_CALL
startChildElement(
686 sal_Int32 nUid
, OUString
const & rLocalName
,
687 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
688 virtual void SAL_CALL
endElement() override
;
691 OUString
const & rLocalName
,
692 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
693 ElementBase
* pParent
, DialogImport
* pImport
)
694 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
697 class FixedHyperLinkElement
698 : public ControlElement
701 virtual css::uno::Reference
< css::xml::input::XElement
>
702 SAL_CALL
startChildElement(
703 sal_Int32 nUid
, OUString
const & rLocalName
,
704 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
705 virtual void SAL_CALL
endElement() override
;
707 FixedHyperLinkElement(
708 OUString
const & rLocalName
,
709 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
710 ElementBase
* pParent
, DialogImport
* pImport
)
711 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
715 class TextFieldElement
716 : public ControlElement
719 virtual css::uno::Reference
< css::xml::input::XElement
>
720 SAL_CALL
startChildElement(
721 sal_Int32 nUid
, OUString
const & rLocalName
,
722 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
723 virtual void SAL_CALL
endElement() override
;
726 OUString
const & rLocalName
,
727 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
728 ElementBase
* pParent
, DialogImport
* pImport
)
729 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
733 class ImageControlElement
734 : public ControlElement
737 virtual css::uno::Reference
< css::xml::input::XElement
>
738 SAL_CALL
startChildElement(
739 sal_Int32 nUid
, OUString
const & rLocalName
,
740 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
741 virtual void SAL_CALL
endElement() override
;
744 OUString
const & rLocalName
,
745 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
746 ElementBase
* pParent
, DialogImport
* pImport
)
747 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
751 class FileControlElement
752 : public ControlElement
755 virtual css::uno::Reference
< css::xml::input::XElement
>
756 SAL_CALL
startChildElement(
757 sal_Int32 nUid
, OUString
const & rLocalName
,
758 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
759 virtual void SAL_CALL
endElement() override
;
762 OUString
const & rLocalName
,
763 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
764 ElementBase
* pParent
, DialogImport
* pImport
)
765 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
769 class TreeControlElement
770 : public ControlElement
773 virtual css::uno::Reference
< css::xml::input::XElement
>
774 SAL_CALL
startChildElement(
775 sal_Int32 nUid
, OUString
const & rLocalName
,
776 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
777 virtual void SAL_CALL
endElement() override
;
780 OUString
const & rLocalName
,
781 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
782 ElementBase
* pParent
, DialogImport
* pImport
)
783 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
787 class CurrencyFieldElement
788 : public ControlElement
791 virtual css::uno::Reference
< css::xml::input::XElement
>
792 SAL_CALL
startChildElement(
793 sal_Int32 nUid
, OUString
const & rLocalName
,
794 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
795 virtual void SAL_CALL
endElement() override
;
797 CurrencyFieldElement(
798 OUString
const & rLocalName
,
799 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
800 ElementBase
* pParent
, DialogImport
* pImport
)
801 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
805 class DateFieldElement
806 : public ControlElement
809 virtual css::uno::Reference
< css::xml::input::XElement
>
810 SAL_CALL
startChildElement(
811 sal_Int32 nUid
, OUString
const & rLocalName
,
812 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
813 virtual void SAL_CALL
endElement() override
;
816 OUString
const & rLocalName
,
817 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
818 ElementBase
* pParent
, DialogImport
* pImport
)
819 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
823 class NumericFieldElement
824 : public ControlElement
827 virtual css::uno::Reference
< css::xml::input::XElement
>
828 SAL_CALL
startChildElement(
829 sal_Int32 nUid
, OUString
const & rLocalName
,
830 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
831 virtual void SAL_CALL
endElement() override
;
834 OUString
const & rLocalName
,
835 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
836 ElementBase
* pParent
, DialogImport
* pImport
)
837 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
841 class TimeFieldElement
842 : public ControlElement
845 virtual css::uno::Reference
< css::xml::input::XElement
>
846 SAL_CALL
startChildElement(
847 sal_Int32 nUid
, OUString
const & rLocalName
,
848 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
849 virtual void SAL_CALL
endElement() override
;
852 OUString
const & rLocalName
,
853 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
854 ElementBase
* pParent
, DialogImport
* pImport
)
855 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
859 class PatternFieldElement
860 : public ControlElement
863 virtual css::uno::Reference
< css::xml::input::XElement
>
864 SAL_CALL
startChildElement(
865 sal_Int32 nUid
, OUString
const & rLocalName
,
866 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
867 virtual void SAL_CALL
endElement() override
;
870 OUString
const & rLocalName
,
871 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
872 ElementBase
* pParent
, DialogImport
* pImport
)
873 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
877 class FormattedFieldElement
878 : public ControlElement
881 virtual css::uno::Reference
< css::xml::input::XElement
>
882 SAL_CALL
startChildElement(
883 sal_Int32 nUid
, OUString
const & rLocalName
,
884 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
885 virtual void SAL_CALL
endElement() override
;
887 FormattedFieldElement(
888 OUString
const & rLocalName
,
889 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
890 ElementBase
* pParent
, DialogImport
* pImport
)
891 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
895 class FixedLineElement
896 : public ControlElement
899 virtual css::uno::Reference
< css::xml::input::XElement
>
900 SAL_CALL
startChildElement(
901 sal_Int32 nUid
, OUString
const & rLocalName
,
902 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
903 virtual void SAL_CALL
endElement() override
;
906 OUString
const & rLocalName
,
907 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
908 ElementBase
* pParent
, DialogImport
* pImport
)
909 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
913 class ScrollBarElement
914 : public ControlElement
917 virtual css::uno::Reference
< css::xml::input::XElement
>
918 SAL_CALL
startChildElement(
919 sal_Int32 nUid
, OUString
const & rLocalName
,
920 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
921 virtual void SAL_CALL
endElement() override
;
924 OUString
const & rLocalName
,
925 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
926 ElementBase
* pParent
, DialogImport
* pImport
)
927 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
931 class SpinButtonElement
932 : public ControlElement
935 virtual css::uno::Reference
< css::xml::input::XElement
>
936 SAL_CALL
startChildElement(
937 sal_Int32 nUid
, OUString
const & rLocalName
,
938 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
939 virtual void SAL_CALL
endElement() override
;
942 OUString
const & rLocalName
,
943 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
944 ElementBase
* pParent
, DialogImport
* pImport
)
945 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
950 : public ControlElement
953 virtual css::uno::Reference
< css::xml::input::XElement
>
954 SAL_CALL
startChildElement(
955 sal_Int32 nUid
, OUString
const & rLocalName
,
956 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
957 virtual void SAL_CALL
endElement() override
;
960 OUString
const & rLocalName
,
961 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
962 ElementBase
* pParent
, DialogImport
* pImport
)
963 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
965 m_xContainer
.set( m_pImport
->_xDialogModelFactory
->createInstance( "com.sun.star.awt.UnoMultiPageModel" ), css::uno::UNO_QUERY
);
968 css::uno::Reference
< css::container::XNameContainer
> m_xContainer
;
972 : public ControlElement
976 virtual css::uno::Reference
< css::xml::input::XElement
>
977 SAL_CALL
startChildElement(
978 sal_Int32 nUid
, OUString
const & rLocalName
,
979 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
980 virtual void SAL_CALL
endElement() override
;
983 OUString
const & rLocalName
,
984 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
985 ElementBase
* pParent
, DialogImport
* pImport
)
986 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
989 css::uno::Reference
< css::container::XNameContainer
> m_xContainer
;
993 : public ControlElement
996 virtual css::uno::Reference
< css::xml::input::XElement
>
997 SAL_CALL
startChildElement(
998 sal_Int32 nUid
, OUString
const & rLocalName
,
999 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
1000 virtual void SAL_CALL
endElement() override
;
1003 OUString
const & rLocalName
,
1004 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
1005 ElementBase
* pParent
, DialogImport
* pImport
)
1006 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
1008 m_xContainer
.set( m_pImport
->_xDialogModelFactory
->createInstance( "com.sun.star.awt.UnoPageModel" ), css::uno::UNO_QUERY
);
1011 css::uno::Reference
< css::container::XNameContainer
> m_xContainer
;
1014 class ProgressBarElement
1015 : public ControlElement
1018 virtual css::uno::Reference
< css::xml::input::XElement
>
1019 SAL_CALL
startChildElement(
1020 sal_Int32 nUid
, OUString
const & rLocalName
,
1021 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
1022 virtual void SAL_CALL
endElement() override
;
1025 OUString
const & rLocalName
,
1026 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
1027 ElementBase
* pParent
, DialogImport
* pImport
)
1028 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
1032 //==============================================================================
1033 class GridControlElement
1034 : public ControlElement
1037 virtual css::uno::Reference
< css::xml::input::XElement
>
1038 SAL_CALL
startChildElement(
1039 sal_Int32 nUid
,::rtl::OUString
const & rLocalName
,
1040 css::uno::Reference
<css::xml::input::XAttributes
> const & xAttributes
) override
;
1041 virtual void SAL_CALL
endElement() override
;
1043 GridControlElement(OUString
const & rLocalName
,
1044 css::uno::Reference
< css::xml::input::XAttributes
> const & xAttributes
,
1045 ElementBase
* pParent
, DialogImport
* pImport
)
1046 : ControlElement( rLocalName
, xAttributes
, pParent
, pImport
)
1053 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */