update credits
[LibreOffice.git] / xmlscript / source / xmldlg_imexp / imp_share.hxx
blob82fdfc9a879e3ce4b1f73c8f64830214aa17da9b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <xmlscript/xmldlg_imexp.hxx>
23 #include <cppuhelper/implbase.hxx>
24 #include <com/sun/star/uno/XComponentContext.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/container/XNameContainer.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
29 #include <com/sun/star/awt/XControlModel.hpp>
30 #include <com/sun/star/awt/FontDescriptor.hpp>
31 #include <com/sun/star/awt/FontEmphasisMark.hpp>
32 #include <com/sun/star/awt/FontRelief.hpp>
33 #include <com/sun/star/xml/input/XRoot.hpp>
34 #include <com/sun/star/xml/sax/SAXException.hpp>
35 #include <com/sun/star/container/ElementExistException.hpp>
36 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
37 #include <osl/diagnose.h>
38 #include <rtl/ref.hxx>
39 #include <memory>
40 #include <vector>
42 namespace xmlscript
45 inline sal_Int32 toInt32( OUString const & rStr )
47 sal_Int32 nVal;
48 if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x')
49 nVal = rStr.copy( 2 ).toUInt32( 16 );
50 else
51 nVal = rStr.toInt32();
52 return nVal;
55 inline bool getBoolAttr(
56 sal_Bool * pRet, OUString const & rAttrName,
57 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
58 sal_Int32 nUid )
60 OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
61 if (!aValue.isEmpty())
63 if ( aValue == "true" )
65 *pRet = true;
66 return true;
68 else if ( aValue == "false" )
70 *pRet = false;
71 return true;
73 else
75 throw css::xml::sax::SAXException(
76 rAttrName + ": no boolean value (true|false)!",
77 css::uno::Reference<css::uno::XInterface>(), css::uno::Any() );
80 return false;
83 inline bool getStringAttr(
84 OUString * pRet, OUString const & rAttrName,
85 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
86 sal_Int32 nUid )
88 *pRet = xAttributes->getValueByUidName( nUid, rAttrName );
89 return (!pRet->isEmpty());
92 inline bool getLongAttr(
93 sal_Int32 * pRet, OUString const & rAttrName,
94 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
95 sal_Int32 nUid )
97 OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
98 if (!aValue.isEmpty())
100 *pRet = toInt32( aValue );
101 return true;
103 return false;
106 class ImportContext;
108 struct DialogImport
109 : public ::cppu::WeakImplHelper< css::xml::input::XRoot >
111 friend class ImportContext;
112 private:
113 css::uno::Reference< css::uno::XComponentContext > _xContext;
114 css::uno::Reference< css::util::XNumberFormatsSupplier > _xSupplier;
116 std::shared_ptr< std::vector< OUString > > _pStyleNames;
117 std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > _pStyles;
119 css::uno::Reference< css::frame::XModel > _xDoc;
120 public:
121 css::uno::Reference< css::container::XNameContainer > _xDialogModel;
122 css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory;
124 sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
126 bool isEventElement(
127 sal_Int32 nUid, std::u16string_view rLocalName ) const
129 return ((XMLNS_SCRIPT_UID == nUid && (rLocalName == u"event" || rLocalName == u"listener-event" )) ||
130 (XMLNS_DIALOGS_UID == nUid && rLocalName == u"event" ));
133 void addStyle(
134 OUString const & rStyleId,
135 css::uno::Reference< css::xml::input::XElement > const & xStyle );
136 css::uno::Reference< css::xml::input::XElement > getStyle(
137 std::u16string_view rStyleId ) const;
139 css::uno::Reference< css::uno::XComponentContext >
140 const & getComponentContext() const { return _xContext; }
141 css::uno::Reference< css::util::XNumberFormatsSupplier >
142 const & getNumberFormatsSupplier();
144 DialogImport(
145 css::uno::Reference<css::uno::XComponentContext> const & xContext,
146 css::uno::Reference<css::container::XNameContainer>
147 const & xDialogModel,
148 std::shared_ptr< std::vector< OUString > > const & pStyleNames,
149 std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > const & pStyles,
150 css::uno::Reference<css::frame::XModel> const & xDoc )
151 : _xContext( xContext )
152 , _pStyleNames( pStyleNames )
153 , _pStyles( pStyles )
154 , _xDoc( xDoc )
155 , _xDialogModel( xDialogModel )
156 , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW )
157 , XMLNS_DIALOGS_UID( 0 )
158 , XMLNS_SCRIPT_UID( 0 )
159 { OSL_ASSERT( _xDialogModel.is() && _xContext.is() ); }
160 DialogImport( const DialogImport& rOther ) :
161 ::cppu::WeakImplHelper< css::xml::input::XRoot >()
162 , _xContext( rOther._xContext )
163 , _xSupplier( rOther._xSupplier )
164 , _pStyleNames( rOther._pStyleNames )
165 , _pStyles( rOther._pStyles )
166 , _xDoc( rOther._xDoc )
167 , _xDialogModel( rOther._xDialogModel )
168 , _xDialogModelFactory( rOther._xDialogModelFactory )
169 , XMLNS_DIALOGS_UID( rOther.XMLNS_DIALOGS_UID )
170 , XMLNS_SCRIPT_UID( rOther.XMLNS_SCRIPT_UID ) {}
172 virtual ~DialogImport() override;
174 const css::uno::Reference< css::frame::XModel >& getDocOwner() const { return _xDoc; }
176 // XRoot
177 virtual void SAL_CALL startDocument(
178 css::uno::Reference< css::xml::input::XNamespaceMapping >
179 const & xNamespaceMapping ) override;
180 virtual void SAL_CALL endDocument() override;
181 virtual void SAL_CALL processingInstruction(
182 OUString const & rTarget, OUString const & rData ) override;
183 virtual void SAL_CALL setDocumentLocator(
184 css::uno::Reference< css::xml::sax::XLocator > const & xLocator ) override;
185 virtual css::uno::Reference< css::xml::input::XElement >
186 SAL_CALL startRootElement(
187 sal_Int32 nUid, OUString const & rLocalName,
188 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
191 class ElementBase
192 : public ::cppu::WeakImplHelper< css::xml::input::XElement >
194 protected:
195 rtl::Reference<DialogImport> const m_xImport;
196 rtl::Reference<ElementBase> const m_xParent;
197 private:
198 const sal_Int32 _nUid;
199 const OUString _aLocalName;
200 protected:
201 const css::uno::Reference< css::xml::input::XAttributes > _xAttributes;
203 public:
204 ElementBase(
205 sal_Int32 nUid, OUString const & rLocalName,
206 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
207 ElementBase * pParent, DialogImport * pImport );
208 virtual ~ElementBase() override;
210 // XElement
211 virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL getParent() override;
212 virtual OUString SAL_CALL getLocalName() override;
213 virtual sal_Int32 SAL_CALL getUid() override;
214 virtual css::uno::Reference< css::xml::input::XAttributes >
215 SAL_CALL getAttributes() override;
216 virtual void SAL_CALL ignorableWhitespace(
217 OUString const & rWhitespaces ) override;
218 virtual void SAL_CALL characters( OUString const & rChars ) override;
219 virtual void SAL_CALL processingInstruction(
220 OUString const & Target, OUString const & Data ) override;
221 virtual void SAL_CALL endElement() override;
222 virtual css::uno::Reference< css::xml::input::XElement >
223 SAL_CALL startChildElement(
224 sal_Int32 nUid, OUString const & rLocalName,
225 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
228 class StylesElement
229 : public ElementBase
231 public:
232 virtual css::uno::Reference< css::xml::input::XElement >
233 SAL_CALL startChildElement(
234 sal_Int32 nUid, OUString const & rLocalName,
235 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
237 StylesElement(
238 OUString const & rLocalName,
239 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
240 ElementBase * pParent, DialogImport * pImport )
241 : ElementBase( pImport->XMLNS_DIALOGS_UID,
242 rLocalName, xAttributes, pParent, pImport )
246 class StyleElement
247 : public ElementBase
249 sal_Int32 _backgroundColor;
250 sal_Int32 _textColor;
251 sal_Int32 _textLineColor;
252 sal_Int16 _border;
253 sal_Int32 _borderColor;
254 css::awt::FontDescriptor _descr;
255 sal_Int16 _fontRelief;
256 sal_Int16 _fontEmphasisMark;
257 sal_Int32 _fillColor;
258 sal_Int16 _visualEffect;
260 // current highest mask: 0x40
261 short _inited, _hasValue;
263 void setFontProperties(
264 css::uno::Reference< css::beans::XPropertySet > const & xProps ) const;
266 public:
267 virtual css::uno::Reference< css::xml::input::XElement >
268 SAL_CALL startChildElement(
269 sal_Int32 nUid, OUString const & rLocalName,
270 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
271 virtual void SAL_CALL endElement() override;
273 void importTextColorStyle(
274 css::uno::Reference< css::beans::XPropertySet > const & xProps );
275 void importTextLineColorStyle(
276 css::uno::Reference< css::beans::XPropertySet > const & xProps );
277 void importFillColorStyle(
278 css::uno::Reference< css::beans::XPropertySet > const & xProps );
279 void importBackgroundColorStyle(
280 css::uno::Reference< css::beans::XPropertySet > const & xProps );
281 void importFontStyle(
282 css::uno::Reference< css::beans::XPropertySet > const & xProps );
283 void importBorderStyle(
284 css::uno::Reference< css::beans::XPropertySet > const & xProps );
285 void importVisualEffectStyle(
286 css::uno::Reference< css::beans::XPropertySet > const & xProps );
288 StyleElement(
289 OUString const & rLocalName,
290 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
291 ElementBase * pParent, DialogImport * pImport )
292 : ElementBase( pImport->XMLNS_DIALOGS_UID,
293 rLocalName, xAttributes, pParent, pImport )
294 , _backgroundColor(0)
295 , _textColor(0)
296 , _textLineColor(0)
297 , _border(0)
298 , _borderColor(0)
299 , _fontRelief( css::awt::FontRelief::NONE )
300 , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE )
301 , _fillColor(0)
302 , _visualEffect(0)
303 , _inited( 0 )
304 , _hasValue( 0 )
309 class MenuPopupElement
310 : public ElementBase
312 std::vector< OUString > _itemValues;
313 std::vector< sal_Int16 > _itemSelected;
314 bool _allowEmptyItems;
315 public:
316 css::uno::Sequence< OUString > getItemValues();
317 css::uno::Sequence< sal_Int16 > getSelectedItems();
319 virtual css::uno::Reference< css::xml::input::XElement >
320 SAL_CALL startChildElement(
321 sal_Int32 nUid, OUString const & rLocalName,
322 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
324 MenuPopupElement(
325 OUString const & rLocalName,
326 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
327 ElementBase * pParent, DialogImport * pImport,
328 bool aAllowEmptyItems)
329 : ElementBase( pImport->XMLNS_DIALOGS_UID,
330 rLocalName, xAttributes, pParent, pImport )
331 , _allowEmptyItems(aAllowEmptyItems)
335 class ControlElement
336 : public ElementBase
338 friend class EventElement;
340 protected:
341 sal_Int32 _nBasePosX, _nBasePosY;
343 std::vector< css::uno::Reference< css::xml::input::XElement > > _events;
345 OUString getControlId(
346 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
347 OUString getControlModelName(
348 OUString const& rDefaultModel,
349 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
350 css::uno::Reference< css::xml::input::XElement > getStyle(
351 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
352 public:
353 std::vector<css::uno::Reference< css::xml::input::XElement> >& getEvents()
354 { return _events; }
356 ControlElement(
357 OUString const & rLocalName,
358 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
359 ElementBase * pParent, DialogImport * pImport );
362 class ImportContext
364 protected:
365 DialogImport * const _pImport;
366 const css::uno::Reference< css::beans::XPropertySet > _xControlModel;
367 const OUString _aId;
369 public:
370 ImportContext(
371 DialogImport * pImport,
372 css::uno::Reference< css::beans::XPropertySet > const & xControlModel_,
373 OUString const & id )
374 : _pImport( pImport ),
375 _xControlModel( xControlModel_ ),
376 _aId( id )
377 { OSL_ASSERT( _xControlModel.is() ); }
379 const css::uno::Reference< css::beans::XPropertySet >& getControlModel() const
380 { return _xControlModel; }
382 void importScollableSettings( css::uno::Reference< css::xml::input::XAttributes > const & xAttributes );
383 void importDefaults(
384 sal_Int32 nBaseX, sal_Int32 nBaseY,
385 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
386 bool supportPrintable = true );
387 void importEvents(
388 std::vector< css::uno::Reference< css::xml::input::XElement > >
389 const & rEvents );
391 bool importStringProperty(
392 OUString const & rPropName, OUString const & rAttrName,
393 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
394 bool importDoubleProperty(
395 OUString const & rPropName, OUString const & rAttrName,
396 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
397 bool importBooleanProperty(
398 OUString const & rPropName, OUString const & rAttrName,
399 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
400 bool importShortProperty(
401 OUString const & rPropName, OUString const & rAttrName,
402 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
403 bool importLongProperty(
404 OUString const & rPropName, OUString const & rAttrName,
405 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
406 bool importLongProperty(
407 sal_Int32 nOffset,
408 OUString const & rPropName, OUString const & rAttrName,
409 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
410 bool importHexLongProperty(
411 OUString const & rPropName, OUString const & rAttrName,
412 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
413 bool importAlignProperty(
414 OUString const & rPropName, OUString const & rAttrName,
415 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
416 bool importVerticalAlignProperty(
417 OUString const & rPropName, OUString const & rAttrName,
418 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
419 bool importGraphicOrImageProperty(OUString const & rAttrName,
420 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes );
421 bool importImageAlignProperty(
422 OUString const & rPropName, OUString const & rAttrName,
423 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
424 bool importImagePositionProperty(
425 OUString const & rPropName, OUString const & rAttrName,
426 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
427 bool importDateProperty(
428 OUString const & rPropName, OUString const & rAttrName,
429 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
430 bool importDateFormatProperty(
431 OUString const & rPropName, OUString const & rAttrName,
432 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
433 bool importTimeProperty(
434 OUString const & rPropName, OUString const & rAttrName,
435 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
436 bool importTimeFormatProperty(
437 OUString const & rPropName, OUString const & rAttrName,
438 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
439 bool importOrientationProperty(
440 OUString const & rPropName, OUString const & rAttrName,
441 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
442 bool importButtonTypeProperty(
443 OUString const & rPropName, OUString const & rAttrName,
444 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
445 bool importLineEndFormatProperty(
446 OUString const & rPropName, OUString const & rAttrName,
447 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
448 bool importSelectionTypeProperty(
449 OUString const & rPropName, OUString const & rAttrName,
450 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
451 bool importDataAwareProperty(
452 OUString const & rPropName,
453 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
454 bool importImageScaleModeProperty(
455 OUString const & rPropName, OUString const & rAttrName,
456 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
459 class ControlImportContext : public ImportContext
461 public:
462 ControlImportContext(
463 DialogImport * pImport,
464 OUString const & rId, OUString const & rControlName )
465 : ImportContext(
466 pImport,
467 css::uno::Reference< css::beans::XPropertySet >(
468 pImport->_xDialogModelFactory->createInstance( rControlName ),
469 css::uno::UNO_QUERY_THROW ), rId )
471 ControlImportContext(
472 DialogImport * pImport,
473 const css::uno::Reference< css::beans::XPropertySet >& xProps, OUString const & rControlName )
474 : ImportContext(
475 pImport,
476 xProps,
477 rControlName )
480 /// @throws css::xml::sax::SAXException
481 /// @throws css::uno::RuntimeException
482 void finish()
486 _pImport->_xDialogModel->insertByName(
487 _aId, css::uno::makeAny(
488 css::uno::Reference<css::awt::XControlModel>::query(
489 _xControlModel ) ) );
491 catch(const css::container::ElementExistException &e)
493 throw css::lang::WrappedTargetRuntimeException("", e.Context, makeAny(e));
498 class WindowElement
499 : public ControlElement
501 public:
502 virtual css::uno::Reference< css::xml::input::XElement >
503 SAL_CALL startChildElement(
504 sal_Int32 nUid, OUString const & rLocalName,
505 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
506 virtual void SAL_CALL endElement() override;
508 WindowElement(
509 OUString const & rLocalName,
510 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
511 DialogImport * pImport )
512 : ControlElement( rLocalName, xAttributes, nullptr, pImport )
516 class EventElement
517 : public ElementBase
519 public:
520 virtual void SAL_CALL endElement() override;
522 EventElement(
523 sal_Int32 nUid, OUString const & rLocalName,
524 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
525 ElementBase * pParent, DialogImport * pImport )
526 : ElementBase( nUid, rLocalName, xAttributes, pParent, pImport )
530 class BulletinBoardElement
531 : public ControlElement
533 public:
534 virtual css::uno::Reference< css::xml::input::XElement >
535 SAL_CALL startChildElement(
536 sal_Int32 nUid, OUString const & rLocalName,
537 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
539 BulletinBoardElement(
540 OUString const & rLocalName,
541 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
542 ElementBase * pParent, DialogImport * pImport );
545 class ButtonElement
546 : public ControlElement
548 public:
549 virtual css::uno::Reference< css::xml::input::XElement >
550 SAL_CALL startChildElement(
551 sal_Int32 nUid, OUString const & rLocalName,
552 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
553 virtual void SAL_CALL endElement() override;
555 ButtonElement(
556 OUString const & rLocalName,
557 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
558 ElementBase * pParent, DialogImport * pImport )
559 : ControlElement( rLocalName, xAttributes, pParent, pImport )
563 class CheckBoxElement
564 : public ControlElement
566 public:
567 virtual css::uno::Reference< css::xml::input::XElement >
568 SAL_CALL startChildElement(
569 sal_Int32 nUid, OUString const & rLocalName,
570 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
571 virtual void SAL_CALL endElement() override;
573 CheckBoxElement(
574 OUString const & rLocalName,
575 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
576 ElementBase * pParent, DialogImport * pImport )
577 : ControlElement( rLocalName, xAttributes, pParent, pImport )
581 class ComboBoxElement
582 : public ControlElement
584 css::uno::Reference< css::xml::input::XElement > _popup;
585 public:
586 virtual css::uno::Reference< css::xml::input::XElement >
587 SAL_CALL startChildElement(
588 sal_Int32 nUid, OUString const & rLocalName,
589 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
590 virtual void SAL_CALL endElement() override;
592 ComboBoxElement(
593 OUString const & rLocalName,
594 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
595 ElementBase * pParent, DialogImport * pImport )
596 : ControlElement( rLocalName, xAttributes, pParent, pImport )
600 class MenuListElement
601 : public ControlElement
603 css::uno::Reference< css::xml::input::XElement > _popup;
604 public:
605 virtual css::uno::Reference< css::xml::input::XElement >
606 SAL_CALL startChildElement(
607 sal_Int32 nUid, OUString const & rLocalName,
608 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
609 virtual void SAL_CALL endElement() override;
611 MenuListElement(
612 OUString const & rLocalName,
613 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
614 ElementBase * pParent, DialogImport * pImport )
615 : ControlElement( rLocalName, xAttributes, pParent, pImport )
619 class RadioElement
620 : public ControlElement
622 public:
623 virtual css::uno::Reference< css::xml::input::XElement >
624 SAL_CALL startChildElement(
625 sal_Int32 nUid, OUString const & rLocalName,
626 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
628 RadioElement(
629 OUString const & rLocalName,
630 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
631 ElementBase * pParent, DialogImport * pImport )
632 : ControlElement( rLocalName, xAttributes, pParent, pImport )
636 class RadioGroupElement
637 : public ControlElement
639 std::vector< css::uno::Reference< css::xml::input::XElement > > _radios;
640 public:
641 virtual css::uno::Reference< css::xml::input::XElement >
642 SAL_CALL startChildElement(
643 sal_Int32 nUid, OUString const & rLocalName,
644 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
645 void SAL_CALL endElement() override;
647 RadioGroupElement(
648 OUString const & rLocalName,
649 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
650 ElementBase * pParent, DialogImport * pImport )
651 : ControlElement( rLocalName, xAttributes, pParent, pImport )
655 class TitledBoxElement
656 : public BulletinBoardElement
658 OUString _label;
659 std::vector< css::uno::Reference< css::xml::input::XElement > > _radios;
660 public:
661 virtual css::uno::Reference< css::xml::input::XElement >
662 SAL_CALL startChildElement(
663 sal_Int32 nUid, OUString const & rLocalName,
664 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
665 virtual void SAL_CALL endElement() override;
667 TitledBoxElement(
668 OUString const & rLocalName,
669 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
670 ElementBase * pParent, DialogImport * pImport )
671 : BulletinBoardElement( rLocalName, xAttributes, pParent, pImport )
675 class TextElement
676 : public ControlElement
678 public:
679 virtual css::uno::Reference< css::xml::input::XElement >
680 SAL_CALL startChildElement(
681 sal_Int32 nUid, OUString const & rLocalName,
682 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
683 virtual void SAL_CALL endElement() override;
685 TextElement(
686 OUString const & rLocalName,
687 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
688 ElementBase * pParent, DialogImport * pImport )
689 : ControlElement( rLocalName, xAttributes, pParent, pImport )
692 class FixedHyperLinkElement
693 : public ControlElement
695 public:
696 virtual css::uno::Reference< css::xml::input::XElement >
697 SAL_CALL startChildElement(
698 sal_Int32 nUid, OUString const & rLocalName,
699 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
700 virtual void SAL_CALL endElement() override;
702 FixedHyperLinkElement(
703 OUString const & rLocalName,
704 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
705 ElementBase * pParent, DialogImport * pImport )
706 : ControlElement( rLocalName, xAttributes, pParent, pImport )
710 class TextFieldElement
711 : public ControlElement
713 public:
714 virtual css::uno::Reference< css::xml::input::XElement >
715 SAL_CALL startChildElement(
716 sal_Int32 nUid, OUString const & rLocalName,
717 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
718 virtual void SAL_CALL endElement() override;
720 TextFieldElement(
721 OUString const & rLocalName,
722 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
723 ElementBase * pParent, DialogImport * pImport )
724 : ControlElement( rLocalName, xAttributes, pParent, pImport )
728 class ImageControlElement
729 : public ControlElement
731 public:
732 virtual css::uno::Reference< css::xml::input::XElement >
733 SAL_CALL startChildElement(
734 sal_Int32 nUid, OUString const & rLocalName,
735 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
736 virtual void SAL_CALL endElement() override;
738 ImageControlElement(
739 OUString const & rLocalName,
740 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
741 ElementBase * pParent, DialogImport * pImport )
742 : ControlElement( rLocalName, xAttributes, pParent, pImport )
746 class FileControlElement
747 : public ControlElement
749 public:
750 virtual css::uno::Reference< css::xml::input::XElement >
751 SAL_CALL startChildElement(
752 sal_Int32 nUid, OUString const & rLocalName,
753 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
754 virtual void SAL_CALL endElement() override;
756 FileControlElement(
757 OUString const & rLocalName,
758 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
759 ElementBase * pParent, DialogImport * pImport )
760 : ControlElement( rLocalName, xAttributes, pParent, pImport )
764 class TreeControlElement
765 : public ControlElement
767 public:
768 virtual css::uno::Reference< css::xml::input::XElement >
769 SAL_CALL startChildElement(
770 sal_Int32 nUid, OUString const & rLocalName,
771 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
772 virtual void SAL_CALL endElement() override;
774 TreeControlElement(
775 OUString const & rLocalName,
776 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
777 ElementBase * pParent, DialogImport * pImport )
778 : ControlElement( rLocalName, xAttributes, pParent, pImport )
782 class CurrencyFieldElement
783 : public ControlElement
785 public:
786 virtual css::uno::Reference< css::xml::input::XElement >
787 SAL_CALL startChildElement(
788 sal_Int32 nUid, OUString const & rLocalName,
789 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
790 virtual void SAL_CALL endElement() override;
792 CurrencyFieldElement(
793 OUString const & rLocalName,
794 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
795 ElementBase * pParent, DialogImport * pImport )
796 : ControlElement( rLocalName, xAttributes, pParent, pImport )
800 class DateFieldElement
801 : public ControlElement
803 public:
804 virtual css::uno::Reference< css::xml::input::XElement >
805 SAL_CALL startChildElement(
806 sal_Int32 nUid, OUString const & rLocalName,
807 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
808 virtual void SAL_CALL endElement() override;
810 DateFieldElement(
811 OUString const & rLocalName,
812 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
813 ElementBase * pParent, DialogImport * pImport )
814 : ControlElement( rLocalName, xAttributes, pParent, pImport )
818 class NumericFieldElement
819 : public ControlElement
821 public:
822 virtual css::uno::Reference< css::xml::input::XElement >
823 SAL_CALL startChildElement(
824 sal_Int32 nUid, OUString const & rLocalName,
825 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
826 virtual void SAL_CALL endElement() override;
828 NumericFieldElement(
829 OUString const & rLocalName,
830 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
831 ElementBase * pParent, DialogImport * pImport )
832 : ControlElement( rLocalName, xAttributes, pParent, pImport )
836 class TimeFieldElement
837 : public ControlElement
839 public:
840 virtual css::uno::Reference< css::xml::input::XElement >
841 SAL_CALL startChildElement(
842 sal_Int32 nUid, OUString const & rLocalName,
843 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
844 virtual void SAL_CALL endElement() override;
846 TimeFieldElement(
847 OUString const & rLocalName,
848 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
849 ElementBase * pParent, DialogImport * pImport )
850 : ControlElement( rLocalName, xAttributes, pParent, pImport )
854 class PatternFieldElement
855 : public ControlElement
857 public:
858 virtual css::uno::Reference< css::xml::input::XElement >
859 SAL_CALL startChildElement(
860 sal_Int32 nUid, OUString const & rLocalName,
861 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
862 virtual void SAL_CALL endElement() override;
864 PatternFieldElement(
865 OUString const & rLocalName,
866 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
867 ElementBase * pParent, DialogImport * pImport )
868 : ControlElement( rLocalName, xAttributes, pParent, pImport )
872 class FormattedFieldElement
873 : public ControlElement
875 public:
876 virtual css::uno::Reference< css::xml::input::XElement >
877 SAL_CALL startChildElement(
878 sal_Int32 nUid, OUString const & rLocalName,
879 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
880 virtual void SAL_CALL endElement() override;
882 FormattedFieldElement(
883 OUString const & rLocalName,
884 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
885 ElementBase * pParent, DialogImport * pImport )
886 : ControlElement( rLocalName, xAttributes, pParent, pImport )
890 class FixedLineElement
891 : public ControlElement
893 public:
894 virtual css::uno::Reference< css::xml::input::XElement >
895 SAL_CALL startChildElement(
896 sal_Int32 nUid, OUString const & rLocalName,
897 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
898 virtual void SAL_CALL endElement() override;
900 FixedLineElement(
901 OUString const & rLocalName,
902 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
903 ElementBase * pParent, DialogImport * pImport )
904 : ControlElement( rLocalName, xAttributes, pParent, pImport )
908 class ScrollBarElement
909 : public ControlElement
911 public:
912 virtual css::uno::Reference< css::xml::input::XElement >
913 SAL_CALL startChildElement(
914 sal_Int32 nUid, OUString const & rLocalName,
915 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
916 virtual void SAL_CALL endElement() override;
918 ScrollBarElement(
919 OUString const & rLocalName,
920 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
921 ElementBase * pParent, DialogImport * pImport )
922 : ControlElement( rLocalName, xAttributes, pParent, pImport )
926 class SpinButtonElement
927 : public ControlElement
929 public:
930 virtual css::uno::Reference< css::xml::input::XElement >
931 SAL_CALL startChildElement(
932 sal_Int32 nUid, OUString const & rLocalName,
933 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
934 virtual void SAL_CALL endElement() override;
936 SpinButtonElement(
937 OUString const & rLocalName,
938 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
939 ElementBase * pParent, DialogImport * pImport )
940 : ControlElement( rLocalName, xAttributes, pParent, pImport )
944 class MultiPage
945 : public ControlElement
947 public:
948 virtual css::uno::Reference< css::xml::input::XElement >
949 SAL_CALL startChildElement(
950 sal_Int32 nUid, OUString const & rLocalName,
951 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
952 virtual void SAL_CALL endElement() override;
954 MultiPage(
955 OUString const & rLocalName,
956 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
957 ElementBase * pParent, DialogImport * pImport )
958 : ControlElement( rLocalName, xAttributes, pParent, pImport )
960 m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoMultiPageModel" ), css::uno::UNO_QUERY );
962 private:
963 css::uno::Reference< css::container::XNameContainer > m_xContainer;
966 class Frame
967 : public ControlElement
969 OUString _label;
970 public:
971 virtual css::uno::Reference< css::xml::input::XElement >
972 SAL_CALL startChildElement(
973 sal_Int32 nUid, OUString const & rLocalName,
974 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
975 virtual void SAL_CALL endElement() override;
977 Frame(
978 OUString const & rLocalName,
979 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
980 ElementBase * pParent, DialogImport * pImport )
981 : ControlElement( rLocalName, xAttributes, pParent, pImport )
983 private:
984 css::uno::Reference< css::container::XNameContainer > m_xContainer;
987 class Page
988 : public ControlElement
990 public:
991 virtual css::uno::Reference< css::xml::input::XElement >
992 SAL_CALL startChildElement(
993 sal_Int32 nUid, OUString const & rLocalName,
994 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
995 virtual void SAL_CALL endElement() override;
997 Page(
998 OUString const & rLocalName,
999 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1000 ElementBase * pParent, DialogImport * pImport )
1001 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1003 m_xContainer.set( m_xImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoPageModel" ), css::uno::UNO_QUERY );
1005 private:
1006 css::uno::Reference< css::container::XNameContainer > m_xContainer;
1009 class ProgressBarElement
1010 : public ControlElement
1012 public:
1013 virtual css::uno::Reference< css::xml::input::XElement >
1014 SAL_CALL startChildElement(
1015 sal_Int32 nUid, OUString const & rLocalName,
1016 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
1017 virtual void SAL_CALL endElement() override;
1019 ProgressBarElement(
1020 OUString const & rLocalName,
1021 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1022 ElementBase * pParent, DialogImport * pImport )
1023 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1027 //==============================================================================
1028 class GridControlElement
1029 : public ControlElement
1031 public:
1032 virtual css::uno::Reference< css::xml::input::XElement >
1033 SAL_CALL startChildElement(
1034 sal_Int32 nUid,::rtl::OUString const & rLocalName,
1035 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) override;
1036 virtual void SAL_CALL endElement() override;
1038 GridControlElement(OUString const & rLocalName,
1039 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1040 ElementBase * pParent, DialogImport * pImport )
1041 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1048 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */