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