merge the formfield patch from ooo-build
[ooovba.git] / xmlscript / source / xmldlg_imexp / imp_share.hxx
blobca0c179c2e13836fdce3d22d55a700fdd4bf330e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imp_share.hxx,v $
10 * $Revision: 1.29 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "common.hxx"
32 #include "misc.hxx"
33 #include <xmlscript/xmldlg_imexp.hxx>
34 #include <xmlscript/xmllib_imexp.hxx>
35 #include <xmlscript/xmlmod_imexp.hxx>
36 #include <cppuhelper/implbase1.hxx>
37 #include <com/sun/star/uno/XComponentContext.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
40 #include <com/sun/star/container/XNameContainer.hpp>
41 #include <com/sun/star/beans/XPropertySet.hpp>
42 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
43 #include <com/sun/star/awt/XControlModel.hpp>
44 #include <com/sun/star/awt/FontDescriptor.hpp>
45 #include <com/sun/star/awt/FontEmphasisMark.hpp>
46 #include <com/sun/star/awt/FontRelief.hpp>
47 #include <com/sun/star/xml/input/XRoot.hpp>
48 #include <com/sun/star/script/XLibraryContainer.hpp>
49 #include <vector>
52 namespace css = ::com::sun::star;
54 namespace xmlscript
58 inline sal_Int32 toInt32( ::rtl::OUString const & rStr ) SAL_THROW( () )
60 sal_Int32 nVal;
61 if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x')
62 nVal = rStr.copy( 2 ).toInt32( 16 );
63 else
64 nVal = rStr.toInt32();
65 return nVal;
68 inline bool getBoolAttr(
69 sal_Bool * pRet, ::rtl::OUString const & rAttrName,
70 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
71 sal_Int32 nUid )
73 ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
74 if (aValue.getLength())
76 if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") ))
78 *pRet = sal_True;
79 return true;
81 else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("false") ))
83 *pRet = sal_False;
84 return true;
86 else
88 throw css::xml::sax::SAXException(
89 rAttrName + OUSTR(": no boolean value (true|false)!"),
90 css::uno::Reference<css::uno::XInterface>(), css::uno::Any() );
93 return false;
96 inline bool getStringAttr(
97 ::rtl::OUString * pRet, ::rtl::OUString const & rAttrName,
98 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
99 sal_Int32 nUid )
101 *pRet = xAttributes->getValueByUidName( nUid, rAttrName );
102 return (pRet->getLength() > 0);
105 inline bool getLongAttr(
106 sal_Int32 * pRet, ::rtl::OUString const & rAttrName,
107 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
108 sal_Int32 nUid )
110 ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) );
111 if (aValue.getLength())
113 *pRet = toInt32( aValue );
114 return true;
116 return false;
119 class ImportContext;
121 //==============================================================================
122 struct DialogImport
123 : public ::cppu::WeakImplHelper1< css::xml::input::XRoot >
125 friend class ImportContext;
127 css::uno::Reference< css::uno::XComponentContext > _xContext;
128 css::uno::Reference< css::util::XNumberFormatsSupplier > _xSupplier;
130 ::std::vector< ::rtl::OUString > _styleNames;
131 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _styles;
133 css::uno::Reference< css::container::XNameContainer > _xDialogModel;
134 css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory;
135 css::uno::Reference< css::frame::XModel > _xDoc;
136 css::uno::Reference< css::script::XLibraryContainer > _xScriptLibraryContainer;
138 sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
140 public:
141 inline bool isEventElement(
142 sal_Int32 nUid, ::rtl::OUString const & rLocalName )
144 return ((XMLNS_SCRIPT_UID == nUid &&
145 (rLocalName.equalsAsciiL(
146 RTL_CONSTASCII_STRINGPARAM("event") ) ||
147 rLocalName.equalsAsciiL(
148 RTL_CONSTASCII_STRINGPARAM("listener-event") ))) ||
149 (XMLNS_DIALOGS_UID == nUid &&
150 rLocalName.equalsAsciiL(
151 RTL_CONSTASCII_STRINGPARAM("event") )));
154 void addStyle(
155 ::rtl::OUString const & rStyleId,
156 css::uno::Reference< css::xml::input::XElement > const & xStyle )
157 SAL_THROW( () );
158 css::uno::Reference< css::xml::input::XElement > getStyle(
159 ::rtl::OUString const & rStyleId ) const
160 SAL_THROW( () );
162 inline css::uno::Reference< css::uno::XComponentContext >
163 const & getComponentContext() SAL_THROW( () ) { return _xContext; }
164 css::uno::Reference< css::util::XNumberFormatsSupplier >
165 const & getNumberFormatsSupplier();
167 inline DialogImport(
168 css::uno::Reference<css::uno::XComponentContext> const & xContext,
169 css::uno::Reference<css::container::XNameContainer>
170 const & xDialogModel,
171 css::uno::Reference<css::frame::XModel> const & xDoc )
172 SAL_THROW( () )
173 : _xContext( xContext )
174 , _xDialogModel( xDialogModel )
175 , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ), _xDoc( xDoc )
176 { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() &&
177 _xContext.is() ); }
178 virtual ~DialogImport()
179 SAL_THROW( () );
181 inline css::uno::Reference< css::frame::XModel > getDocOwner() { return _xDoc; }
183 css::uno::Reference< css::script::XLibraryContainer > getScriptLibraryContainer();
184 // XRoot
185 virtual void SAL_CALL startDocument(
186 css::uno::Reference< css::xml::input::XNamespaceMapping >
187 const & xNamespaceMapping )
188 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
189 virtual void SAL_CALL endDocument()
190 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
191 virtual void SAL_CALL processingInstruction(
192 ::rtl::OUString const & rTarget, ::rtl::OUString const & rData )
193 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
194 virtual void SAL_CALL setDocumentLocator(
195 css::uno::Reference< css::xml::sax::XLocator > const & xLocator )
196 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
197 virtual css::uno::Reference< css::xml::input::XElement >
198 SAL_CALL startRootElement(
199 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
200 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
201 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
204 //==============================================================================
205 class ElementBase
206 : public ::cppu::WeakImplHelper1< css::xml::input::XElement >
208 protected:
209 DialogImport * _pImport;
210 ElementBase * _pParent;
212 sal_Int32 _nUid;
213 ::rtl::OUString _aLocalName;
214 css::uno::Reference< css::xml::input::XAttributes > _xAttributes;
216 public:
217 ElementBase(
218 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
219 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
220 ElementBase * pParent, DialogImport * pImport )
221 SAL_THROW( () );
222 virtual ~ElementBase()
223 SAL_THROW( () );
225 // XElement
226 virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL getParent()
227 throw (css::uno::RuntimeException);
228 virtual ::rtl::OUString SAL_CALL getLocalName()
229 throw (css::uno::RuntimeException);
230 virtual sal_Int32 SAL_CALL getUid()
231 throw (css::uno::RuntimeException);
232 virtual css::uno::Reference< css::xml::input::XAttributes >
233 SAL_CALL getAttributes() throw (css::uno::RuntimeException);
234 virtual void SAL_CALL ignorableWhitespace(
235 ::rtl::OUString const & rWhitespaces )
236 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
237 virtual void SAL_CALL characters( ::rtl::OUString const & rChars )
238 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
239 virtual void SAL_CALL processingInstruction(
240 ::rtl::OUString const & Target, ::rtl::OUString const & Data )
241 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
242 virtual void SAL_CALL endElement()
243 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
244 virtual css::uno::Reference< css::xml::input::XElement >
245 SAL_CALL startChildElement(
246 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
247 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
248 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
251 //==============================================================================
252 class StylesElement
253 : public ElementBase
255 public:
256 virtual css::uno::Reference< css::xml::input::XElement >
257 SAL_CALL startChildElement(
258 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
259 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
260 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
262 inline StylesElement(
263 ::rtl::OUString const & rLocalName,
264 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
265 ElementBase * pParent, DialogImport * pImport )
266 SAL_THROW( () )
267 : ElementBase( pImport->XMLNS_DIALOGS_UID,
268 rLocalName, xAttributes, pParent, pImport )
272 //==============================================================================
273 class StyleElement
274 : public ElementBase
276 sal_Int32 _backgroundColor;
277 sal_Int32 _textColor;
278 sal_Int32 _textLineColor;
279 sal_Int16 _border;
280 sal_Int32 _borderColor;
281 css::awt::FontDescriptor _descr;
282 sal_Int16 _fontRelief;
283 sal_Int16 _fontEmphasisMark;
284 sal_Int32 _fillColor;
285 sal_Int16 _visualEffect;
287 // current highest mask: 0x40
288 short _inited, _hasValue;
290 void setFontProperties(
291 css::uno::Reference< css::beans::XPropertySet > const & xProps );
293 public:
294 virtual css::uno::Reference< css::xml::input::XElement >
295 SAL_CALL startChildElement(
296 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
297 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
298 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
299 virtual void SAL_CALL endElement()
300 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
302 bool importTextColorStyle(
303 css::uno::Reference< css::beans::XPropertySet > const & xProps );
304 bool importTextLineColorStyle(
305 css::uno::Reference< css::beans::XPropertySet > const & xProps );
306 bool importFillColorStyle(
307 css::uno::Reference< css::beans::XPropertySet > const & xProps );
308 bool importBackgroundColorStyle(
309 css::uno::Reference< css::beans::XPropertySet > const & xProps );
310 bool importFontStyle(
311 css::uno::Reference< css::beans::XPropertySet > const & xProps );
312 bool importBorderStyle(
313 css::uno::Reference< css::beans::XPropertySet > const & xProps );
314 bool importVisualEffectStyle(
315 css::uno::Reference< css::beans::XPropertySet > const & xProps );
317 inline StyleElement(
318 ::rtl::OUString const & rLocalName,
319 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
320 ElementBase * pParent, DialogImport * pImport )
321 SAL_THROW( () )
322 : ElementBase( pImport->XMLNS_DIALOGS_UID,
323 rLocalName, xAttributes, pParent, pImport )
324 , _fontRelief( css::awt::FontRelief::NONE )
325 , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE )
326 , _inited( 0 )
327 , _hasValue( 0 )
331 //==============================================================================
332 class MenuPopupElement
333 : public ElementBase
335 ::std::vector< ::rtl::OUString > _itemValues;
336 ::std::vector< sal_Int16 > _itemSelected;
337 public:
338 css::uno::Sequence< ::rtl::OUString > getItemValues();
339 css::uno::Sequence< sal_Int16 > getSelectedItems();
341 virtual css::uno::Reference< css::xml::input::XElement >
342 SAL_CALL startChildElement(
343 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
344 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
345 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
347 inline MenuPopupElement(
348 ::rtl::OUString const & rLocalName,
349 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
350 ElementBase * pParent, DialogImport * pImport )
351 SAL_THROW( () )
352 : ElementBase( pImport->XMLNS_DIALOGS_UID,
353 rLocalName, xAttributes, pParent, pImport )
357 //==============================================================================
358 class ControlElement
359 : public ElementBase
361 friend class EventElement;
363 protected:
364 sal_Int32 _nBasePosX, _nBasePosY;
366 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _events;
368 ::rtl::OUString getControlId(
369 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
370 css::uno::Reference< css::xml::input::XElement > getStyle(
371 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
372 public:
373 ::std::vector<css::uno::Reference< css::xml::input::XElement> > *getEvents()
374 SAL_THROW( () ) { return &_events; }
376 ControlElement(
377 ::rtl::OUString const & rLocalName,
378 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
379 ElementBase * pParent, DialogImport * pImport )
380 SAL_THROW( () );
383 //==============================================================================
384 class ImportContext
386 protected:
387 DialogImport * _pImport;
388 css::uno::Reference< css::beans::XPropertySet > _xControlModel;
389 ::rtl::OUString _aId;
391 public:
392 inline ImportContext(
393 DialogImport * pImport,
394 css::uno::Reference< css::beans::XPropertySet > const & xControlModel_,
395 ::rtl::OUString const & id )
396 : _pImport( pImport ),
397 _xControlModel( xControlModel_ ),
398 _aId( id )
399 { OSL_ASSERT( _xControlModel.is() ); }
401 inline css::uno::Reference< css::beans::XPropertySet > getControlModel()
402 { return _xControlModel; }
404 void importDefaults(
405 sal_Int32 nBaseX, sal_Int32 nBaseY,
406 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
407 bool supportPrintable = true );
408 void importEvents(
409 ::std::vector< css::uno::Reference< css::xml::input::XElement > >
410 const & rEvents );
412 bool importStringProperty(
413 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
414 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
415 bool importDoubleProperty(
416 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
417 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
418 bool importBooleanProperty(
419 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
420 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
421 bool importShortProperty(
422 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
423 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
424 bool importLongProperty(
425 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
426 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
427 bool importLongProperty(
428 sal_Int32 nOffset,
429 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
430 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
431 bool importHexLongProperty(
432 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
433 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
434 bool importAlignProperty(
435 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
436 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
437 bool importVerticalAlignProperty(
438 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
439 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
440 bool importImageAlignProperty(
441 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
442 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
443 bool importImagePositionProperty(
444 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
445 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
446 bool importDateFormatProperty(
447 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
448 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
449 bool importTimeFormatProperty(
450 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
451 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
452 bool importOrientationProperty(
453 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
454 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
455 bool importButtonTypeProperty(
456 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
457 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
458 bool importLineEndFormatProperty(
459 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
460 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
461 bool importSelectionTypeProperty(
462 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName,
463 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes );
466 //==============================================================================
467 class ControlImportContext : public ImportContext
469 public:
470 inline ControlImportContext(
471 DialogImport * pImport,
472 ::rtl::OUString const & rId, ::rtl::OUString const & rControlName )
473 : ImportContext(
474 pImport,
475 css::uno::Reference< css::beans::XPropertySet >(
476 pImport->_xDialogModelFactory->createInstance( rControlName ),
477 css::uno::UNO_QUERY_THROW ), rId )
479 inline ~ControlImportContext()
481 _pImport->_xDialogModel->insertByName(
482 _aId, css::uno::makeAny(
483 css::uno::Reference<css::awt::XControlModel>::query(
484 _xControlModel ) ) );
488 //==============================================================================
489 class WindowElement
490 : public ControlElement
492 public:
493 virtual css::uno::Reference< css::xml::input::XElement >
494 SAL_CALL startChildElement(
495 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
496 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
497 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
498 virtual void SAL_CALL endElement()
499 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
501 inline WindowElement(
502 ::rtl::OUString const & rLocalName,
503 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
504 ElementBase * pParent, DialogImport * pImport )
505 SAL_THROW( () )
506 : ControlElement( rLocalName, xAttributes, pParent, pImport )
510 //==============================================================================
511 class EventElement
512 : public ElementBase
514 public:
515 virtual void SAL_CALL endElement()
516 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
518 inline EventElement(
519 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
520 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
521 ElementBase * pParent, DialogImport * pImport )
522 SAL_THROW( () )
523 : ElementBase( nUid, rLocalName, xAttributes, pParent, pImport )
527 //==============================================================================
528 class BulletinBoardElement
529 : public ControlElement
531 public:
532 virtual css::uno::Reference< css::xml::input::XElement >
533 SAL_CALL startChildElement(
534 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
535 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
536 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
538 BulletinBoardElement(
539 ::rtl::OUString const & rLocalName,
540 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
541 ElementBase * pParent, DialogImport * pImport )
542 SAL_THROW( () );
545 //==============================================================================
546 class ButtonElement
547 : public ControlElement
549 public:
550 virtual css::uno::Reference< css::xml::input::XElement >
551 SAL_CALL startChildElement(
552 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
553 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
554 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
555 virtual void SAL_CALL endElement()
556 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
558 inline ButtonElement(
559 ::rtl::OUString const & rLocalName,
560 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
561 ElementBase * pParent, DialogImport * pImport )
562 SAL_THROW( () )
563 : ControlElement( rLocalName, xAttributes, pParent, pImport )
567 //==============================================================================
568 class CheckBoxElement
569 : public ControlElement
571 public:
572 virtual css::uno::Reference< css::xml::input::XElement >
573 SAL_CALL startChildElement(
574 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
575 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
576 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
577 virtual void SAL_CALL endElement()
578 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
580 inline CheckBoxElement(
581 ::rtl::OUString const & rLocalName,
582 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
583 ElementBase * pParent, DialogImport * pImport )
584 SAL_THROW( () )
585 : ControlElement( rLocalName, xAttributes, pParent, pImport )
589 //==============================================================================
590 class ComboBoxElement
591 : public ControlElement
593 css::uno::Reference< css::xml::input::XElement > _popup;
594 public:
595 virtual css::uno::Reference< css::xml::input::XElement >
596 SAL_CALL startChildElement(
597 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
598 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
599 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
600 virtual void SAL_CALL endElement()
601 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
603 inline ComboBoxElement(
604 ::rtl::OUString const & rLocalName,
605 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
606 ElementBase * pParent, DialogImport * pImport )
607 SAL_THROW( () )
608 : ControlElement( rLocalName, xAttributes, pParent, pImport )
612 //==============================================================================
613 class MenuListElement
614 : public ControlElement
616 css::uno::Reference< css::xml::input::XElement > _popup;
617 public:
618 virtual css::uno::Reference< css::xml::input::XElement >
619 SAL_CALL startChildElement(
620 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
621 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
622 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
623 virtual void SAL_CALL endElement()
624 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
626 inline MenuListElement(
627 ::rtl::OUString const & rLocalName,
628 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
629 ElementBase * pParent, DialogImport * pImport )
630 SAL_THROW( () )
631 : ControlElement( rLocalName, xAttributes, pParent, pImport )
635 //==============================================================================
636 class RadioElement
637 : public ControlElement
639 public:
640 virtual css::uno::Reference< css::xml::input::XElement >
641 SAL_CALL startChildElement(
642 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
643 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
644 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
646 inline RadioElement(
647 ::rtl::OUString const & rLocalName,
648 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
649 ElementBase * pParent, DialogImport * pImport )
650 SAL_THROW( () )
651 : ControlElement( rLocalName, xAttributes, pParent, pImport )
655 //==============================================================================
656 class RadioGroupElement
657 : public ControlElement
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, ::rtl::OUString const & rLocalName,
664 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
665 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
666 void SAL_CALL endElement()
667 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
669 inline RadioGroupElement(
670 ::rtl::OUString const & rLocalName,
671 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
672 ElementBase * pParent, DialogImport * pImport )
673 SAL_THROW( () )
674 : ControlElement( rLocalName, xAttributes, pParent, pImport )
678 //==============================================================================
679 class TitledBoxElement
680 : public BulletinBoardElement
682 ::rtl::OUString _label;
683 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _radios;
684 public:
685 virtual css::uno::Reference< css::xml::input::XElement >
686 SAL_CALL startChildElement(
687 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
688 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
689 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
690 virtual void SAL_CALL endElement()
691 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
693 inline TitledBoxElement(
694 ::rtl::OUString const & rLocalName,
695 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
696 ElementBase * pParent, DialogImport * pImport )
697 SAL_THROW( () )
698 : BulletinBoardElement( rLocalName, xAttributes, pParent, pImport )
702 //==============================================================================
703 class TextElement
704 : public ControlElement
706 public:
707 virtual css::uno::Reference< css::xml::input::XElement >
708 SAL_CALL startChildElement(
709 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
710 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
711 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
712 virtual void SAL_CALL endElement()
713 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
715 inline TextElement(
716 ::rtl::OUString const & rLocalName,
717 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
718 ElementBase * pParent, DialogImport * pImport )
719 SAL_THROW( () )
720 : ControlElement( rLocalName, xAttributes, pParent, pImport )
723 //==============================================================================
724 class FixedHyperLinkElement
725 : public ControlElement
727 public:
728 virtual css::uno::Reference< css::xml::input::XElement >
729 SAL_CALL startChildElement(
730 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
731 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
732 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
733 virtual void SAL_CALL endElement()
734 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
736 inline FixedHyperLinkElement(
737 ::rtl::OUString const & rLocalName,
738 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
739 ElementBase * pParent, DialogImport * pImport )
740 SAL_THROW( () )
741 : ControlElement( rLocalName, xAttributes, pParent, pImport )
744 //==============================================================================
745 class TextFieldElement
746 : public ControlElement
748 public:
749 virtual css::uno::Reference< css::xml::input::XElement >
750 SAL_CALL startChildElement(
751 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
752 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
753 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
754 virtual void SAL_CALL endElement()
755 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
757 inline TextFieldElement(
758 ::rtl::OUString const & rLocalName,
759 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
760 ElementBase * pParent, DialogImport * pImport )
761 SAL_THROW( () )
762 : ControlElement( rLocalName, xAttributes, pParent, pImport )
766 //==============================================================================
767 class ImageControlElement
768 : public ControlElement
770 public:
771 virtual css::uno::Reference< css::xml::input::XElement >
772 SAL_CALL startChildElement(
773 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
774 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
775 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
776 virtual void SAL_CALL endElement()
777 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
779 inline ImageControlElement(
780 ::rtl::OUString const & rLocalName,
781 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
782 ElementBase * pParent, DialogImport * pImport )
783 SAL_THROW( () )
784 : ControlElement( rLocalName, xAttributes, pParent, pImport )
788 //==============================================================================
789 class FileControlElement
790 : public ControlElement
792 public:
793 virtual css::uno::Reference< css::xml::input::XElement >
794 SAL_CALL startChildElement(
795 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
796 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
797 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
798 virtual void SAL_CALL endElement()
799 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
801 inline FileControlElement(
802 ::rtl::OUString const & rLocalName,
803 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
804 ElementBase * pParent, DialogImport * pImport )
805 SAL_THROW( () )
806 : ControlElement( rLocalName, xAttributes, pParent, pImport )
810 //==============================================================================
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, ::rtl::OUString const & rLocalName,
818 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
819 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
820 virtual void SAL_CALL endElement()
821 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
823 inline TreeControlElement(
824 ::rtl::OUString const & rLocalName,
825 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
826 ElementBase * pParent, DialogImport * pImport )
827 SAL_THROW( () )
828 : ControlElement( rLocalName, xAttributes, pParent, pImport )
832 //==============================================================================
833 class CurrencyFieldElement
834 : public ControlElement
836 public:
837 virtual css::uno::Reference< css::xml::input::XElement >
838 SAL_CALL startChildElement(
839 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
840 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
841 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
842 virtual void SAL_CALL endElement()
843 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
845 inline CurrencyFieldElement(
846 ::rtl::OUString const & rLocalName,
847 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
848 ElementBase * pParent, DialogImport * pImport )
849 SAL_THROW( () )
850 : ControlElement( rLocalName, xAttributes, pParent, pImport )
854 //==============================================================================
855 class DateFieldElement
856 : public ControlElement
858 public:
859 virtual css::uno::Reference< css::xml::input::XElement >
860 SAL_CALL startChildElement(
861 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
862 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
863 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
864 virtual void SAL_CALL endElement()
865 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
867 inline DateFieldElement(
868 ::rtl::OUString const & rLocalName,
869 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
870 ElementBase * pParent, DialogImport * pImport )
871 SAL_THROW( () )
872 : ControlElement( rLocalName, xAttributes, pParent, pImport )
876 //==============================================================================
877 class NumericFieldElement
878 : public ControlElement
880 public:
881 virtual css::uno::Reference< css::xml::input::XElement >
882 SAL_CALL startChildElement(
883 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
884 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
885 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
886 virtual void SAL_CALL endElement()
887 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
889 inline NumericFieldElement(
890 ::rtl::OUString const & rLocalName,
891 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
892 ElementBase * pParent, DialogImport * pImport )
893 SAL_THROW( () )
894 : ControlElement( rLocalName, xAttributes, pParent, pImport )
898 //==============================================================================
899 class TimeFieldElement
900 : public ControlElement
902 public:
903 virtual css::uno::Reference< css::xml::input::XElement >
904 SAL_CALL startChildElement(
905 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
906 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
907 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
908 virtual void SAL_CALL endElement()
909 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
911 inline TimeFieldElement(
912 ::rtl::OUString const & rLocalName,
913 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
914 ElementBase * pParent, DialogImport * pImport )
915 SAL_THROW( () )
916 : ControlElement( rLocalName, xAttributes, pParent, pImport )
920 //==============================================================================
921 class PatternFieldElement
922 : public ControlElement
924 public:
925 virtual css::uno::Reference< css::xml::input::XElement >
926 SAL_CALL startChildElement(
927 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
928 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
929 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
930 virtual void SAL_CALL endElement()
931 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
933 inline PatternFieldElement(
934 ::rtl::OUString const & rLocalName,
935 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
936 ElementBase * pParent, DialogImport * pImport )
937 SAL_THROW( () )
938 : ControlElement( rLocalName, xAttributes, pParent, pImport )
942 //==============================================================================
943 class FormattedFieldElement
944 : public ControlElement
946 public:
947 virtual css::uno::Reference< css::xml::input::XElement >
948 SAL_CALL startChildElement(
949 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
950 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
951 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
952 virtual void SAL_CALL endElement()
953 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
955 inline FormattedFieldElement(
956 ::rtl::OUString const & rLocalName,
957 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
958 ElementBase * pParent, DialogImport * pImport )
959 SAL_THROW( () )
960 : ControlElement( rLocalName, xAttributes, pParent, pImport )
964 //==============================================================================
965 class FixedLineElement
966 : public ControlElement
968 public:
969 virtual css::uno::Reference< css::xml::input::XElement >
970 SAL_CALL startChildElement(
971 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
972 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
973 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
974 virtual void SAL_CALL endElement()
975 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
977 inline FixedLineElement(
978 ::rtl::OUString const & rLocalName,
979 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
980 ElementBase * pParent, DialogImport * pImport )
981 SAL_THROW( () )
982 : ControlElement( rLocalName, xAttributes, pParent, pImport )
986 //==============================================================================
987 class ScrollBarElement
988 : public ControlElement
990 public:
991 virtual css::uno::Reference< css::xml::input::XElement >
992 SAL_CALL startChildElement(
993 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
994 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
995 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
996 virtual void SAL_CALL endElement()
997 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
999 inline ScrollBarElement(
1000 ::rtl::OUString const & rLocalName,
1001 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1002 ElementBase * pParent, DialogImport * pImport )
1003 SAL_THROW( () )
1004 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1008 //==============================================================================
1009 class SpinButtonElement
1010 : public ControlElement
1012 public:
1013 virtual css::uno::Reference< css::xml::input::XElement >
1014 SAL_CALL startChildElement(
1015 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
1016 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1017 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
1018 virtual void SAL_CALL endElement()
1019 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
1021 inline SpinButtonElement(
1022 ::rtl::OUString const & rLocalName,
1023 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1024 ElementBase * pParent, DialogImport * pImport )
1025 SAL_THROW( () )
1026 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1030 //==============================================================================
1031 class MultiPage
1032 : public ControlElement
1034 public:
1035 virtual css::uno::Reference< css::xml::input::XElement >
1036 SAL_CALL startChildElement(
1037 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
1038 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1039 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
1040 virtual void SAL_CALL endElement()
1041 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
1043 inline MultiPage(
1044 ::rtl::OUString const & rLocalName,
1045 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1046 ElementBase * pParent, DialogImport * pImport )
1047 SAL_THROW( () )
1048 : ControlElement( rLocalName, xAttributes, pParent, pImport )
1052 class ProgressBarElement
1053 : public ControlElement
1055 public:
1056 virtual css::uno::Reference< css::xml::input::XElement >
1057 SAL_CALL startChildElement(
1058 sal_Int32 nUid, ::rtl::OUString const & rLocalName,
1059 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
1060 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
1061 virtual void SAL_CALL endElement()
1062 throw (css::xml::sax::SAXException, css::uno::RuntimeException);
1064 inline ProgressBarElement(
1065 ::rtl::OUString const & rLocalName,
1066 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
1067 ElementBase * pParent, DialogImport * pImport )
1068 SAL_THROW( () )
1069 : ControlElement( rLocalName, xAttributes, pParent, pImport )