1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #include "common.hxx" 29 #include "misc.hxx" 30 #include <xmlscript/xmldlg_imexp.hxx> 31 #include <xmlscript/xmllib_imexp.hxx> 32 #include <xmlscript/xmlmod_imexp.hxx> 33 #include <cppuhelper/implbase1.hxx> 34 #include <com/sun/star/uno/XComponentContext.hpp> 35 #include <com/sun/star/lang/XMultiServiceFactory.hpp> 36 #include <com/sun/star/lang/XMultiComponentFactory.hpp> 37 #include <com/sun/star/container/XNameContainer.hpp> 38 #include <com/sun/star/beans/XPropertySet.hpp> 39 #include <com/sun/star/util/XNumberFormatsSupplier.hpp> 40 #include <com/sun/star/awt/XControlModel.hpp> 41 #include <com/sun/star/awt/FontDescriptor.hpp> 42 #include <com/sun/star/awt/FontEmphasisMark.hpp> 43 #include <com/sun/star/awt/FontRelief.hpp> 44 #include <com/sun/star/xml/input/XRoot.hpp> 45 #include <vector> 46 47 48 namespace css = ::com::sun::star; 49 50 namespace xmlscript 51 { 52 53 // 54 inline sal_Int32 toInt32( ::rtl::OUString const & rStr ) SAL_THROW( () ) 55 { 56 sal_Int32 nVal; 57 if (rStr.getLength() > 2 && rStr[ 0 ] == '0' && rStr[ 1 ] == 'x') 58 nVal = rStr.copy( 2 ).toInt32( 16 ); 59 else 60 nVal = rStr.toInt32(); 61 return nVal; 62 } 63 64 inline bool getBoolAttr( 65 sal_Bool * pRet, ::rtl::OUString const & rAttrName, 66 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 67 sal_Int32 nUid ) 68 { 69 ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) ); 70 if (aValue.getLength()) 71 { 72 if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("true") )) 73 { 74 *pRet = sal_True; 75 return true; 76 } 77 else if (aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("false") )) 78 { 79 *pRet = sal_False; 80 return true; 81 } 82 else 83 { 84 throw css::xml::sax::SAXException( 85 rAttrName + OUSTR(": no boolean value (true|false)!"), 86 css::uno::Reference<css::uno::XInterface>(), css::uno::Any() ); 87 } 88 } 89 return false; 90 } 91 92 inline bool getStringAttr( 93 ::rtl::OUString * pRet, ::rtl::OUString const & rAttrName, 94 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 95 sal_Int32 nUid ) 96 { 97 *pRet = xAttributes->getValueByUidName( nUid, rAttrName ); 98 return (pRet->getLength() > 0); 99 } 100 101 inline bool getLongAttr( 102 sal_Int32 * pRet, ::rtl::OUString const & rAttrName, 103 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 104 sal_Int32 nUid ) 105 { 106 ::rtl::OUString aValue( xAttributes->getValueByUidName( nUid, rAttrName ) ); 107 if (aValue.getLength()) 108 { 109 *pRet = toInt32( aValue ); 110 return true; 111 } 112 return false; 113 } 114 115 class ImportContext; 116 117 //============================================================================== 118 struct DialogImport 119 : public ::cppu::WeakImplHelper1< css::xml::input::XRoot > 120 { 121 friend class ImportContext; 122 123 css::uno::Reference< css::uno::XComponentContext > _xContext; 124 css::uno::Reference< css::util::XNumberFormatsSupplier > _xSupplier; 125 126 ::std::vector< ::rtl::OUString > _styleNames; 127 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _styles; 128 129 css::uno::Reference< css::container::XNameContainer > _xDialogModel; 130 css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory; 131 132 sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID; 133 134 public: 135 inline bool isEventElement( 136 sal_Int32 nUid, ::rtl::OUString const & rLocalName ) 137 { 138 return ((XMLNS_SCRIPT_UID == nUid && 139 (rLocalName.equalsAsciiL( 140 RTL_CONSTASCII_STRINGPARAM("event") ) || 141 rLocalName.equalsAsciiL( 142 RTL_CONSTASCII_STRINGPARAM("listener-event") ))) || 143 (XMLNS_DIALOGS_UID == nUid && 144 rLocalName.equalsAsciiL( 145 RTL_CONSTASCII_STRINGPARAM("event") ))); 146 } 147 148 void addStyle( 149 ::rtl::OUString const & rStyleId, 150 css::uno::Reference< css::xml::input::XElement > const & xStyle ) 151 SAL_THROW( () ); 152 css::uno::Reference< css::xml::input::XElement > getStyle( 153 ::rtl::OUString const & rStyleId ) const 154 SAL_THROW( () ); 155 156 inline css::uno::Reference< css::uno::XComponentContext > 157 const & getComponentContext() SAL_THROW( () ) { return _xContext; } 158 css::uno::Reference< css::util::XNumberFormatsSupplier > 159 const & getNumberFormatsSupplier(); 160 161 inline DialogImport( 162 css::uno::Reference<css::uno::XComponentContext> const & xContext, 163 css::uno::Reference<css::container::XNameContainer> 164 const & xDialogModel ) 165 SAL_THROW( () ) 166 : _xContext( xContext ) 167 , _xDialogModel( xDialogModel ) 168 , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ) 169 { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() && 170 _xContext.is() ); } 171 virtual ~DialogImport() 172 SAL_THROW( () ); 173 174 // XRoot 175 virtual void SAL_CALL startDocument( 176 css::uno::Reference< css::xml::input::XNamespaceMapping > 177 const & xNamespaceMapping ) 178 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 179 virtual void SAL_CALL endDocument() 180 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 181 virtual void SAL_CALL processingInstruction( 182 ::rtl::OUString const & rTarget, ::rtl::OUString const & rData ) 183 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 184 virtual void SAL_CALL setDocumentLocator( 185 css::uno::Reference< css::xml::sax::XLocator > const & xLocator ) 186 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 187 virtual css::uno::Reference< css::xml::input::XElement > 188 SAL_CALL startRootElement( 189 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 190 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 191 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 192 }; 193 194 //============================================================================== 195 class ElementBase 196 : public ::cppu::WeakImplHelper1< css::xml::input::XElement > 197 { 198 protected: 199 DialogImport * _pImport; 200 ElementBase * _pParent; 201 202 sal_Int32 _nUid; 203 ::rtl::OUString _aLocalName; 204 css::uno::Reference< css::xml::input::XAttributes > _xAttributes; 205 206 public: 207 ElementBase( 208 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 209 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 210 ElementBase * pParent, DialogImport * pImport ) 211 SAL_THROW( () ); 212 virtual ~ElementBase() 213 SAL_THROW( () ); 214 215 // XElement 216 virtual css::uno::Reference<css::xml::input::XElement> SAL_CALL getParent() 217 throw (css::uno::RuntimeException); 218 virtual ::rtl::OUString SAL_CALL getLocalName() 219 throw (css::uno::RuntimeException); 220 virtual sal_Int32 SAL_CALL getUid() 221 throw (css::uno::RuntimeException); 222 virtual css::uno::Reference< css::xml::input::XAttributes > 223 SAL_CALL getAttributes() throw (css::uno::RuntimeException); 224 virtual void SAL_CALL ignorableWhitespace( 225 ::rtl::OUString const & rWhitespaces ) 226 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 227 virtual void SAL_CALL characters( ::rtl::OUString const & rChars ) 228 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 229 virtual void SAL_CALL processingInstruction( 230 ::rtl::OUString const & Target, ::rtl::OUString const & Data ) 231 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 232 virtual void SAL_CALL endElement() 233 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 234 virtual css::uno::Reference< css::xml::input::XElement > 235 SAL_CALL startChildElement( 236 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 237 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 238 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 239 }; 240 241 //============================================================================== 242 class StylesElement 243 : public ElementBase 244 { 245 public: 246 virtual css::uno::Reference< css::xml::input::XElement > 247 SAL_CALL startChildElement( 248 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 249 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 250 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 251 252 inline StylesElement( 253 ::rtl::OUString const & rLocalName, 254 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 255 ElementBase * pParent, DialogImport * pImport ) 256 SAL_THROW( () ) 257 : ElementBase( pImport->XMLNS_DIALOGS_UID, 258 rLocalName, xAttributes, pParent, pImport ) 259 {} 260 }; 261 262 //============================================================================== 263 class StyleElement 264 : public ElementBase 265 { 266 sal_Int32 _backgroundColor; 267 sal_Int32 _textColor; 268 sal_Int32 _textLineColor; 269 sal_Int16 _border; 270 sal_Int32 _borderColor; 271 css::awt::FontDescriptor _descr; 272 sal_Int16 _fontRelief; 273 sal_Int16 _fontEmphasisMark; 274 sal_Int32 _fillColor; 275 sal_Int16 _visualEffect; 276 277 // current highest mask: 0x40 278 short _inited, _hasValue; 279 280 void setFontProperties( 281 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 282 283 public: 284 virtual css::uno::Reference< css::xml::input::XElement > 285 SAL_CALL startChildElement( 286 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 287 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 288 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 289 virtual void SAL_CALL endElement() 290 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 291 292 bool importTextColorStyle( 293 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 294 bool importTextLineColorStyle( 295 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 296 bool importFillColorStyle( 297 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 298 bool importBackgroundColorStyle( 299 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 300 bool importFontStyle( 301 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 302 bool importBorderStyle( 303 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 304 bool importVisualEffectStyle( 305 css::uno::Reference< css::beans::XPropertySet > const & xProps ); 306 307 inline StyleElement( 308 ::rtl::OUString const & rLocalName, 309 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 310 ElementBase * pParent, DialogImport * pImport ) 311 SAL_THROW( () ) 312 : ElementBase( pImport->XMLNS_DIALOGS_UID, 313 rLocalName, xAttributes, pParent, pImport ) 314 , _fontRelief( css::awt::FontRelief::NONE ) 315 , _fontEmphasisMark( css::awt::FontEmphasisMark::NONE ) 316 , _inited( 0 ) 317 , _hasValue( 0 ) 318 {} 319 }; 320 321 //============================================================================== 322 class MenuPopupElement 323 : public ElementBase 324 { 325 ::std::vector< ::rtl::OUString > _itemValues; 326 ::std::vector< sal_Int16 > _itemSelected; 327 public: 328 css::uno::Sequence< ::rtl::OUString > getItemValues(); 329 css::uno::Sequence< sal_Int16 > getSelectedItems(); 330 331 virtual css::uno::Reference< css::xml::input::XElement > 332 SAL_CALL startChildElement( 333 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 334 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 335 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 336 337 inline MenuPopupElement( 338 ::rtl::OUString const & rLocalName, 339 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 340 ElementBase * pParent, DialogImport * pImport ) 341 SAL_THROW( () ) 342 : ElementBase( pImport->XMLNS_DIALOGS_UID, 343 rLocalName, xAttributes, pParent, pImport ) 344 {} 345 }; 346 347 //============================================================================== 348 class ControlElement 349 : public ElementBase 350 { 351 friend class EventElement; 352 353 protected: 354 sal_Int32 _nBasePosX, _nBasePosY; 355 356 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _events; 357 358 ::rtl::OUString getControlId( 359 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 360 css::uno::Reference< css::xml::input::XElement > getStyle( 361 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 362 public: 363 ::std::vector<css::uno::Reference< css::xml::input::XElement> > *getEvents() 364 SAL_THROW( () ) { return &_events; } 365 366 ControlElement( 367 ::rtl::OUString const & rLocalName, 368 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 369 ElementBase * pParent, DialogImport * pImport ) 370 SAL_THROW( () ); 371 }; 372 373 //============================================================================== 374 class ImportContext 375 { 376 protected: 377 DialogImport * _pImport; 378 css::uno::Reference< css::beans::XPropertySet > _xControlModel; 379 ::rtl::OUString _aId; 380 381 public: 382 inline ImportContext( 383 DialogImport * pImport, 384 css::uno::Reference< css::beans::XPropertySet > const & xControlModel_, 385 ::rtl::OUString const & id ) 386 : _pImport( pImport ), 387 _xControlModel( xControlModel_ ), 388 _aId( id ) 389 { OSL_ASSERT( _xControlModel.is() ); } 390 391 inline css::uno::Reference< css::beans::XPropertySet > getControlModel() 392 { return _xControlModel; } 393 394 void importDefaults( 395 sal_Int32 nBaseX, sal_Int32 nBaseY, 396 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 397 bool supportPrintable = true ); 398 void importEvents( 399 ::std::vector< css::uno::Reference< css::xml::input::XElement > > 400 const & rEvents ); 401 402 bool importStringProperty( 403 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 404 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 405 bool importDoubleProperty( 406 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 407 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 408 bool importBooleanProperty( 409 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 410 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 411 bool importShortProperty( 412 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 413 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 414 bool importLongProperty( 415 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 416 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 417 bool importLongProperty( 418 sal_Int32 nOffset, 419 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 420 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 421 bool importHexLongProperty( 422 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 423 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 424 bool importAlignProperty( 425 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 426 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 427 bool importVerticalAlignProperty( 428 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 429 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 430 bool importImageAlignProperty( 431 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 432 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 433 bool importImagePositionProperty( 434 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 435 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 436 bool importDateFormatProperty( 437 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 438 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 439 bool importTimeFormatProperty( 440 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 441 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 442 bool importOrientationProperty( 443 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 444 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 445 bool importButtonTypeProperty( 446 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 447 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 448 bool importLineEndFormatProperty( 449 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 450 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 451 bool importSelectionTypeProperty( 452 ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, 453 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ); 454 }; 455 456 //============================================================================== 457 class ControlImportContext : public ImportContext 458 { 459 public: 460 inline ControlImportContext( 461 DialogImport * pImport, 462 ::rtl::OUString const & rId, ::rtl::OUString const & rControlName ) 463 : ImportContext( 464 pImport, 465 css::uno::Reference< css::beans::XPropertySet >( 466 pImport->_xDialogModelFactory->createInstance( rControlName ), 467 css::uno::UNO_QUERY_THROW ), rId ) 468 {} 469 inline ~ControlImportContext() 470 { 471 _pImport->_xDialogModel->insertByName( 472 _aId, css::uno::makeAny( 473 css::uno::Reference<css::awt::XControlModel>::query( 474 _xControlModel ) ) ); 475 } 476 }; 477 478 //============================================================================== 479 class WindowElement 480 : public ControlElement 481 { 482 public: 483 virtual css::uno::Reference< css::xml::input::XElement > 484 SAL_CALL startChildElement( 485 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 486 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 487 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 488 virtual void SAL_CALL endElement() 489 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 490 491 inline WindowElement( 492 ::rtl::OUString const & rLocalName, 493 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 494 ElementBase * pParent, DialogImport * pImport ) 495 SAL_THROW( () ) 496 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 497 {} 498 }; 499 500 //============================================================================== 501 class EventElement 502 : public ElementBase 503 { 504 public: 505 virtual void SAL_CALL endElement() 506 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 507 508 inline EventElement( 509 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 510 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 511 ElementBase * pParent, DialogImport * pImport ) 512 SAL_THROW( () ) 513 : ElementBase( nUid, rLocalName, xAttributes, pParent, pImport ) 514 {} 515 }; 516 517 //============================================================================== 518 class BulletinBoardElement 519 : public ControlElement 520 { 521 public: 522 virtual css::uno::Reference< css::xml::input::XElement > 523 SAL_CALL startChildElement( 524 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 525 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 526 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 527 528 BulletinBoardElement( 529 ::rtl::OUString const & rLocalName, 530 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 531 ElementBase * pParent, DialogImport * pImport ) 532 SAL_THROW( () ); 533 }; 534 535 //============================================================================== 536 class ButtonElement 537 : public ControlElement 538 { 539 public: 540 virtual css::uno::Reference< css::xml::input::XElement > 541 SAL_CALL startChildElement( 542 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 543 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 544 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 545 virtual void SAL_CALL endElement() 546 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 547 548 inline ButtonElement( 549 ::rtl::OUString const & rLocalName, 550 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 551 ElementBase * pParent, DialogImport * pImport ) 552 SAL_THROW( () ) 553 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 554 {} 555 }; 556 557 //============================================================================== 558 class CheckBoxElement 559 : public ControlElement 560 { 561 public: 562 virtual css::uno::Reference< css::xml::input::XElement > 563 SAL_CALL startChildElement( 564 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 565 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 566 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 567 virtual void SAL_CALL endElement() 568 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 569 570 inline CheckBoxElement( 571 ::rtl::OUString const & rLocalName, 572 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 573 ElementBase * pParent, DialogImport * pImport ) 574 SAL_THROW( () ) 575 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 576 {} 577 }; 578 579 //============================================================================== 580 class ComboBoxElement 581 : public ControlElement 582 { 583 css::uno::Reference< css::xml::input::XElement > _popup; 584 public: 585 virtual css::uno::Reference< css::xml::input::XElement > 586 SAL_CALL startChildElement( 587 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 588 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 589 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 590 virtual void SAL_CALL endElement() 591 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 592 593 inline ComboBoxElement( 594 ::rtl::OUString const & rLocalName, 595 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 596 ElementBase * pParent, DialogImport * pImport ) 597 SAL_THROW( () ) 598 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 599 {} 600 }; 601 602 //============================================================================== 603 class MenuListElement 604 : public ControlElement 605 { 606 css::uno::Reference< css::xml::input::XElement > _popup; 607 public: 608 virtual css::uno::Reference< css::xml::input::XElement > 609 SAL_CALL startChildElement( 610 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 611 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 612 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 613 virtual void SAL_CALL endElement() 614 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 615 616 inline MenuListElement( 617 ::rtl::OUString const & rLocalName, 618 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 619 ElementBase * pParent, DialogImport * pImport ) 620 SAL_THROW( () ) 621 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 622 {} 623 }; 624 625 //============================================================================== 626 class RadioElement 627 : public ControlElement 628 { 629 public: 630 virtual css::uno::Reference< css::xml::input::XElement > 631 SAL_CALL startChildElement( 632 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 633 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 634 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 635 636 inline RadioElement( 637 ::rtl::OUString const & rLocalName, 638 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 639 ElementBase * pParent, DialogImport * pImport ) 640 SAL_THROW( () ) 641 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 642 {} 643 }; 644 645 //============================================================================== 646 class RadioGroupElement 647 : public ControlElement 648 { 649 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _radios; 650 public: 651 virtual css::uno::Reference< css::xml::input::XElement > 652 SAL_CALL startChildElement( 653 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 654 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 655 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 656 void SAL_CALL endElement() 657 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 658 659 inline RadioGroupElement( 660 ::rtl::OUString const & rLocalName, 661 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 662 ElementBase * pParent, DialogImport * pImport ) 663 SAL_THROW( () ) 664 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 665 {} 666 }; 667 668 //============================================================================== 669 class TitledBoxElement 670 : public BulletinBoardElement 671 { 672 ::rtl::OUString _label; 673 ::std::vector< css::uno::Reference< css::xml::input::XElement > > _radios; 674 public: 675 virtual css::uno::Reference< css::xml::input::XElement > 676 SAL_CALL startChildElement( 677 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 678 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 679 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 680 virtual void SAL_CALL endElement() 681 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 682 683 inline TitledBoxElement( 684 ::rtl::OUString const & rLocalName, 685 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 686 ElementBase * pParent, DialogImport * pImport ) 687 SAL_THROW( () ) 688 : BulletinBoardElement( rLocalName, xAttributes, pParent, pImport ) 689 {} 690 }; 691 692 //============================================================================== 693 class TextElement 694 : public ControlElement 695 { 696 public: 697 virtual css::uno::Reference< css::xml::input::XElement > 698 SAL_CALL startChildElement( 699 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 700 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 701 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 702 virtual void SAL_CALL endElement() 703 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 704 705 inline TextElement( 706 ::rtl::OUString const & rLocalName, 707 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 708 ElementBase * pParent, DialogImport * pImport ) 709 SAL_THROW( () ) 710 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 711 {} 712 }; 713 //============================================================================== 714 class FixedHyperLinkElement 715 : public ControlElement 716 { 717 public: 718 virtual css::uno::Reference< css::xml::input::XElement > 719 SAL_CALL startChildElement( 720 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 721 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 722 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 723 virtual void SAL_CALL endElement() 724 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 725 726 inline FixedHyperLinkElement( 727 ::rtl::OUString const & rLocalName, 728 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 729 ElementBase * pParent, DialogImport * pImport ) 730 SAL_THROW( () ) 731 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 732 {} 733 }; 734 //============================================================================== 735 class TextFieldElement 736 : public ControlElement 737 { 738 public: 739 virtual css::uno::Reference< css::xml::input::XElement > 740 SAL_CALL startChildElement( 741 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 742 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 743 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 744 virtual void SAL_CALL endElement() 745 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 746 747 inline TextFieldElement( 748 ::rtl::OUString const & rLocalName, 749 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 750 ElementBase * pParent, DialogImport * pImport ) 751 SAL_THROW( () ) 752 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 753 {} 754 }; 755 756 //============================================================================== 757 class ImageControlElement 758 : public ControlElement 759 { 760 public: 761 virtual css::uno::Reference< css::xml::input::XElement > 762 SAL_CALL startChildElement( 763 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 764 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 765 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 766 virtual void SAL_CALL endElement() 767 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 768 769 inline ImageControlElement( 770 ::rtl::OUString const & rLocalName, 771 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 772 ElementBase * pParent, DialogImport * pImport ) 773 SAL_THROW( () ) 774 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 775 {} 776 }; 777 778 //============================================================================== 779 class FileControlElement 780 : public ControlElement 781 { 782 public: 783 virtual css::uno::Reference< css::xml::input::XElement > 784 SAL_CALL startChildElement( 785 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 786 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 787 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 788 virtual void SAL_CALL endElement() 789 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 790 791 inline FileControlElement( 792 ::rtl::OUString const & rLocalName, 793 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 794 ElementBase * pParent, DialogImport * pImport ) 795 SAL_THROW( () ) 796 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 797 {} 798 }; 799 800 //============================================================================== 801 class TreeControlElement 802 : public ControlElement 803 { 804 public: 805 virtual css::uno::Reference< css::xml::input::XElement > 806 SAL_CALL startChildElement( 807 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 808 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 809 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 810 virtual void SAL_CALL endElement() 811 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 812 813 inline TreeControlElement( 814 ::rtl::OUString const & rLocalName, 815 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 816 ElementBase * pParent, DialogImport * pImport ) 817 SAL_THROW( () ) 818 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 819 {} 820 }; 821 822 //============================================================================== 823 class CurrencyFieldElement 824 : public ControlElement 825 { 826 public: 827 virtual css::uno::Reference< css::xml::input::XElement > 828 SAL_CALL startChildElement( 829 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 830 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 831 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 832 virtual void SAL_CALL endElement() 833 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 834 835 inline CurrencyFieldElement( 836 ::rtl::OUString const & rLocalName, 837 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 838 ElementBase * pParent, DialogImport * pImport ) 839 SAL_THROW( () ) 840 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 841 {} 842 }; 843 844 //============================================================================== 845 class DateFieldElement 846 : public ControlElement 847 { 848 public: 849 virtual css::uno::Reference< css::xml::input::XElement > 850 SAL_CALL startChildElement( 851 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 852 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 853 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 854 virtual void SAL_CALL endElement() 855 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 856 857 inline DateFieldElement( 858 ::rtl::OUString const & rLocalName, 859 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 860 ElementBase * pParent, DialogImport * pImport ) 861 SAL_THROW( () ) 862 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 863 {} 864 }; 865 866 //============================================================================== 867 class NumericFieldElement 868 : public ControlElement 869 { 870 public: 871 virtual css::uno::Reference< css::xml::input::XElement > 872 SAL_CALL startChildElement( 873 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 874 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 875 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 876 virtual void SAL_CALL endElement() 877 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 878 879 inline NumericFieldElement( 880 ::rtl::OUString const & rLocalName, 881 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 882 ElementBase * pParent, DialogImport * pImport ) 883 SAL_THROW( () ) 884 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 885 {} 886 }; 887 888 //============================================================================== 889 class TimeFieldElement 890 : public ControlElement 891 { 892 public: 893 virtual css::uno::Reference< css::xml::input::XElement > 894 SAL_CALL startChildElement( 895 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 896 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 897 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 898 virtual void SAL_CALL endElement() 899 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 900 901 inline TimeFieldElement( 902 ::rtl::OUString const & rLocalName, 903 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 904 ElementBase * pParent, DialogImport * pImport ) 905 SAL_THROW( () ) 906 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 907 {} 908 }; 909 910 //============================================================================== 911 class PatternFieldElement 912 : public ControlElement 913 { 914 public: 915 virtual css::uno::Reference< css::xml::input::XElement > 916 SAL_CALL startChildElement( 917 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 918 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 919 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 920 virtual void SAL_CALL endElement() 921 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 922 923 inline PatternFieldElement( 924 ::rtl::OUString const & rLocalName, 925 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 926 ElementBase * pParent, DialogImport * pImport ) 927 SAL_THROW( () ) 928 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 929 {} 930 }; 931 932 //============================================================================== 933 class FormattedFieldElement 934 : public ControlElement 935 { 936 public: 937 virtual css::uno::Reference< css::xml::input::XElement > 938 SAL_CALL startChildElement( 939 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 940 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 941 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 942 virtual void SAL_CALL endElement() 943 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 944 945 inline FormattedFieldElement( 946 ::rtl::OUString const & rLocalName, 947 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 948 ElementBase * pParent, DialogImport * pImport ) 949 SAL_THROW( () ) 950 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 951 {} 952 }; 953 954 //============================================================================== 955 class FixedLineElement 956 : public ControlElement 957 { 958 public: 959 virtual css::uno::Reference< css::xml::input::XElement > 960 SAL_CALL startChildElement( 961 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 962 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 963 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 964 virtual void SAL_CALL endElement() 965 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 966 967 inline FixedLineElement( 968 ::rtl::OUString const & rLocalName, 969 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 970 ElementBase * pParent, DialogImport * pImport ) 971 SAL_THROW( () ) 972 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 973 {} 974 }; 975 976 //============================================================================== 977 class ScrollBarElement 978 : public ControlElement 979 { 980 public: 981 virtual css::uno::Reference< css::xml::input::XElement > 982 SAL_CALL startChildElement( 983 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 984 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 985 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 986 virtual void SAL_CALL endElement() 987 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 988 989 inline ScrollBarElement( 990 ::rtl::OUString const & rLocalName, 991 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 992 ElementBase * pParent, DialogImport * pImport ) 993 SAL_THROW( () ) 994 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 995 {} 996 }; 997 998 //============================================================================== 999 class ProgressBarElement 1000 : public ControlElement 1001 { 1002 public: 1003 virtual css::uno::Reference< css::xml::input::XElement > 1004 SAL_CALL startChildElement( 1005 sal_Int32 nUid, ::rtl::OUString const & rLocalName, 1006 css::uno::Reference<css::xml::input::XAttributes> const & xAttributes ) 1007 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 1008 virtual void SAL_CALL endElement() 1009 throw (css::xml::sax::SAXException, css::uno::RuntimeException); 1010 1011 inline ProgressBarElement( 1012 ::rtl::OUString const & rLocalName, 1013 css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, 1014 ElementBase * pParent, DialogImport * pImport ) 1015 SAL_THROW( () ) 1016 : ControlElement( rLocalName, xAttributes, pParent, pImport ) 1017 {} 1018 }; 1019 1020 } 1021