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