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 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_xmlscript.hxx" 30 #include "exp_share.hxx" 31 32 #include <com/sun/star/util/XNumberFormatsSupplier.hpp> 33 34 35 using namespace ::com::sun::star; 36 using namespace ::com::sun::star::uno; 37 using ::rtl::OUString; 38 39 namespace xmlscript 40 { 41 42 static inline bool readBorderProps( 43 ElementDescriptor * element, Style & style ) 44 { 45 if (element->readProp( &style._border, OUSTR("Border") )) { 46 if (style._border == BORDER_SIMPLE /* simple */) 47 { 48 if (element->readProp( &style._borderColor, OUSTR("BorderColor") )) 49 style._border = BORDER_SIMPLE_COLOR; 50 } 51 return true; 52 } 53 return false; 54 } 55 56 static inline bool readFontProps( ElementDescriptor * element, Style & style ) 57 { 58 bool ret = element->readProp( 59 &style._descr, OUSTR("FontDescriptor") ); 60 ret |= element->readProp( 61 &style._fontEmphasisMark, OUSTR("FontEmphasisMark") ); 62 ret |= element->readProp( 63 &style._fontRelief, OUSTR("FontRelief") ); 64 return ret; 65 } 66 67 //__________________________________________________________________________________________________ 68 void ElementDescriptor::readButtonModel( StyleBag * all_styles ) 69 SAL_THROW( (Exception) ) 70 { 71 // collect styles 72 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 ); 73 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 74 aStyle._set |= 0x1; 75 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 76 aStyle._set |= 0x2; 77 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 78 aStyle._set |= 0x20; 79 if (readFontProps( this, aStyle )) 80 aStyle._set |= 0x8; 81 if (aStyle._set) 82 { 83 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 84 all_styles->getStyleId( aStyle ) ); 85 } 86 87 // collect elements 88 readDefaults(); 89 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 90 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 91 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultButton") ), 92 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":default") ) ); 93 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), 94 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 95 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 96 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 97 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), 98 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); 99 readButtonTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("PushButtonType") ), 100 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":button-type") ) ); 101 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), 102 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); 103 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), 104 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); 105 readImageAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageAlign") ), 106 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-align") ) ); 107 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) )) 108 readLongAttr( OUSTR("RepeatDelay"), 109 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ ); 110 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Toggle") ) )) 111 addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":toggled"), OUSTR("1") ); 112 readBoolAttr( OUSTR("FocusOnClick"), 113 OUSTR(XMLNS_DIALOGS_PREFIX ":grab-focus") ); 114 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), 115 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); 116 117 118 // State 119 sal_Int16 nState = 0; 120 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState) 121 { 122 switch (nState) 123 { 124 case 0: 125 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ), 126 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) ); 127 break; 128 case 1: 129 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ), 130 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); 131 break; 132 default: 133 OSL_ENSURE( 0, "### unexpected radio state!" ); 134 break; 135 } 136 } 137 138 readEvents(); 139 } 140 //__________________________________________________________________________________________________ 141 void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles ) 142 SAL_THROW( (Exception) ) 143 { 144 // collect styles 145 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 ); 146 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 147 aStyle._set |= 0x1; 148 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 149 aStyle._set |= 0x2; 150 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 151 aStyle._set |= 0x20; 152 if (readFontProps( this, aStyle )) 153 aStyle._set |= 0x8; 154 if (readProp( OUSTR("VisualEffect") ) >>= aStyle._visualEffect) 155 aStyle._set |= 0x40; 156 if (aStyle._set) 157 { 158 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 159 all_styles->getStyleId( aStyle ) ); 160 } 161 162 // collect elements 163 readDefaults(); 164 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 165 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 166 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), 167 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 168 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 169 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 170 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), 171 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); 172 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), 173 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); 174 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), 175 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); 176 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), 177 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); 178 179 sal_Bool bTriState = sal_False; 180 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TriState") ) ) >>= bTriState) && bTriState) 181 { 182 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tristate") ), 183 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); 184 } 185 sal_Int16 nState = 0; 186 if (_xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState) 187 { 188 switch (nState) 189 { 190 case 0: 191 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ), 192 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) ); 193 break; 194 case 1: 195 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ), 196 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); 197 break; 198 case 2: // tristate=true exported, checked omitted => dont know! 199 OSL_ENSURE( bTriState, "### detected tristate value, but TriState is not set!" ); 200 break; 201 default: 202 OSL_ENSURE( 0, "### unexpected checkbox state!" ); 203 break; 204 } 205 } 206 readEvents(); 207 } 208 //__________________________________________________________________________________________________ 209 void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) 210 SAL_THROW( (Exception) ) 211 { 212 // collect styles 213 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 214 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 215 aStyle._set |= 0x1; 216 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 217 aStyle._set |= 0x2; 218 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 219 aStyle._set |= 0x20; 220 if (readBorderProps( this, aStyle )) 221 aStyle._set |= 0x4; 222 if (readFontProps( this, aStyle )) 223 aStyle._set |= 0x8; 224 if (aStyle._set) 225 { 226 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 227 all_styles->getStyleId( aStyle ) ); 228 } 229 230 // collect elements 231 readDefaults(); 232 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 233 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 234 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 235 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 236 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 237 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 238 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Autocomplete") ), 239 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":autocomplete") ) ); 240 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 241 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 242 readBoolAttr( OUSTR("HideInactiveSelection"), 243 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 244 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ), 245 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 246 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ), 247 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) ); 248 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ), 249 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) ); 250 251 // string item list 252 Sequence< OUString > itemValues; 253 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) && 254 itemValues.getLength() > 0) 255 { 256 ElementDescriptor * popup = new ElementDescriptor( 257 _xProps, _xPropState, 258 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ) ); 259 260 OUString const * pItemValues = itemValues.getConstArray(); 261 for ( sal_Int32 nPos = 0; nPos < itemValues.getLength(); ++nPos ) 262 { 263 ElementDescriptor * item = new ElementDescriptor( 264 _xProps, _xPropState, 265 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ) ); 266 item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), 267 pItemValues[ nPos ] ); 268 popup->addSubElement( item ); 269 } 270 271 addSubElement( popup ); 272 } 273 readEvents(); 274 } 275 //__________________________________________________________________________________________________ 276 void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) 277 SAL_THROW( (Exception) ) 278 { 279 // collect styles 280 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 281 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 282 aStyle._set |= 0x1; 283 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 284 aStyle._set |= 0x2; 285 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 286 aStyle._set |= 0x20; 287 if (readBorderProps( this, aStyle )) 288 aStyle._set |= 0x4; 289 if (readFontProps( this, aStyle )) 290 aStyle._set |= 0x8; 291 if (aStyle._set) 292 { 293 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 294 all_styles->getStyleId( aStyle ) ); 295 } 296 297 // collect elements 298 readDefaults(); 299 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 300 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 301 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiSelection") ), 302 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiselection") ) ); 303 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 304 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 305 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ), 306 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 307 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ), 308 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) ); 309 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 310 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 311 312 // string item list 313 Sequence< OUString > itemValues; 314 if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) && 315 itemValues.getLength() > 0) 316 { 317 ElementDescriptor * popup = new ElementDescriptor( 318 _xProps, _xPropState, 319 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ) ); 320 321 OUString const * pItemValues = itemValues.getConstArray(); 322 sal_Int32 nPos; 323 for ( nPos = 0; nPos < itemValues.getLength(); ++nPos ) 324 { 325 ElementDescriptor * item = new ElementDescriptor( 326 _xProps, _xPropState, 327 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ) ); 328 item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), 329 pItemValues[ nPos ] ); 330 popup->addSubElement( item ); 331 } 332 333 Sequence< sal_Int16 > selected; 334 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ) ) >>= selected) 335 { 336 sal_Int16 const * pSelected = selected.getConstArray(); 337 for ( nPos = selected.getLength(); nPos--; ) 338 { 339 ElementDescriptor * item = static_cast< ElementDescriptor * >( 340 popup->getSubElement( pSelected[ nPos ] ).get() ); 341 item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selected") ), 342 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); 343 } 344 } 345 346 addSubElement( popup ); 347 } 348 readEvents(); 349 } 350 //__________________________________________________________________________________________________ 351 void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles ) 352 SAL_THROW( (Exception) ) 353 { 354 // collect styles 355 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 | 0x40 ); 356 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 357 aStyle._set |= 0x1; 358 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 359 aStyle._set |= 0x2; 360 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 361 aStyle._set |= 0x20; 362 if (readFontProps( this, aStyle )) 363 aStyle._set |= 0x8; 364 if (readProp( OUSTR("VisualEffect") ) >>= aStyle._visualEffect) 365 aStyle._set |= 0x40; 366 if (aStyle._set) 367 { 368 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 369 all_styles->getStyleId( aStyle ) ); 370 } 371 372 // collect elements 373 readDefaults(); 374 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 375 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 376 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), 377 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 378 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 379 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 380 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), 381 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); 382 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), 383 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); 384 readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), 385 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); 386 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), 387 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); 388 389 sal_Int16 nState = 0; 390 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState) 391 { 392 switch (nState) 393 { 394 case 0: 395 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ), 396 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) ); 397 break; 398 case 1: 399 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checked") ), 400 OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); 401 break; 402 default: 403 OSL_ENSURE( 0, "### unexpected radio state!" ); 404 break; 405 } 406 } 407 readEvents(); 408 } 409 //__________________________________________________________________________________________________ 410 void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles ) 411 SAL_THROW( (Exception) ) 412 { 413 // collect styles 414 Style aStyle( 0x2 | 0x8 | 0x20 ); 415 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 416 aStyle._set |= 0x2; 417 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 418 aStyle._set |= 0x20; 419 if (readFontProps( this, aStyle )) 420 aStyle._set |= 0x8; 421 if (aStyle._set) 422 { 423 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 424 all_styles->getStyleId( aStyle ) ); 425 } 426 427 // collect elements 428 readDefaults(); 429 430 OUString aTitle; 431 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle) 432 { 433 ElementDescriptor * title = new ElementDescriptor( 434 _xProps, _xPropState, 435 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) ); 436 title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), 437 aTitle ); 438 addSubElement( title ); 439 } 440 441 readEvents(); 442 } 443 //__________________________________________________________________________________________________ 444 void ElementDescriptor::readFixedTextModel( StyleBag * all_styles ) 445 SAL_THROW( (Exception) ) 446 { 447 // collect styles 448 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 449 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 450 aStyle._set |= 0x1; 451 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 452 aStyle._set |= 0x2; 453 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 454 aStyle._set |= 0x20; 455 if (readBorderProps( this, aStyle )) 456 aStyle._set |= 0x4; 457 if (readFontProps( this, aStyle )) 458 aStyle._set |= 0x8; 459 if (aStyle._set) 460 { 461 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 462 all_styles->getStyleId( aStyle ) ); 463 } 464 465 // collect elements 466 readDefaults(); 467 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), 468 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 469 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 470 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 471 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), 472 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); 473 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), 474 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); 475 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 476 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 477 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("NoLabel") ), 478 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":nolabel") ) ); 479 readEvents(); 480 } 481 //__________________________________________________________________________________________________ 482 void ElementDescriptor::readFixedHyperLinkModel( StyleBag * all_styles ) 483 SAL_THROW( (Exception) ) 484 { 485 // collect styles 486 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 487 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 488 aStyle._set |= 0x1; 489 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 490 aStyle._set |= 0x2; 491 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 492 aStyle._set |= 0x20; 493 if (readBorderProps( this, aStyle )) 494 aStyle._set |= 0x4; 495 if (readFontProps( this, aStyle )) 496 aStyle._set |= 0x8; 497 if (aStyle._set) 498 { 499 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 500 all_styles->getStyleId( aStyle ) ); 501 } 502 503 // collect elements 504 readDefaults(); 505 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), 506 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 507 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("URL") ), 508 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":url") ) ); 509 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Description") ), 510 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":description") ) ); 511 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 512 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 513 readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), 514 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); 515 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), 516 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); 517 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 518 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 519 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("NoLabel") ), 520 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":nolabel") ) ); 521 readEvents(); 522 } 523 //__________________________________________________________________________________________________ 524 void ElementDescriptor::readEditModel( StyleBag * all_styles ) 525 SAL_THROW( (Exception) ) 526 { 527 // collect styles 528 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 529 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 530 aStyle._set |= 0x1; 531 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 532 aStyle._set |= 0x2; 533 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 534 aStyle._set |= 0x20; 535 if (readBorderProps( this, aStyle )) 536 aStyle._set |= 0x4; 537 if (readFontProps( this, aStyle )) 538 aStyle._set |= 0x8; 539 if (aStyle._set) 540 { 541 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 542 all_styles->getStyleId( aStyle ) ); 543 } 544 545 // collect elements 546 readDefaults(); 547 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 548 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 549 readBoolAttr( OUSTR("HideInactiveSelection"), 550 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 551 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 552 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 553 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HardLineBreaks") ), 554 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":hard-linebreaks") ) ); 555 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("HScroll") ), 556 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":hscroll") ) ); 557 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VScroll") ), 558 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":vscroll") ) ); 559 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ), 560 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) ); 561 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), 562 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); 563 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 564 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 565 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 566 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 567 readLineEndFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineEndFormat") ), 568 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":lineend-format") ) ); 569 sal_Int16 nEcho = 0; 570 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EchoChar") ) ) >>= nEcho) 571 { 572 sal_Unicode cEcho = (sal_Unicode)nEcho; 573 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":echochar") ), 574 OUString( &cEcho, 1 ) ); 575 } 576 readEvents(); 577 } 578 //__________________________________________________________________________________________________ 579 void ElementDescriptor::readImageControlModel( StyleBag * all_styles ) 580 SAL_THROW( (Exception) ) 581 { 582 // collect styles 583 Style aStyle( 0x1 | 0x4 ); 584 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 585 aStyle._set |= 0x1; 586 if (readBorderProps( this, aStyle )) 587 aStyle._set |= 0x4; 588 if (aStyle._set) 589 { 590 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 591 all_styles->getStyleId( aStyle ) ); 592 } 593 594 // collect elements 595 readDefaults(); 596 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleImage") ), 597 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scale-image") ) ); 598 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), 599 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":src") ) ); 600 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 601 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 602 readEvents(); 603 } 604 //__________________________________________________________________________________________________ 605 void ElementDescriptor::readFileControlModel( StyleBag * all_styles ) 606 SAL_THROW( (Exception) ) 607 { 608 // collect styles 609 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 610 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 611 aStyle._set |= 0x1; 612 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 613 aStyle._set |= 0x2; 614 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 615 aStyle._set |= 0x20; 616 if (readBorderProps( this, aStyle )) 617 aStyle._set |= 0x4; 618 if (readFontProps( this, aStyle )) 619 aStyle._set |= 0x8; 620 if (aStyle._set) 621 { 622 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 623 all_styles->getStyleId( aStyle ) ); 624 } 625 626 // collect elements 627 readDefaults(); 628 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 629 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 630 readBoolAttr( OUSTR("HideInactiveSelection"), 631 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 632 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 633 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 634 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 635 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 636 readEvents(); 637 } 638 //__________________________________________________________________________________________________ 639 void ElementDescriptor::readTreeControlModel( StyleBag * all_styles ) 640 SAL_THROW( (Exception) ) 641 { 642 // collect styles 643 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 644 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 645 aStyle._set |= 0x1; 646 if (readBorderProps( this, aStyle )) 647 aStyle._set |= 0x4; 648 if (aStyle._set) 649 { 650 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 651 all_styles->getStyleId( aStyle ) ); 652 } 653 654 // collect elements 655 readDefaults(); 656 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 657 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 658 readSelectionTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectionType") ), 659 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":selectiontype") ) ); 660 661 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("RootDisplayed") ), 662 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":rootdisplayed") ) ); 663 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowsHandles") ), 664 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":showshandles") ) ); 665 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowsRootHandles") ), 666 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":showsroothandles") ) ); 667 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Editable") ), 668 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":editable") ) ); 669 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("InvokesStopNodeEditing") ), 670 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":invokesstopnodeediting") ) ); 671 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("RowHeight") ), 672 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":rowheight") ) ); 673 readEvents(); 674 } 675 //__________________________________________________________________________________________________ 676 void ElementDescriptor::readCurrencyFieldModel( StyleBag * all_styles ) 677 SAL_THROW( (Exception) ) 678 { 679 // collect styles 680 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 681 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 682 aStyle._set |= 0x1; 683 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 684 aStyle._set |= 0x2; 685 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 686 aStyle._set |= 0x20; 687 if (readBorderProps( this, aStyle )) 688 aStyle._set |= 0x4; 689 if (readFontProps( this, aStyle )) 690 aStyle._set |= 0x8; 691 if (aStyle._set) 692 { 693 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 694 all_styles->getStyleId( aStyle ) ); 695 } 696 697 // collect elements 698 readDefaults(); 699 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 700 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 701 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 702 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 703 readBoolAttr( OUSTR("HideInactiveSelection"), 704 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 705 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ), 706 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) ); 707 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("CurrencySymbol") ), 708 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":currency-symbol") ) ); 709 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy") ), 710 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":decimal-accuracy") ) ); 711 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowThousandsSeparator") ), 712 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":thousands-separator") ) ); 713 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Value") ), 714 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 715 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMin") ), 716 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 717 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMax") ), 718 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); 719 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueStep") ), 720 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-step") ) ); 721 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ), 722 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 723 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) )) 724 readLongAttr( OUSTR("RepeatDelay"), 725 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ ); 726 readBoolAttr( 727 OUString( RTL_CONSTASCII_USTRINGPARAM("PrependCurrencySymbol") ), 728 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":prepend-symbol") ) ); 729 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ), 730 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) ); 731 readEvents(); 732 } 733 //__________________________________________________________________________________________________ 734 void ElementDescriptor::readDateFieldModel( StyleBag * all_styles ) 735 SAL_THROW( (Exception) ) 736 { 737 // collect styles 738 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 739 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 740 aStyle._set |= 0x1; 741 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 742 aStyle._set |= 0x2; 743 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 744 aStyle._set |= 0x20; 745 if (readBorderProps( this, aStyle )) 746 aStyle._set |= 0x4; 747 if (readFontProps( this, aStyle )) 748 aStyle._set |= 0x8; 749 if (aStyle._set) 750 { 751 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 752 all_styles->getStyleId( aStyle ) ); 753 } 754 755 // collect elements 756 readDefaults(); 757 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 758 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 759 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 760 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 761 readBoolAttr( OUSTR("HideInactiveSelection"), 762 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 763 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ), 764 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) ); 765 readDateFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateFormat") ), 766 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":date-format") ) ); 767 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateShowCentury") ), 768 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":show-century") ) ); 769 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Date") ), 770 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 771 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateMin") ), 772 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 773 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DateMax") ), 774 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); 775 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ), 776 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 777 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) )) 778 readLongAttr( OUSTR("RepeatDelay"), 779 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ ); 780 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Dropdown") ), 781 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":dropdown") ) ); 782 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 783 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) ); 784 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ), 785 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) ); 786 readEvents(); 787 } 788 //__________________________________________________________________________________________________ 789 void ElementDescriptor::readNumericFieldModel( StyleBag * all_styles ) 790 SAL_THROW( (Exception) ) 791 { 792 // collect styles 793 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 794 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 795 aStyle._set |= 0x1; 796 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 797 aStyle._set |= 0x2; 798 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 799 aStyle._set |= 0x20; 800 if (readBorderProps( this, aStyle )) 801 aStyle._set |= 0x4; 802 if (readFontProps( this, aStyle )) 803 aStyle._set |= 0x8; 804 if (aStyle._set) 805 { 806 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 807 all_styles->getStyleId( aStyle ) ); 808 } 809 810 // collect elements 811 readDefaults(); 812 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 813 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 814 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 815 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 816 readBoolAttr( OUSTR("HideInactiveSelection"), 817 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 818 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ), 819 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) ); 820 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("DecimalAccuracy") ), 821 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":decimal-accuracy") ) ); 822 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ShowThousandsSeparator") ), 823 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":thousands-separator") ) ); 824 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Value") ), 825 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 826 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMin") ), 827 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 828 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueMax") ), 829 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); 830 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ValueStep") ), 831 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-step") ) ); 832 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ), 833 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 834 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) )) 835 readLongAttr( OUSTR("RepeatDelay"), 836 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ ); 837 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ), 838 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) ); 839 readEvents(); 840 } 841 //__________________________________________________________________________________________________ 842 void ElementDescriptor::readTimeFieldModel( StyleBag * all_styles ) 843 SAL_THROW( (Exception) ) 844 { 845 // collect styles 846 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 847 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 848 aStyle._set |= 0x1; 849 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 850 aStyle._set |= 0x2; 851 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 852 aStyle._set |= 0x20; 853 if (readBorderProps( this, aStyle )) 854 aStyle._set |= 0x4; 855 if (readFontProps( this, aStyle )) 856 aStyle._set |= 0x8; 857 if (aStyle._set) 858 { 859 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 860 all_styles->getStyleId( aStyle ) ); 861 } 862 863 // collect elements 864 readDefaults(); 865 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 866 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 867 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 868 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 869 readBoolAttr( OUSTR("HideInactiveSelection"), 870 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 871 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ), 872 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) ); 873 readTimeFormatAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeFormat") ), 874 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":time-format") ) ); 875 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Time") ), 876 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 877 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeMin") ), 878 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 879 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TimeMax") ), 880 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); 881 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ), 882 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 883 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) )) 884 readLongAttr( OUSTR("RepeatDelay"), 885 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ ); 886 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 887 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) ); 888 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ), 889 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) ); 890 readEvents(); 891 } 892 //__________________________________________________________________________________________________ 893 void ElementDescriptor::readPatternFieldModel( StyleBag * all_styles ) 894 SAL_THROW( (Exception) ) 895 { 896 // collect styles 897 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 898 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 899 aStyle._set |= 0x1; 900 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 901 aStyle._set |= 0x2; 902 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 903 aStyle._set |= 0x20; 904 if (readBorderProps( this, aStyle )) 905 aStyle._set |= 0x4; 906 if (readFontProps( this, aStyle )) 907 aStyle._set |= 0x8; 908 if (aStyle._set) 909 { 910 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 911 all_styles->getStyleId( aStyle ) ); 912 } 913 914 // collect elements 915 readDefaults(); 916 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 917 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 918 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 919 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 920 readBoolAttr( OUSTR("HideInactiveSelection"), 921 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 922 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ), 923 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) ); 924 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 925 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 926 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ), 927 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) ); 928 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EditMask") ), 929 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":edit-mask") ) ); 930 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LiteralMask") ), 931 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":literal-mask") ) ); 932 readEvents(); 933 } 934 //__________________________________________________________________________________________________ 935 void ElementDescriptor::readFormattedFieldModel( StyleBag * all_styles ) 936 SAL_THROW( (Exception) ) 937 { 938 // collect styles 939 Style aStyle( 0x1 | 0x2 | 0x4 | 0x8 | 0x20 ); 940 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 941 aStyle._set |= 0x1; 942 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 943 aStyle._set |= 0x2; 944 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 945 aStyle._set |= 0x20; 946 if (readBorderProps( this, aStyle )) 947 aStyle._set |= 0x4; 948 if (readFontProps( this, aStyle )) 949 aStyle._set |= 0x8; 950 if (aStyle._set) 951 { 952 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 953 all_styles->getStyleId( aStyle ) ); 954 } 955 956 // collect elements 957 readDefaults(); 958 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 959 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 960 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ), 961 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":readonly") ) ); 962 readBoolAttr( OUSTR("HideInactiveSelection"), 963 OUSTR(XMLNS_DIALOGS_PREFIX ":hide-inactive-selection") ); 964 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("StrictFormat") ), 965 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":strict-format") ) ); 966 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), 967 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) ); 968 readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), 969 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 970 readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MaxTextLen") ), 971 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) ); 972 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Spin") ), 973 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spin") ) ); 974 if (extract_throw<bool>( _xProps->getPropertyValue( OUSTR("Repeat") ) )) 975 readLongAttr( OUSTR("RepeatDelay"), 976 OUSTR(XMLNS_DIALOGS_PREFIX ":repeat"), true /* force */ ); 977 978 Any a( readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveDefault") ) ) ); 979 switch (a.getValueTypeClass()) 980 { 981 case TypeClass_DOUBLE: 982 addAttribute( 983 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-default") ), 984 OUString::valueOf( *(double const *)a.getValue() ) ); 985 break; 986 case TypeClass_STRING: 987 addAttribute( 988 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-default") ), 989 *(OUString const *)a.getValue() ); 990 break; 991 default: 992 break; 993 } 994 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveMin") ), 995 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 996 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveMax") ), 997 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); 998 readDoubleAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EffectiveValue") ), 999 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 1000 1001 // format spec 1002 sal_Int32 nKey = 0; 1003 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FormatKey") ) ) >>= nKey) 1004 { 1005 Reference< util::XNumberFormatsSupplier > xSupplier; 1006 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FormatsSupplier") ) ) >>= xSupplier) 1007 { 1008 addNumberFormatAttr( 1009 xSupplier->getNumberFormats()->getByKey( nKey ), 1010 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 1011 } 1012 } 1013 readBoolAttr( 1014 OUString( RTL_CONSTASCII_USTRINGPARAM("TreatAsNumber") ), 1015 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":treat-as-number") ) ); 1016 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("EnforceFormat") ), 1017 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":enforce-format") ) ); 1018 1019 readEvents(); 1020 } 1021 //__________________________________________________________________________________________________ 1022 void ElementDescriptor::readFixedLineModel( StyleBag * all_styles ) 1023 SAL_THROW( (Exception) ) 1024 { 1025 // collect styles 1026 Style aStyle( 0x2 | 0x8 | 0x20 ); 1027 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 1028 aStyle._set |= 0x2; 1029 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 1030 aStyle._set |= 0x20; 1031 if (readFontProps( this, aStyle )) 1032 aStyle._set |= 0x8; 1033 if (aStyle._set) 1034 { 1035 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 1036 all_styles->getStyleId( aStyle ) ); 1037 } 1038 1039 // collect elements 1040 readDefaults(); 1041 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), 1042 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 1043 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ), 1044 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 1045 readEvents(); 1046 } 1047 //__________________________________________________________________________________________________ 1048 void ElementDescriptor::readProgressBarModel( StyleBag * all_styles ) 1049 SAL_THROW( (Exception) ) 1050 { 1051 // collect styles 1052 Style aStyle( 0x1 | 0x4 | 0x10 ); 1053 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 1054 aStyle._set |= 0x1; 1055 if (readBorderProps( this, aStyle )) 1056 aStyle._set |= 0x4; 1057 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ) ) >>= aStyle._descr) 1058 aStyle._set |= 0x10; 1059 if (aStyle._set) 1060 { 1061 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 1062 all_styles->getStyleId( aStyle ) ); 1063 } 1064 1065 // collect elements 1066 readDefaults(); 1067 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ), 1068 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); 1069 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMin") ), 1070 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); 1071 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), 1072 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); 1073 readEvents(); 1074 } 1075 //__________________________________________________________________________________________________ 1076 void ElementDescriptor::readScrollBarModel( StyleBag * all_styles ) 1077 SAL_THROW( (Exception) ) 1078 { 1079 // collect styles 1080 Style aStyle( 0x1 | 0x4 ); 1081 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 1082 aStyle._set |= 0x1; 1083 if (readBorderProps( this, aStyle )) 1084 aStyle._set |= 0x4; 1085 if (aStyle._set) 1086 { 1087 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 1088 all_styles->getStyleId( aStyle ) ); 1089 } 1090 1091 // collect elements 1092 readDefaults(); 1093 readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ), 1094 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); 1095 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("BlockIncrement") ), 1096 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":pageincrement") ) ); 1097 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") ), 1098 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":increment") ) ); 1099 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") ), 1100 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":curpos") ) ); 1101 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") ), 1102 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxpos") ) ); 1103 readLongAttr( OUSTR("ScrollValueMin"), 1104 OUSTR(XMLNS_DIALOGS_PREFIX ":minpos") ); 1105 readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VisibleSize") ), 1106 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":visible-size") ) ); 1107 readLongAttr( OUSTR("RepeatDelay"), OUSTR(XMLNS_DIALOGS_PREFIX ":repeat") ); 1108 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), 1109 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); 1110 readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LiveScroll") ), 1111 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":live-scroll") ) ); 1112 readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ), 1113 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":symbol-color") ) ); 1114 readEvents(); 1115 } 1116 //__________________________________________________________________________________________________ 1117 void ElementDescriptor::readDialogModel( StyleBag * all_styles ) 1118 SAL_THROW( (Exception) ) 1119 { 1120 // collect elements 1121 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_DIALOGS_PREFIX) ), 1122 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_URI) ) ); 1123 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM("xmlns:" XMLNS_SCRIPT_PREFIX) ), 1124 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_SCRIPT_URI) ) ); 1125 1126 // collect styles 1127 Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 ); 1128 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) 1129 aStyle._set |= 0x1; 1130 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) 1131 aStyle._set |= 0x2; 1132 if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) 1133 aStyle._set |= 0x20; 1134 if (readFontProps( this, aStyle )) 1135 aStyle._set |= 0x8; 1136 if (aStyle._set) 1137 { 1138 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), 1139 all_styles->getStyleId( aStyle ) ); 1140 } 1141 1142 // collect elements 1143 readDefaults( false, false ); 1144 readBoolAttr( 1145 OUString( RTL_CONSTASCII_USTRINGPARAM("Closeable") ), 1146 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":closeable") ) ); 1147 readBoolAttr( 1148 OUString( RTL_CONSTASCII_USTRINGPARAM("Moveable") ), 1149 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":moveable") ) ); 1150 readBoolAttr( 1151 OUString( RTL_CONSTASCII_USTRINGPARAM("Sizeable") ), 1152 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":resizeable") ) ); 1153 readStringAttr( 1154 OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), 1155 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) ); 1156 1157 Any aDecorationAny( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ) ) ); 1158 bool bDecoration = sal_False; 1159 if ( (aDecorationAny >>= bDecoration) && !bDecoration ) 1160 addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":withtitlebar") ), 1161 OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) ); 1162 1163 readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), 1164 OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); 1165 1166 readEvents(); 1167 } 1168 1169 } 1170