bump product version to 5.0.4.1
[LibreOffice.git] / xmlscript / source / xmldlg_imexp / imp_share.hxx
blobcec6fe51aebe048b10bd4fd7c66dfaa5d7787bbe
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 #ifndef INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX
21 #define INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX
23 #include "common.hxx"
24 #include "misc.hxx"
25 #include <xmlscript/xmldlg_imexp.hxx>
26 #include <xmlscript/xmllib_imexp.hxx>
27 #include <xmlscript/xmlmod_imexp.hxx>
28 #include <cppuhelper/implbase1.hxx>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
32 #include <com/sun/star/container/XNameContainer.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
35 #include <com/sun/star/awt/XControlModel.hpp>
36 #include <com/sun/star/awt/FontDescriptor.hpp>
37 #include <com/sun/star/awt/FontEmphasisMark.hpp>
38 #include <com/sun/star/awt/FontRelief.hpp>
39 #include <com/sun/star/xml/input/XRoot.hpp>
40 #include <com/sun/star/script/XLibraryContainer.hpp>
41 #include <com/sun/star/container/ElementExistException.hpp>
42 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
43 #include <osl/diagnose.h>
44 #include <vector>
45 #include <boost/shared_ptr.hpp>
47 namespace xmlscript
50 inline sal_Int32 toInt32( OUString const & rStr )
52 sal_Int32 nVal;
53 if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x')
54 nVal = rStr.copy( 2 ).toUInt32( 16 );
55 else
56 nVal = rStr.toInt32();
57 return nVal;
60 inline bool getBoolAttr(
61 sal_Bool * pRet, OUString const & rAttrName,
62 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
63 sal_Int32 nUid )
65 OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
66 if (!aValue.isEmpty())
68 if ( aValue == "true" )
70 *pRet = sal_True;
71 return true;
73 else if ( aValue == "false" )
75 *pRet = sal_False;
76 return true;
78 else
80 throw css::xml::sax::SAXException(
81 rAttrName + ": no boolean value (true|false)!",
82 css::uno::Reference<css::uno::XInterface>(), css::uno::Any() );
85 return false;
88 inline bool getStringAttr(
89 OUString * pRet, OUString const & rAttrName,
90 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
91 sal_Int32 nUid )
93 *pRet = xAttributes->getValueByUidName( nUid, rAttrName );
94 return (!pRet->isEmpty());
97 inline bool getLongAttr(
98 sal_Int32 * pRet, OUString const & rAttrName,
99 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
100 sal_Int32 nUid )
102 OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
103 if (!aValue.isEmpty())
105 *pRet = toInt32( aValue );
106 return true;
108 return false;
111 class ImportContext;
113 struct DialogImport
114 : public ::cppu::WeakImplHelper1< css::xml::input::XRoot >
116 friend class ImportContext;
118 css::uno::Reference< css::uno::XComponentContext > _xContext;
119 css::uno::Reference< css::util::XNumberFormatsSupplier > _xSupplier;
121 ::boost::shared_ptr< ::std::vector< OUString > > _pStyleNames;
122 ::boost::shared_ptr< ::std::vector< css::uno::Reference< css::xml::input::XElement > > > _pStyles;
124 css::uno::Reference< css::container::XNameContainer > _xDialogModel;
125 css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory;
126 css::uno::Reference< css::frame::XModel > _xDoc;
127 css::uno::Reference< css::script::XLibraryContainer > _xScriptLibraryContainer;
129 sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
131 public:
132 inline bool isEventElement(
133 sal_Int32 nUid, OUString const & rLocalName )
135 return ((XMLNS_SCRIPT_UID == nUid && (rLocalName == "event" || rLocalName == "listener-event" )) ||
136 (XMLNS_DIALOGS_UID == nUid && rLocalName == "event" ));
139 void addStyle(
140 OUString const & rStyleId,
141 css::uno::Reference< css::xml::input::XElement > const & xStyle );
142 css::uno::Reference< css::xml::input::XElement > getStyle(
143 OUString const & rStyleId ) const;
145 inline css::uno::Reference< css::uno::XComponentContext >
146 const & getComponentContext() { return _xContext; }
147 css::uno::Reference< css::util::XNumberFormatsSupplier >
148 const & getNumberFormatsSupplier();
150 inline DialogImport(
151 css::uno::Reference<css::uno::XComponentContext> const & xContext,
152 css::uno::Reference<css::container::XNameContainer>
153 const & xDialogModel,
154 ::boost::shared_ptr< ::std::vector< OUString > >& pStyleNames,
155 ::boost::shared_ptr< ::std::vector< css::uno::Reference< css::xml::input::XElement > > >& pStyles,
156 css::uno::Reference<css::frame::XModel> const & xDoc )
157 : _xContext( xContext )
158 , _pStyleNames( pStyleNames )
159 , _pStyles( pStyles )
160 , _xDialogModel( xDialogModel )
161 , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ), _xDoc( xDoc )
162 , XMLNS_DIALOGS_UID( 0 )
163 , XMLNS_SCRIPT_UID( 0 )
164 { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() &&
165 _xContext.is() ); }
166 inline DialogImport( const DialogImport& rOther ) :
167 ::cppu::WeakImplHelper1< css::xml::input::XRoot >()
168 , _xContext( rOther._xContext )
169 , _xSupplier( rOther._xSupplier )
170 , _pStyleNames( rOther._pStyleNames )
171 , _pStyles( rOther._pStyles )
172 , _xDialogModel( rOther._xDialogModel )
173 , _xDialogModelFactory( rOther._xDialogModelFactory )
174 , _xDoc( rOther._xDoc )
175 , XMLNS_DIALOGS_UID( rOther.XMLNS_DIALOGS_UID )
176 , XMLNS_SCRIPT_UID( rOther.XMLNS_SCRIPT_UID ) {}
178 virtual ~DialogImport();
180 inline css::uno::Reference< css::frame::XModel > getDocOwner() { return _xDoc; }
182 // XRoot
183 virtual void SAL_CALL startDocument(
184 css::uno::Reference< css::xml::input::XNamespaceMapping >
185 const & xNamespaceMapping )
186 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
187 virtual void SAL_CALL endDocument()
188 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
189 virtual void SAL_CALL processingInstruction(
190 OUString const & rTarget, OUString const & rData )
191 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
192 virtual void SAL_CALL setDocumentLocator(
193 css::uno::Reference< css::xml::sax::XLocator > const & xLocator )
194 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 virtual css::uno::Reference< css::xml::input::XElement >
196 SAL_CALL startRootElement(
197 sal_Int32 nUid, OUString const & rLocalName,
198 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
199 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
202 class ElementBase
203 : public ::cppu::WeakImplHelper1< css::xml::input::XElement >
205 protected:
206 DialogImport * const _pImport;
207 ElementBase * const _pParent;
209 const sal_Int32 _nUid;
210 const OUString _aLocalName;
211 const css::uno::Reference< css::xml::input::XAttributes > _xAttributes;
213 public:
214 ElementBase(
215 sal_Int32 nUid, OUString const & rLocalName,
216 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
217 ElementBase * pParent, DialogImport * pImport );
218 virtual ~ElementBase();
220 // XElement
221 virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL getParent()
222 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
223 virtual OUString SAL_CALL getLocalName()
224 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
225 virtual sal_Int32 SAL_CALL getUid()
226 throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
227 virtual css::uno::Reference< css::xml::input::XAttributes >
228 SAL_CALL getAttributes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
229 virtual void SAL_CALL ignorableWhitespace(
230 OUString const & rWhitespaces )
231 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
232 virtual void SAL_CALL characters( OUString const & rChars )
233 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
234 virtual void SAL_CALL processingInstruction(
235 OUString const & Target, OUString const & Data )
236 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
237 virtual void SAL_CALL endElement()
238 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
239 virtual css::uno::Reference< css::xml::input::XElement >
240 SAL_CALL startChildElement(
241 sal_Int32 nUid, OUString const & rLocalName,
242 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
243 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
246 class StylesElement
247 : public ElementBase
249 public:
250 virtual css::uno::Reference< css::xml::input::XElement >
251 SAL_CALL startChildElement(
252 sal_Int32 nUid, OUString const & rLocalName,
253 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
254 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
256 inline StylesElement(
257 OUString const & rLocalName,
258 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
259 ElementBase * pParent, DialogImport * pImport )
260 : ElementBase( pImport->XMLNS_DIALOGS_UID,
261 rLocalName, xAttributes, pParent, pImport )
265 class StyleElement
266 : public ElementBase
268 sal_Int32 _backgroundColor;
269 sal_Int32 _textColor;
270 sal_Int32 _textLineColor;
271 sal_Int16 _border;
272 sal_Int32 _borderColor;
273 css::awt::FontDescriptor _descr;
274 sal_Int16 _fontRelief;
275 sal_Int16 _fontEmphasisMark;
276 sal_Int32 _fillColor;
277 sal_Int16 _visualEffect;
279 // current highest mask: 0x40
280 short _inited, _hasValue;
282 void setFontProperties(
283 css::uno::Reference< css::beans::XPropertySet > const & xProps );
285 public:
286 virtual css::uno::Reference< css::xml::input::XElement >
287 SAL_CALL startChildElement(
288 sal_Int32 nUid, OUString const & rLocalName,
289 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
290 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
291 virtual void SAL_CALL endElement()
292 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
294 bool importTextColorStyle(
295 css::uno::Reference< css::beans::XPropertySet > const & xProps );
296 bool importTextLineColorStyle(
297 css::uno::Reference< css::beans::XPropertySet > const & xProps );
298 bool importFillColorStyle(
299 css::uno::Reference< css::beans::XPropertySet > const & xProps );
300 bool importBackgroundColorStyle(
301 css::uno::Reference< css::beans::XPropertySet > const & xProps );
302 bool importFontStyle(
303 css::uno::Reference< css::beans::XPropertySet > const & xProps );
304 bool importBorderStyle(
305 css::uno::Reference< css::beans::XPropertySet > const & xProps );
306 bool importVisualEffectStyle(
307 css::uno::Reference< css::beans::XPropertySet > const & xProps );
309 StyleElement(
310 OUString const & rLocalName,
311 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
312 ElementBase * pParent, DialogImport * pImport )
313 : ElementBase( pImport->XMLNS_DIALOGS_UID,
314 rLocalName, xAttributes, pParent, pImport )
315 , _backgroundColor(0)
316 , _textColor(0)
317 , _textLineColor(0)
318 , _border(0)
319 , _borderColor(0)
320 , _fontRelief( css::awt::FontRelief::NONE )
321 , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE )
322 , _fillColor(0)
323 , _visualEffect(0)
324 , _inited( 0 )
325 , _hasValue( 0 )
330 class MenuPopupElement
331 : public ElementBase
333 ::std::vector< OUString > _itemValues;
334 ::std::vector< sal_Int16 > _itemSelected;
335 public:
336 css::uno::Sequence< OUString > getItemValues();
337 css::uno::Sequence< sal_Int16 > getSelectedItems();
339 virtual css::uno::Reference< css::xml::input::XElement >
340 SAL_CALL startChildElement(
341 sal_Int32 nUid, OUString const & rLocalName,
342 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
343 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
345 inline MenuPopupElement(
346 OUString const & rLocalName,
347 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
348 ElementBase * pParent, DialogImport * pImport )
349 : ElementBase( pImport->XMLNS_DIALOGS_UID,
350 rLocalName, xAttributes, pParent, pImport )
354 class ControlElement
355 : public ElementBase
357 friend class EventElement;
359 protected:
360 sal_Int32 _nBasePosX, _nBasePosY;
362 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _events;
364 OUString getControlId(
365 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
366 OUString getControlModelName(
367 OUString const& rDefaultModel,
368 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
369 css::uno::Reference< css::xml::input::XElement > getStyle(
370 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
371 public:
372 ::std::vector<css::uno::Reference< css::xml::input::XElement> >& getEvents()
373 { return _events; }
375 ControlElement(
376 OUString const & rLocalName,
377 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
378 ElementBase * pParent, DialogImport * pImport );
381 class ImportContext
383 protected:
384 DialogImport * const _pImport;
385 const css::uno::Reference< css::beans::XPropertySet > _xControlModel;
386 const OUString _aId;
388 public:
389 inline ImportContext(
390 DialogImport * pImport,
391 css::uno::Reference< css::beans::XPropertySet > const & xControlModel_,
392 OUString const & id )
393 : _pImport( pImport ),
394 _xControlModel( xControlModel_ ),
395 _aId( id )
396 { OSL_ASSERT( _xControlModel.is() ); }
398 inline css::uno::Reference< css::beans::XPropertySet > getControlModel() const
399 { return _xControlModel; }
401 void importScollableSettings( css::uno::Reference< css::xml::input::XAttributes > const & xAttributes );
402 void importDefaults(
403 sal_Int32 nBaseX, sal_Int32 nBaseY,
404 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
405 bool supportPrintable = true );
406 void importEvents(
407 ::std::vector< css::uno::Reference< css::xml::input::XElement > >
408 const & rEvents );
410 bool importStringProperty(
411 OUString const & rPropName, OUString const & rAttrName,
412 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
413 bool importDoubleProperty(
414 OUString const & rPropName, OUString const & rAttrName,
415 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
416 bool importBooleanProperty(
417 OUString const & rPropName, OUString const & rAttrName,
418 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
419 bool importShortProperty(
420 OUString const & rPropName, OUString const & rAttrName,
421 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
422 bool importLongProperty(
423 OUString const & rPropName, OUString const & rAttrName,
424 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
425 bool importLongProperty(
426 sal_Int32 nOffset,
427 OUString const & rPropName, OUString const & rAttrName,
428 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
429 bool importHexLongProperty(
430 OUString const & rPropName, OUString const & rAttrName,
431 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
432 bool importAlignProperty(
433 OUString const & rPropName, OUString const & rAttrName,
434 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
435 bool importVerticalAlignProperty(
436 OUString const & rPropName, OUString const & rAttrName,
437 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
438 bool importImageURLProperty( OUString const & rPropName, OUString const & rAttrName,
439 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes );
440 bool importImageAlignProperty(
441 OUString const & rPropName, OUString const & rAttrName,
442 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
443 bool importImagePositionProperty(
444 OUString const & rPropName, OUString const & rAttrName,
445 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
446 bool importDateProperty(
447 OUString const & rPropName, OUString const & rAttrName,
448 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
449 bool importDateFormatProperty(
450 OUString const & rPropName, OUString const & rAttrName,
451 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
452 bool importTimeProperty(
453 OUString const & rPropName, OUString const & rAttrName,
454 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
455 bool importTimeFormatProperty(
456 OUString const & rPropName, OUString const & rAttrName,
457 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
458 bool importOrientationProperty(
459 OUString const & rPropName, OUString const & rAttrName,
460 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
461 bool importButtonTypeProperty(
462 OUString const & rPropName, OUString const & rAttrName,
463 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
464 bool importLineEndFormatProperty(
465 OUString const & rPropName, OUString const & rAttrName,
466 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
467 bool importSelectionTypeProperty(
468 OUString const & rPropName, OUString const & rAttrName,
469 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
470 bool importDataAwareProperty(
471 OUString const & rPropName,
472 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
473 bool importImageScaleModeProperty(
474 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
475 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
478 class ControlImportContext : public ImportContext
480 public:
481 inline ControlImportContext(
482 DialogImport * pImport,
483 OUString const & rId, OUString const & rControlName )
484 : ImportContext(
485 pImport,
486 css::uno::Reference< css::beans::XPropertySet >(
487 pImport->_xDialogModelFactory->createInstance( rControlName ),
488 css::uno::UNO_QUERY_THROW ), rId )
490 inline ControlImportContext(
491 DialogImport * pImport,
492 const css::uno::Reference< css::beans::XPropertySet >& xProps, OUString const & rControlName )
493 : ImportContext(
494 pImport,
495 xProps,
496 rControlName )
498 inline ~ControlImportContext()
502 inline void finish() throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception)
506 _pImport->_xDialogModel->insertByName(
507 _aId, css::uno::makeAny(
508 css::uno::Reference<css::awt::XControlModel>::query(
509 _xControlModel ) ) );
511 catch(const css::container::ElementExistException &e)
513 throw css::lang::WrappedTargetRuntimeException("", e.Context, makeAny(e));
518 class WindowElement
519 : public ControlElement
521 public:
522 virtual css::uno::Reference< css::xml::input::XElement >
523 SAL_CALL startChildElement(
524 sal_Int32 nUid, OUString const & rLocalName,
525 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
526 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
527 virtual void SAL_CALL endElement()
528 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
530 inline WindowElement(
531 OUString const & rLocalName,
532 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
533 ElementBase * pParent, DialogImport * pImport )
534 : ControlElement( rLocalName, xAttributes, pParent, pImport )
538 class EventElement
539 : public ElementBase
541 public:
542 virtual void SAL_CALL endElement()
543 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
545 inline EventElement(
546 sal_Int32 nUid, OUString const & rLocalName,
547 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
548 ElementBase * pParent, DialogImport * pImport )
549 : ElementBase( nUid, rLocalName, xAttributes, pParent, pImport )
553 class BulletinBoardElement
554 : public ControlElement
556 public:
557 virtual css::uno::Reference< css::xml::input::XElement >
558 SAL_CALL startChildElement(
559 sal_Int32 nUid, OUString const & rLocalName,
560 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
561 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
563 BulletinBoardElement(
564 OUString const & rLocalName,
565 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
566 ElementBase * pParent, DialogImport * pImport );
569 class ButtonElement
570 : public ControlElement
572 public:
573 virtual css::uno::Reference< css::xml::input::XElement >
574 SAL_CALL startChildElement(
575 sal_Int32 nUid, OUString const & rLocalName,
576 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
577 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
578 virtual void SAL_CALL endElement()
579 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
581 inline ButtonElement(
582 OUString const & rLocalName,
583 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
584 ElementBase * pParent, DialogImport * pImport )
585 : ControlElement( rLocalName, xAttributes, pParent, pImport )
589 class CheckBoxElement
590 : public ControlElement
592 public:
593 virtual css::uno::Reference< css::xml::input::XElement >
594 SAL_CALL startChildElement(
595 sal_Int32 nUid, OUString const & rLocalName,
596 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
597 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
598 virtual void SAL_CALL endElement()
599 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
601 inline CheckBoxElement(
602 OUString const & rLocalName,
603 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
604 ElementBase * pParent, DialogImport * pImport )
605 : ControlElement( rLocalName, xAttributes, pParent, pImport )
609 class ComboBoxElement
610 : public ControlElement
612 css::uno::Reference< css::xml::input::XElement > _popup;
613 public:
614 virtual css::uno::Reference< css::xml::input::XElement >
615 SAL_CALL startChildElement(
616 sal_Int32 nUid, OUString const & rLocalName,
617 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
618 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
619 virtual void SAL_CALL endElement()
620 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
622 inline ComboBoxElement(
623 OUString const & rLocalName,
624 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
625 ElementBase * pParent, DialogImport * pImport )
626 : ControlElement( rLocalName, xAttributes, pParent, pImport )
630 class MenuListElement
631 : public ControlElement
633 css::uno::Reference< css::xml::input::XElement > _popup;
634 public:
635 virtual css::uno::Reference< css::xml::input::XElement >
636 SAL_CALL startChildElement(
637 sal_Int32 nUid, OUString const & rLocalName,
638 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
639 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
640 virtual void SAL_CALL endElement()
641 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
643 inline MenuListElement(
644 OUString const & rLocalName,
645 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
646 ElementBase * pParent, DialogImport * pImport )
647 : ControlElement( rLocalName, xAttributes, pParent, pImport )
651 class RadioElement
652 : public ControlElement
654 public:
655 virtual css::uno::Reference< css::xml::input::XElement >
656 SAL_CALL startChildElement(
657 sal_Int32 nUid, OUString const & rLocalName,
658 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
659 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
661 inline RadioElement(
662 OUString const & rLocalName,
663 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
664 ElementBase * pParent, DialogImport * pImport )
665 : ControlElement( rLocalName, xAttributes, pParent, pImport )
669 class RadioGroupElement
670 : public ControlElement
672 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _radios;
673 public:
674 virtual css::uno::Reference< css::xml::input::XElement >
675 SAL_CALL startChildElement(
676 sal_Int32 nUid, OUString const & rLocalName,
677 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
678 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
679 void SAL_CALL endElement()
680 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
682 inline RadioGroupElement(
683 OUString const & rLocalName,
684 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
685 ElementBase * pParent, DialogImport * pImport )
686 : ControlElement( rLocalName, xAttributes, pParent, pImport )
690 class TitledBoxElement
691 : public BulletinBoardElement
693 OUString _label;
694 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _radios;
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 )
700 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
701 virtual void SAL_CALL endElement()
702 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
704 inline TitledBoxElement(
705 OUString const & rLocalName,
706 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
707 ElementBase * pParent, DialogImport * pImport )
708 : BulletinBoardElement( rLocalName, xAttributes, pParent, pImport )
712 class TextElement
713 : public ControlElement
715 public:
716 virtual css::uno::Reference< css::xml::input::XElement >
717 SAL_CALL startChildElement(
718 sal_Int32 nUid, OUString const & rLocalName,
719 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
720 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
721 virtual void SAL_CALL endElement()
722 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
724 inline TextElement(
725 OUString const & rLocalName,
726 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
727 ElementBase * pParent, DialogImport * pImport )
728 : ControlElement( rLocalName, xAttributes, pParent, pImport )
731 class FixedHyperLinkElement
732 : public ControlElement
734 public:
735 virtual css::uno::Reference< css::xml::input::XElement >
736 SAL_CALL startChildElement(
737 sal_Int32 nUid, OUString const & rLocalName,
738 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
739 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
740 virtual void SAL_CALL endElement()
741 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
743 inline FixedHyperLinkElement(
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 TextFieldElement
752 : public ControlElement
754 public:
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 )
759 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
760 virtual void SAL_CALL endElement()
761 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
763 inline TextFieldElement(
764 OUString const & rLocalName,
765 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
766 ElementBase * pParent, DialogImport * pImport )
767 : ControlElement( rLocalName, xAttributes, pParent, pImport )
771 class ImageControlElement
772 : public ControlElement
774 public:
775 virtual css::uno::Reference< css::xml::input::XElement >
776 SAL_CALL startChildElement(
777 sal_Int32 nUid, OUString const & rLocalName,
778 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
779 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
780 virtual void SAL_CALL endElement()
781 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
783 inline ImageControlElement(
784 OUString const & rLocalName,
785 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
786 ElementBase * pParent, DialogImport * pImport )
787 : ControlElement( rLocalName, xAttributes, pParent, pImport )
791 class FileControlElement
792 : public ControlElement
794 public:
795 virtual css::uno::Reference< css::xml::input::XElement >
796 SAL_CALL startChildElement(
797 sal_Int32 nUid, OUString const & rLocalName,
798 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
799 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
800 virtual void SAL_CALL endElement()
801 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
803 inline FileControlElement(
804 OUString const & rLocalName,
805 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
806 ElementBase * pParent, DialogImport * pImport )
807 : ControlElement( rLocalName, xAttributes, pParent, pImport )
811 class TreeControlElement
812 : public ControlElement
814 public:
815 virtual css::uno::Reference< css::xml::input::XElement >
816 SAL_CALL startChildElement(
817 sal_Int32 nUid, OUString const & rLocalName,
818 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
819 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
820 virtual void SAL_CALL endElement()
821 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
823 inline TreeControlElement(
824 OUString const & rLocalName,
825 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
826 ElementBase * pParent, DialogImport * pImport )
827 : ControlElement( rLocalName, xAttributes, pParent, pImport )
831 class CurrencyFieldElement
832 : public ControlElement
834 public:
835 virtual css::uno::Reference< css::xml::input::XElement >
836 SAL_CALL startChildElement(
837 sal_Int32 nUid, OUString const & rLocalName,
838 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
839 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
840 virtual void SAL_CALL endElement()
841 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
843 inline CurrencyFieldElement(
844 OUString const & rLocalName,
845 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
846 ElementBase * pParent, DialogImport * pImport )
847 : ControlElement( rLocalName, xAttributes, pParent, pImport )
851 class DateFieldElement
852 : public ControlElement
854 public:
855 virtual css::uno::Reference< css::xml::input::XElement >
856 SAL_CALL startChildElement(
857 sal_Int32 nUid, OUString const & rLocalName,
858 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
859 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
860 virtual void SAL_CALL endElement()
861 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
863 inline DateFieldElement(
864 OUString const & rLocalName,
865 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
866 ElementBase * pParent, DialogImport * pImport )
867 : ControlElement( rLocalName, xAttributes, pParent, pImport )
871 class NumericFieldElement
872 : public ControlElement
874 public:
875 virtual css::uno::Reference< css::xml::input::XElement >
876 SAL_CALL startChildElement(
877 sal_Int32 nUid, OUString const & rLocalName,
878 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
879 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
880 virtual void SAL_CALL endElement()
881 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
883 inline NumericFieldElement(
884 OUString const & rLocalName,
885 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
886 ElementBase * pParent, DialogImport * pImport )
887 : ControlElement( rLocalName, xAttributes, pParent, pImport )
891 class TimeFieldElement
892 : public ControlElement
894 public:
895 virtual css::uno::Reference< css::xml::input::XElement >
896 SAL_CALL startChildElement(
897 sal_Int32 nUid, OUString const & rLocalName,
898 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
899 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
900 virtual void SAL_CALL endElement()
901 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
903 inline TimeFieldElement(
904 OUString const & rLocalName,
905 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
906 ElementBase * pParent, DialogImport * pImport )
907 : ControlElement( rLocalName, xAttributes, pParent, pImport )
911 class PatternFieldElement
912 : public ControlElement
914 public:
915 virtual css::uno::Reference< css::xml::input::XElement >
916 SAL_CALL startChildElement(
917 sal_Int32 nUid, OUString const & rLocalName,
918 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
919 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
920 virtual void SAL_CALL endElement()
921 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
923 inline PatternFieldElement(
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 FormattedFieldElement
932 : public ControlElement
934 public:
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 )
939 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
940 virtual void SAL_CALL endElement()
941 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
943 inline FormattedFieldElement(
944 OUString const & rLocalName,
945 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
946 ElementBase * pParent, DialogImport * pImport )
947 : ControlElement( rLocalName, xAttributes, pParent, pImport )
951 class FixedLineElement
952 : public ControlElement
954 public:
955 virtual css::uno::Reference< css::xml::input::XElement >
956 SAL_CALL startChildElement(
957 sal_Int32 nUid, OUString const & rLocalName,
958 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
959 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
960 virtual void SAL_CALL endElement()
961 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
963 inline FixedLineElement(
964 OUString const & rLocalName,
965 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
966 ElementBase * pParent, DialogImport * pImport )
967 : ControlElement( rLocalName, xAttributes, pParent, pImport )
971 class ScrollBarElement
972 : public ControlElement
974 public:
975 virtual css::uno::Reference< css::xml::input::XElement >
976 SAL_CALL startChildElement(
977 sal_Int32 nUid, OUString const & rLocalName,
978 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
979 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
980 virtual void SAL_CALL endElement()
981 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
983 inline ScrollBarElement(
984 OUString const & rLocalName,
985 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
986 ElementBase * pParent, DialogImport * pImport )
987 : ControlElement( rLocalName, xAttributes, pParent, pImport )
991 class SpinButtonElement
992 : public ControlElement
994 public:
995 virtual css::uno::Reference< css::xml::input::XElement >
996 SAL_CALL startChildElement(
997 sal_Int32 nUid, OUString const & rLocalName,
998 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
999 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1000 virtual void SAL_CALL endElement()
1001 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1003 inline SpinButtonElement(
1004 OUString const & rLocalName,
1005 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1006 ElementBase * pParent, DialogImport * pImport )
1007 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1011 class MultiPage
1012 : public ControlElement
1014 public:
1015 virtual css::uno::Reference< css::xml::input::XElement >
1016 SAL_CALL startChildElement(
1017 sal_Int32 nUid, OUString const & rLocalName,
1018 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1019 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1020 virtual void SAL_CALL endElement()
1021 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1023 inline MultiPage(
1024 OUString const & rLocalName,
1025 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1026 ElementBase * pParent, DialogImport * pImport )
1027 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1029 m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoMultiPageModel" ), css::uno::UNO_QUERY );
1031 private:
1032 css::uno::Reference< css::container::XNameContainer > m_xContainer;
1035 class Frame
1036 : public ControlElement
1038 OUString _label;
1039 public:
1040 virtual css::uno::Reference< css::xml::input::XElement >
1041 SAL_CALL startChildElement(
1042 sal_Int32 nUid, OUString const & rLocalName,
1043 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1044 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1045 virtual void SAL_CALL endElement()
1046 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1048 inline Frame(
1049 OUString const & rLocalName,
1050 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1051 ElementBase * pParent, DialogImport * pImport )
1052 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1054 private:
1055 css::uno::Reference< css::container::XNameContainer > m_xContainer;
1058 class Page
1059 : public ControlElement
1061 public:
1062 virtual css::uno::Reference< css::xml::input::XElement >
1063 SAL_CALL startChildElement(
1064 sal_Int32 nUid, OUString const & rLocalName,
1065 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1066 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1067 virtual void SAL_CALL endElement()
1068 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1070 inline Page(
1071 OUString const & rLocalName,
1072 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1073 ElementBase * pParent, DialogImport * pImport )
1074 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1076 m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( "com.sun.star.awt.UnoPageModel" ), css::uno::UNO_QUERY );
1078 private:
1079 css::uno::Reference< css::container::XNameContainer > m_xContainer;
1082 class ProgressBarElement
1083 : public ControlElement
1085 public:
1086 virtual css::uno::Reference< css::xml::input::XElement >
1087 SAL_CALL startChildElement(
1088 sal_Int32 nUid, OUString const & rLocalName,
1089 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1090 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1091 virtual void SAL_CALL endElement()
1092 throw (css::xml::sax::SAXException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
1094 inline ProgressBarElement(
1095 OUString const & rLocalName,
1096 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1097 ElementBase * pParent, DialogImport * pImport )
1098 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1104 #endif // INCLUDED_XMLSCRIPT_SOURCE_XMLDLG_IMEXP_IMP_SHARE_HXX
1106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */