1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_idl.hxx" 30 31 #include <ctype.h> 32 #include <stdio.h> 33 #include <tools/debug.hxx> 34 #include <attrib.hxx> 35 #include <slot.hxx> 36 #include <globals.hxx> 37 #include <database.hxx> 38 39 /****************** SvMetaSlot *****************************************/ 40 SV_IMPL_META_FACTORY1( SvMetaSlot, SvMetaAttribute ); 41 42 SvMetaObject *SvMetaSlot::MakeClone() const 43 { 44 return new SvMetaSlot( *this ); 45 } 46 47 /************************************************************************* 48 |* SvMetaSlot::SvMetaSlot() 49 |* 50 |* Beschreibung Zweites sal_False bei den SvBOOL-Objekten bedeutet, 51 |* IsSet() liefert sal_False (Defaultinitialisierung). 52 *************************************************************************/ 53 SvMetaSlot::SvMetaSlot() 54 : aCachable( sal_True, sal_False ) 55 , aSynchron( sal_True, sal_False ) 56 , aRecordPerSet( sal_True, sal_False ) 57 , aRecordAbsolute( sal_False, sal_False ) 58 , pLinkedSlot(0) 59 , pNextSlot(0) 60 , pEnumValue(0) 61 { 62 } 63 64 SvMetaSlot::SvMetaSlot( SvMetaType * pType ) 65 : SvMetaAttribute( pType ) 66 , aCachable( sal_True, sal_False ) 67 , aSynchron( sal_True, sal_False ) 68 , aRecordPerSet( sal_True, sal_False ) 69 , aRecordAbsolute( sal_False, sal_False ) 70 , pLinkedSlot(0) 71 , pNextSlot(0) 72 , pEnumValue(0) 73 { 74 } 75 76 /* 77 #define TEST_READ \ 78 { \ 79 sal_uInt32 nPos; \ 80 rStm >> nPos; \ 81 DBG_ASSERT( nPos +4 == rStm.Tell(), "stream pos error" ); \ 82 } 83 84 #define TEST_WRITE \ 85 rStm << (sal_uInt32)rStm.Tell(); 86 */ 87 #define TEST_READ 88 #define TEST_WRITE 89 90 void SvMetaSlot::Load( SvPersistStream & rStm ) 91 { 92 SvMetaAttribute::Load( rStm ); 93 94 sal_uInt16 nMask; 95 rStm >> nMask; 96 97 TEST_READ 98 if( nMask & 0x0001 ) 99 { 100 SvMetaAttribute * pMeth; 101 rStm >> pMeth; 102 aMethod = pMeth; 103 } 104 105 TEST_READ 106 if( nMask & 0x0002 ) rStm >> aGroupId; 107 TEST_READ 108 if( nMask & 0x0004 ) rStm >> aHasCoreId; 109 TEST_READ 110 if( nMask & 0x0008 ) rStm >> aConfigId; 111 TEST_READ 112 if( nMask & 0x0010 ) rStm >> aExecMethod; 113 TEST_READ 114 if( nMask & 0x0020 ) rStm >> aStateMethod; 115 TEST_READ 116 if( nMask & 0x0040 ) rStm >> aDefault; 117 TEST_READ 118 if( nMask & 0x0080 ) rStm >> aPseudoSlots; 119 TEST_READ 120 if( nMask & 0x0100 ) rStm >> aGet; 121 TEST_READ 122 if( nMask & 0x0200 ) rStm >> aSet; 123 TEST_READ 124 if( nMask & 0x0400 ) rStm >> aCachable; 125 TEST_READ 126 if( nMask & 0x0800 ) rStm >> aVolatile; 127 TEST_READ 128 if( nMask & 0x1000 ) rStm >> aToggle; 129 TEST_READ 130 if( nMask & 0x2000 ) rStm >> aAutoUpdate; 131 TEST_READ 132 if( nMask & 0x4000 ) rStm >> aSynchron; 133 TEST_READ 134 if( nMask & 0x8000 ) rStm >> aAsynchron; 135 136 nMask = 0; 137 rStm >> nMask; 138 139 TEST_READ 140 if( nMask & 0x0001 ) rStm >> aRecordPerItem; 141 TEST_READ 142 if( nMask & 0x0002 ) rStm >> aRecordManual; 143 TEST_READ 144 if( nMask & 0x0004 ) rStm >> aNoRecord; 145 TEST_READ 146 if( nMask & 0x0008 ) rStm >> aHasDialog; 147 TEST_READ 148 if( nMask & 0x0010 ) rStm >> aDisableFlags; 149 TEST_READ 150 if( nMask & 0x0020 ) rStm >> aPseudoPrefix; 151 TEST_READ 152 if( nMask & 0x0040 ) rStm >> aRecordPerSet; 153 TEST_READ 154 if( nMask & 0x0080 ) rStm >> aMenuConfig; 155 TEST_READ 156 if( nMask & 0x0100 ) rStm >> aToolBoxConfig; 157 TEST_READ 158 if( nMask & 0x0200 ) rStm >> aStatusBarConfig; 159 TEST_READ 160 if( nMask & 0x0400 ) rStm >> aAccelConfig; 161 TEST_READ 162 if( nMask & 0x0800 ) rStm >> aFastCall; 163 TEST_READ 164 if( nMask & 0x1000 ) rStm >> aContainer; 165 TEST_READ 166 167 if( nMask & 0x2000 ) 168 { 169 SvMetaType * pT; 170 rStm >> pT; 171 aSlotType = pT; 172 } 173 174 TEST_READ 175 if( nMask & 0x4000 ) rStm >> aRecordAbsolute; 176 TEST_READ 177 if( nMask & 0x8000 ) rStm >> aImageRotation; 178 179 nMask = 0; 180 rStm >> nMask; 181 182 TEST_READ 183 if( nMask & 0x0001 ) rStm >> aUnoName; 184 if( nMask & 0x0002 ) rStm >> aImageReflection; 185 } 186 187 void SvMetaSlot::Save( SvPersistStream & rStm ) 188 { 189 SvMetaAttribute::Save( rStm ); 190 191 // Maske erstellen 192 sal_uInt16 nMask = 0; 193 if( aMethod.Is() ) nMask |= 0x0001; 194 if( aGroupId.Len() ) nMask |= 0x0002; 195 if( aHasCoreId.IsSet() ) nMask |= 0x0004; 196 if( aConfigId.Len() ) nMask |= 0x0008; 197 if( aExecMethod.Len() ) nMask |= 0x0010; 198 if( aStateMethod.Len() ) nMask |= 0x0020; 199 if( aDefault.Len() ) nMask |= 0x0040; 200 if( aPseudoSlots.IsSet() ) nMask |= 0x0080; 201 if( aGet.IsSet() ) nMask |= 0x0100; 202 if( aSet.IsSet() ) nMask |= 0x0200; 203 if( aCachable.IsSet() ) nMask |= 0x0400; 204 if( aVolatile.IsSet() ) nMask |= 0x0800; 205 if( aToggle.IsSet() ) nMask |= 0x1000; 206 if( aAutoUpdate.IsSet() ) nMask |= 0x2000; 207 if( aSynchron.IsSet() ) nMask |= 0x4000; 208 if( aAsynchron.IsSet() ) nMask |= 0x8000; 209 210 // Daten schreiben 211 rStm << nMask; 212 TEST_WRITE 213 if( nMask & 0x0001 ) rStm << aMethod; 214 TEST_WRITE 215 if( nMask & 0x0002 ) rStm << aGroupId; 216 TEST_WRITE 217 if( nMask & 0x0004 ) rStm << aHasCoreId; 218 TEST_WRITE 219 if( nMask & 0x0008 ) rStm << aConfigId; 220 TEST_WRITE 221 if( nMask & 0x0010 ) rStm << aExecMethod; 222 TEST_WRITE 223 if( nMask & 0x0020 ) rStm << aStateMethod; 224 TEST_WRITE 225 if( nMask & 0x0040 ) rStm << aDefault; 226 TEST_WRITE 227 if( nMask & 0x0080 ) rStm << aPseudoSlots; 228 TEST_WRITE 229 if( nMask & 0x0100 ) rStm << aGet; 230 TEST_WRITE 231 if( nMask & 0x0200 ) rStm << aSet; 232 TEST_WRITE 233 if( nMask & 0x0400 ) rStm << aCachable; 234 TEST_WRITE 235 if( nMask & 0x0800 ) rStm << aVolatile; 236 TEST_WRITE 237 if( nMask & 0x1000 ) rStm << aToggle; 238 TEST_WRITE 239 if( nMask & 0x2000 ) rStm << aAutoUpdate; 240 TEST_WRITE 241 if( nMask & 0x4000 ) rStm << aSynchron; 242 TEST_WRITE 243 if( nMask & 0x8000 ) rStm << aAsynchron; 244 245 // naechste Fuhre schreiben 246 // Maske erstellen 247 nMask = 0; 248 if( aRecordPerItem.IsSet() ) nMask |= 0x0001; 249 if( aRecordManual.IsSet() ) nMask |= 0x0002; 250 if( aNoRecord.IsSet() ) nMask |= 0x0004; 251 if( aHasDialog.IsSet() ) nMask |= 0x0008; 252 if ( aDisableFlags.IsSet() ) nMask |= 0x0010; 253 if( aPseudoPrefix.Len() ) nMask |= 0x0020; 254 if( aRecordPerSet.IsSet() ) nMask |= 0x0040; 255 if( aMenuConfig.IsSet() ) nMask |= 0x0080; 256 if( aToolBoxConfig.IsSet() ) nMask |= 0x0100; 257 if( aStatusBarConfig.IsSet() )nMask |= 0x0200; 258 if( aAccelConfig.IsSet() ) nMask |= 0x0400; 259 if( aFastCall.IsSet() ) nMask |= 0x0800; 260 if( aContainer.IsSet() ) nMask |= 0x1000; 261 if( aSlotType.Is() ) nMask |= 0x2000; 262 if( aRecordAbsolute.IsSet() ) nMask |= 0x4000; 263 if( aImageRotation.IsSet() ) nMask |= 0x8000; 264 265 // Daten schreiben 266 rStm << nMask; 267 TEST_WRITE 268 if( nMask & 0x0001 ) rStm << aRecordPerItem; 269 TEST_WRITE 270 if( nMask & 0x0002 ) rStm << aRecordManual; 271 TEST_WRITE 272 if( nMask & 0x0004 ) rStm << aNoRecord; 273 TEST_WRITE 274 if( nMask & 0x0008 ) rStm << aHasDialog; 275 TEST_WRITE 276 if( nMask & 0x0010 ) rStm << aDisableFlags; 277 TEST_WRITE 278 if( nMask & 0x0020 ) rStm << aPseudoPrefix; 279 TEST_WRITE 280 if( nMask & 0x0040 ) rStm << aRecordPerSet; 281 TEST_WRITE 282 if( nMask & 0x0080 ) rStm << aMenuConfig; 283 TEST_WRITE 284 if( nMask & 0x0100 ) rStm << aToolBoxConfig; 285 TEST_WRITE 286 if( nMask & 0x0200 ) rStm << aStatusBarConfig; 287 TEST_WRITE 288 if( nMask & 0x0400 ) rStm << aAccelConfig; 289 TEST_WRITE 290 if( nMask & 0x0800 ) rStm << aFastCall; 291 TEST_WRITE 292 if( nMask & 0x1000 ) rStm << aContainer; 293 TEST_WRITE 294 if( nMask & 0x2000 ) rStm << aSlotType; 295 TEST_WRITE 296 if( nMask & 0x4000 ) rStm << aRecordAbsolute; 297 TEST_WRITE 298 if( nMask & 0x8000 ) rStm << aImageRotation; 299 300 nMask = 0; 301 if( aUnoName.IsSet() ) nMask |= 0x0001; 302 if( aImageReflection.IsSet() ) nMask |= 0x0002; 303 rStm << nMask; 304 TEST_WRITE 305 if( nMask & 0x0001 ) rStm << aUnoName; 306 TEST_WRITE 307 if( nMask & 0x0002 ) rStm << aImageReflection; 308 } 309 310 /************************************************************************* 311 |* SvMetaSlot::IsVariable() 312 |* 313 |* Beschreibung 314 *************************************************************************/ 315 sal_Bool SvMetaSlot::IsVariable() const 316 { 317 return SvMetaAttribute::IsVariable(); 318 } 319 320 /************************************************************************* 321 |* SvMetaSlot::IsMethod() 322 |* 323 |* Beschreibung 324 *************************************************************************/ 325 sal_Bool SvMetaSlot::IsMethod() const 326 { 327 sal_Bool b = SvMetaAttribute::IsMethod(); 328 b |= NULL != GetMethod(); 329 return b; 330 } 331 332 /************************************************************************* 333 |* SvMetaSlot::HasMethods() 334 |* 335 |* Beschreibung 336 *************************************************************************/ 337 ByteString SvMetaSlot::GetMangleName( sal_Bool bVariable ) const 338 { 339 if( !bVariable ) 340 { 341 SvMetaAttribute * pMeth = GetMethod(); 342 if( pMeth ) 343 return pMeth->GetName(); 344 } 345 return GetName(); 346 } 347 348 /************************************************************************* 349 |* Referenz 350 |* 351 |* Beschreibung Zweites sal_False bei den SvBOOL-Objekten bedeutet, 352 |* IsSet() liefert sal_False (Defaultinitialisierung). 353 *************************************************************************/ 354 /** Referenz Aufloesung **/ 355 SvMetaType * SvMetaSlot::GetSlotType() const 356 { 357 if( aSlotType.Is() || !GetRef() ) return aSlotType; 358 return ((SvMetaSlot *)GetRef())->GetSlotType(); 359 } 360 SvMetaAttribute * SvMetaSlot::GetMethod() const 361 { 362 if( aMethod.Is() || !GetRef() ) return aMethod; 363 return ((SvMetaSlot *)GetRef())->GetMethod(); 364 } 365 sal_Bool SvMetaSlot::GetHasCoreId() const 366 { 367 if( aHasCoreId.IsSet() || !GetRef() ) return aHasCoreId; 368 return ((SvMetaSlot *)GetRef())->GetHasCoreId(); 369 } 370 const ByteString & SvMetaSlot::GetGroupId() const 371 { 372 if( aGroupId.Len() || !GetRef() ) return aGroupId; 373 return ((SvMetaSlot *)GetRef())->GetGroupId(); 374 } 375 const ByteString & SvMetaSlot::GetDisableFlags() const 376 { 377 if( aDisableFlags.Len() || !GetRef() ) return aDisableFlags; 378 return ((SvMetaSlot *)GetRef())->GetDisableFlags(); 379 } 380 const ByteString & SvMetaSlot::GetConfigId() const 381 { 382 if( aConfigId.Len() || !GetRef() ) return aConfigId; 383 return ((SvMetaSlot *)GetRef())->GetConfigId(); 384 } 385 const ByteString & SvMetaSlot::GetExecMethod() const 386 { 387 if( aExecMethod.Len() || !GetRef() ) return aExecMethod; 388 return ((SvMetaSlot *)GetRef())->GetExecMethod(); 389 } 390 const ByteString & SvMetaSlot::GetStateMethod() const 391 { 392 if( aStateMethod.Len() || !GetRef() ) return aStateMethod; 393 return ((SvMetaSlot *)GetRef())->GetStateMethod(); 394 } 395 const ByteString & SvMetaSlot::GetDefault() const 396 { 397 if( aDefault.Len() || !GetRef() ) return aDefault; 398 return ((SvMetaSlot *)GetRef())->GetDefault(); 399 } 400 sal_Bool SvMetaSlot::GetPseudoSlots() const 401 { 402 if( aPseudoSlots.IsSet() || !GetRef() ) return aPseudoSlots; 403 return ((SvMetaSlot *)GetRef())->GetPseudoSlots(); 404 } 405 /* 406 sal_Bool SvMetaSlot::GetGet() const 407 { 408 if( aGet.IsSet() || !GetRef() ) return aGet; 409 return ((SvMetaSlot *)GetRef())->GetGet(); 410 } 411 sal_Bool SvMetaSlot::GetSet() const 412 { 413 if( aSet.IsSet() || !GetRef() ) return aSet; 414 return ((SvMetaSlot *)GetRef())->GetSet(); 415 } 416 */ 417 sal_Bool SvMetaSlot::GetCachable() const 418 { 419 // Cachable und Volatile sind exclusiv 420 if( !GetRef() || aCachable.IsSet() || aVolatile.IsSet() ) 421 return aCachable; 422 return ((SvMetaSlot *)GetRef())->GetCachable(); 423 } 424 sal_Bool SvMetaSlot::GetVolatile() const 425 { 426 // Cachable und Volatile sind exclusiv 427 if( !GetRef() || aVolatile.IsSet() || aCachable.IsSet() ) 428 return aVolatile; 429 return ((SvMetaSlot *)GetRef())->GetVolatile(); 430 } 431 sal_Bool SvMetaSlot::GetToggle() const 432 { 433 if( aToggle.IsSet() || !GetRef() ) return aToggle; 434 return ((SvMetaSlot *)GetRef())->GetToggle(); 435 } 436 sal_Bool SvMetaSlot::GetAutoUpdate() const 437 { 438 if( aAutoUpdate.IsSet() || !GetRef() ) return aAutoUpdate; 439 return ((SvMetaSlot *)GetRef())->GetAutoUpdate(); 440 } 441 sal_Bool SvMetaSlot::GetSynchron() const 442 { 443 // Synchron und Asynchron sind exclusiv 444 if( !GetRef() || aSynchron.IsSet() || aAsynchron.IsSet() ) 445 return aSynchron; 446 return ((SvMetaSlot *)GetRef())->GetSynchron(); 447 } 448 sal_Bool SvMetaSlot::GetAsynchron() const 449 { 450 // Synchron und Asynchron sind exclusiv 451 if( !GetRef() || aAsynchron.IsSet() || aSynchron.IsSet() ) 452 return aAsynchron; 453 return ((SvMetaSlot *)GetRef())->GetAsynchron(); 454 } 455 sal_Bool SvMetaSlot::GetRecordPerItem() const 456 { 457 // Record- PerItem, No, PerSet und Manual sind exclusiv 458 if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet() 459 || aRecordPerSet.IsSet() || aRecordManual.IsSet() ) 460 return aRecordPerItem; 461 return ((SvMetaSlot *)GetRef())->GetRecordPerItem(); 462 } 463 sal_Bool SvMetaSlot::GetRecordPerSet() const 464 { 465 // Record- PerItem, No, PerSet und Manual sind exclusiv 466 if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet() 467 || aRecordPerSet.IsSet() || aRecordManual.IsSet() ) 468 return aRecordPerSet; 469 return ((SvMetaSlot *)GetRef())->GetRecordPerSet(); 470 } 471 sal_Bool SvMetaSlot::GetRecordManual() const 472 { 473 // Record- PerItem, No, PerSet und Manual sind exclusiv 474 if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet() 475 || aRecordPerSet.IsSet() || aRecordManual.IsSet() ) 476 return aRecordManual; 477 return ((SvMetaSlot *)GetRef())->GetRecordManual(); 478 } 479 sal_Bool SvMetaSlot::GetNoRecord() const 480 { 481 // Record- PerItem, No, PerSet und Manual sind exclusiv 482 if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet() 483 || aRecordPerSet.IsSet() || aRecordManual.IsSet() ) 484 return aNoRecord; 485 return ((SvMetaSlot *)GetRef())->GetNoRecord(); 486 } 487 sal_Bool SvMetaSlot::GetRecordAbsolute() const 488 { 489 if( !GetRef() || aRecordAbsolute.IsSet() ) 490 return aRecordAbsolute; 491 return ((SvMetaSlot *)GetRef())->GetRecordAbsolute(); 492 } 493 sal_Bool SvMetaSlot::GetHasDialog() const 494 { 495 if( aHasDialog.IsSet() || !GetRef() ) return aHasDialog; 496 return ((SvMetaSlot *)GetRef())->GetHasDialog(); 497 } 498 const ByteString & SvMetaSlot::GetPseudoPrefix() const 499 { 500 if( aPseudoPrefix.Len() || !GetRef() ) return aPseudoPrefix; 501 return ((SvMetaSlot *)GetRef())->GetPseudoPrefix(); 502 } 503 sal_Bool SvMetaSlot::GetMenuConfig() const 504 { 505 if( aMenuConfig.IsSet() || !GetRef() ) return aMenuConfig; 506 return ((SvMetaSlot *)GetRef())->GetMenuConfig(); 507 } 508 sal_Bool SvMetaSlot::GetToolBoxConfig() const 509 { 510 if( aToolBoxConfig.IsSet() || !GetRef() ) return aToolBoxConfig; 511 return ((SvMetaSlot *)GetRef())->GetToolBoxConfig(); 512 } 513 sal_Bool SvMetaSlot::GetStatusBarConfig() const 514 { 515 if( aStatusBarConfig.IsSet() || !GetRef() ) return aStatusBarConfig; 516 return ((SvMetaSlot *)GetRef())->GetStatusBarConfig(); 517 } 518 sal_Bool SvMetaSlot::GetAccelConfig() const 519 { 520 if( aAccelConfig.IsSet() || !GetRef() ) return aAccelConfig; 521 return ((SvMetaSlot *)GetRef())->GetAccelConfig(); 522 } 523 sal_Bool SvMetaSlot::GetFastCall() const 524 { 525 if( aFastCall.IsSet() || !GetRef() ) return aFastCall; 526 return ((SvMetaSlot *)GetRef())->GetFastCall(); 527 } 528 sal_Bool SvMetaSlot::GetContainer() const 529 { 530 if( aContainer.IsSet() || !GetRef() ) return aContainer; 531 return ((SvMetaSlot *)GetRef())->GetContainer(); 532 } 533 534 sal_Bool SvMetaSlot::GetImageRotation() const 535 { 536 if( aImageRotation.IsSet() || !GetRef() ) return aImageRotation; 537 return ((SvMetaSlot *)GetRef())->GetImageRotation(); 538 } 539 540 sal_Bool SvMetaSlot::GetImageReflection() const 541 { 542 if( aImageReflection.IsSet() || !GetRef() ) return aImageReflection; 543 return ((SvMetaSlot *)GetRef())->GetImageReflection(); 544 } 545 546 const ByteString& SvMetaSlot::GetUnoName() const 547 { 548 if( aUnoName.IsSet() || !GetRef() ) return aUnoName; 549 return ((SvMetaSlot *)GetRef())->GetUnoName(); 550 } 551 552 /************************************************************************* 553 |* SvMetaSlot::FillSbxObject() 554 |* 555 |* Beschreibung 556 *************************************************************************/ 557 /* 558 void SvMetaSlot::FillSbxObject( SvIdlDataBase & rBase, SbxObject * pObj, 559 sal_Bool bVariable ) 560 { 561 // keine Attribut fuer Automation 562 if( !GetAutomation() || !GetExport() ) 563 return; 564 565 if( !bVariable ) 566 { 567 SvMetaAttributeRef xM = GetMethod(); 568 if( xM.Is() ) 569 { 570 SvMetaType * pType = xM->GetType(); 571 SvMetaType * pRetBaseType = pType->GetReturnType()->GetBaseType(); 572 ByteString aName = xM->GetName(); 573 574 SbxMethodRef xMeth = new SbxMethod( aName, 575 pRetBaseType->GetSbxDataType() ); 576 pType->FillSbxObject( xMeth, bVariable ); 577 xMeth->SetUserData( MakeSlotValue(rBase, sal_False) ); 578 579 pObj->Insert( &xMeth ); 580 return; 581 } 582 } 583 584 SvMetaAttribute::FillSbxObject( rBase, pObj, bVariable ); 585 } 586 */ 587 588 #ifdef IDL_COMPILER 589 /************************************************************************* 590 |* SvMetaSlot::ReadAttributesSvIdl() 591 |* 592 |* Beschreibung 593 *************************************************************************/ 594 void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, 595 SvTokenStream & rInStm ) 596 { 597 SvMetaAttribute::ReadAttributesSvIdl( rBase, rInStm ); 598 599 sal_Bool bOk = sal_False; 600 bOk |= aDefault.ReadSvIdl( SvHash_Default(), rInStm ); 601 bOk |= aPseudoSlots.ReadSvIdl( SvHash_PseudoSlots(), rInStm ); 602 bOk |= aHasCoreId.ReadSvIdl( SvHash_HasCoreId(), rInStm ); 603 bOk |= aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm ); 604 bOk |= aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm ); 605 bOk |= aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm ); 606 bOk |= aDisableFlags.ReadSvIdl( SvHash_DisableFlags(), rInStm ); 607 if( aGet.ReadSvIdl( SvHash_Get(), rInStm ) ) 608 { 609 rBase.WriteError( "warning", ByteString( rInStm.GetFileName(), RTL_TEXTENCODING_UTF8 ), 610 "<Get> old style, use Readonly", 611 rInStm.GetToken()->GetLine(), 612 rInStm.GetToken()->GetColumn() ); 613 } 614 if( aSet.ReadSvIdl( SvHash_Set(), rInStm ) ) 615 { 616 rBase.WriteError( "warning", ByteString( rInStm.GetFileName(), RTL_TEXTENCODING_UTF8 ), 617 "<Set> old style, use method declaration", 618 rInStm.GetToken()->GetLine(), 619 rInStm.GetToken()->GetColumn() ); 620 } 621 622 if( aCachable.ReadSvIdl( SvHash_Cachable(), rInStm ) ) 623 SetCachable( aCachable ), bOk = sal_True; 624 if( aVolatile.ReadSvIdl( SvHash_Volatile(), rInStm ) ) 625 SetVolatile( aVolatile ), bOk = sal_True; 626 if( aToggle.ReadSvIdl( SvHash_Toggle(), rInStm ) ) 627 SetToggle( aToggle ), bOk = sal_True; 628 if( aAutoUpdate.ReadSvIdl( SvHash_AutoUpdate(), rInStm ) ) 629 SetAutoUpdate( aAutoUpdate ), bOk = sal_True; 630 631 if( aSynchron.ReadSvIdl( SvHash_Synchron(), rInStm ) ) 632 SetSynchron( aSynchron ), bOk = sal_True; 633 if( aAsynchron.ReadSvIdl( SvHash_Asynchron(), rInStm ) ) 634 SetAsynchron( aAsynchron ), bOk = sal_True; 635 636 if( aRecordAbsolute.ReadSvIdl( SvHash_RecordAbsolute(), rInStm ) ) 637 SetRecordAbsolute( aRecordAbsolute), bOk = sal_True; 638 if( aRecordPerItem.ReadSvIdl( SvHash_RecordPerItem(), rInStm ) ) 639 SetRecordPerItem( aRecordPerItem ), bOk = sal_True; 640 if( aRecordPerSet.ReadSvIdl( SvHash_RecordPerSet(), rInStm ) ) 641 SetRecordPerSet( aRecordPerSet ), bOk = sal_True; 642 if( aRecordManual.ReadSvIdl( SvHash_RecordManual(), rInStm ) ) 643 SetRecordManual( aRecordManual ), bOk = sal_True; 644 if( aNoRecord.ReadSvIdl( SvHash_NoRecord(), rInStm ) ) 645 SetNoRecord( aNoRecord ), bOk = sal_True; 646 647 bOk |= aHasDialog.ReadSvIdl( SvHash_HasDialog(), rInStm ); 648 bOk |= aPseudoPrefix.ReadSvIdl( SvHash_PseudoPrefix(), rInStm ); 649 bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm ); 650 bOk |= aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm ); 651 bOk |= aStatusBarConfig.ReadSvIdl( SvHash_StatusBarConfig(), rInStm ); 652 bOk |= aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm ); 653 654 SvBOOL aAllConfig; 655 if( aAllConfig.ReadSvIdl( SvHash_AllConfig(), rInStm ) ) 656 SetAllConfig( aAllConfig ), bOk = sal_True; 657 bOk |= aFastCall.ReadSvIdl( SvHash_FastCall(), rInStm ); 658 bOk |= aContainer.ReadSvIdl( SvHash_Container(), rInStm ); 659 bOk |= aImageRotation.ReadSvIdl( SvHash_ImageRotation(), rInStm ); 660 bOk |= aImageReflection.ReadSvIdl( SvHash_ImageReflection(), rInStm ); 661 bOk |= aUnoName.ReadSvIdl( SvHash_UnoName(), rInStm ); 662 663 if( !bOk ) 664 { 665 if( !aSlotType.Is() ) 666 { 667 sal_uInt32 nTokPos = rInStm.Tell(); 668 SvToken * pTok = rInStm.GetToken_Next(); 669 if( pTok->Is( SvHash_SlotType() ) ) 670 { 671 sal_Bool bBraket = rInStm.Read( '(' ); 672 if( bBraket || rInStm.Read( '=' ) ) 673 { 674 aSlotType = rBase.ReadKnownType( rInStm ); 675 if( aSlotType.Is() ) 676 { 677 if( aSlotType->IsItem() ) 678 { 679 if( bBraket ) 680 { 681 if( rInStm.Read( ')' ) ) 682 return; 683 } 684 else 685 return; 686 } 687 rBase.SetError( "the SlotType is not a item", rInStm.GetToken() ); 688 rBase.WriteError( rInStm ); 689 } 690 rBase.SetError( "SlotType with unknown item type", rInStm.GetToken() ); 691 rBase.WriteError( rInStm ); 692 } 693 } 694 rInStm.Seek( nTokPos ); 695 696 } 697 if( !aMethod.Is() ) 698 { 699 SvToken * pTok = rInStm.GetToken(); 700 if( pTok->IsIdentifier() ) 701 { 702 aMethod = new SvMetaSlot(); 703 sal_uInt32 nTokPos = rInStm.Tell(); 704 if( aMethod->ReadSvIdl( rBase, rInStm ) ) 705 { 706 if( aMethod->IsMethod() ) 707 { 708 aMethod->SetSlotId( GetSlotId() ); 709 if( aMethod->Test( rBase, rInStm ) ) 710 return; 711 } 712 rInStm.Seek( nTokPos ); 713 } 714 aMethod.Clear(); 715 } 716 } 717 } 718 } 719 720 /************************************************************************* 721 |* SvMetaSlot::WriteAttributesSvIdl() 722 |* 723 |* Beschreibung 724 *************************************************************************/ 725 void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase, 726 SvStream & rOutStm, 727 sal_uInt16 nTab ) 728 { 729 SvMetaAttribute::WriteAttributesSvIdl( rBase, rOutStm, nTab ); 730 731 if( aSlotType.Is() ) 732 { 733 WriteTab( rOutStm, nTab ); 734 rOutStm << SvHash_SlotType()->GetName().GetBuffer() << '('; 735 aSlotType->WriteTheType( rBase, rOutStm, nTab, WRITE_IDL ); 736 rOutStm << ");" << endl; 737 } 738 if( aMethod.Is() ) 739 { 740 WriteTab( rOutStm, nTab ); 741 aMethod->WriteSvIdl( rBase, rOutStm, nTab ); 742 rOutStm << ';' << endl; 743 } 744 if( aHasCoreId ) 745 { 746 aHasCoreId.WriteSvIdl( SvHash_HasCoreId(), rOutStm ); 747 rOutStm << ';' << endl; 748 } 749 if( aGroupId.Len() ) 750 { 751 WriteTab( rOutStm, nTab ); 752 aGroupId.WriteSvIdl( SvHash_GroupId(), rOutStm, nTab +1); 753 rOutStm << ';' << endl; 754 } 755 if( aExecMethod.Len() ) 756 { 757 WriteTab( rOutStm, nTab ); 758 aExecMethod.WriteSvIdl( SvHash_ExecMethod(), rOutStm, nTab +1); 759 rOutStm << ';' << endl; 760 } 761 if( aStateMethod.Len() ) 762 { 763 WriteTab( rOutStm, nTab ); 764 aStateMethod.WriteSvIdl( SvHash_StateMethod(), rOutStm, nTab +1); 765 rOutStm << ';' << endl; 766 } 767 768 if( aDisableFlags.Len() ) 769 { 770 WriteTab( rOutStm, nTab ); 771 aDisableFlags.WriteSvIdl( SvHash_DisableFlags(), rOutStm, nTab +1); 772 rOutStm << ';' << endl; 773 } 774 775 if( aSet || aGet || aPseudoSlots ) 776 { 777 WriteTab( rOutStm, nTab ); 778 char const * p = ""; 779 if( aPseudoSlots ) 780 { 781 aPseudoSlots.WriteSvIdl( SvHash_PseudoSlots(), rOutStm ); 782 p = ", "; 783 } 784 if( aGet ) 785 { 786 rOutStm << p; 787 aGet.WriteSvIdl( SvHash_Get(), rOutStm ); 788 p = ", "; 789 } 790 if( aSet ) 791 { 792 rOutStm << p; 793 aSet.WriteSvIdl( SvHash_Set(), rOutStm ); 794 } 795 rOutStm << ';' << endl; 796 } 797 798 ByteString aDel( ", " ); 799 ByteString aOut; 800 if( aVolatile ) 801 aOut += aVolatile.GetSvIdlString( SvHash_Volatile() ); 802 else if( !aCachable ) 803 // wegen Default == sal_True, nur wenn kein anderer gesetzt 804 aOut += aCachable.GetSvIdlString( SvHash_Cachable() ); 805 else 806 aDel.Erase(); 807 808 if( aToggle ) 809 { 810 ( aOut += aDel ) += aToggle.GetSvIdlString( SvHash_Toggle() ); 811 aDel = ", "; 812 } 813 if( aAutoUpdate ) 814 { 815 (aOut += aDel ) += aAutoUpdate.GetSvIdlString( SvHash_AutoUpdate() ); 816 aDel = ", "; 817 } 818 819 ByteString aDel1( ", " ); 820 if( aAsynchron ) 821 ( aOut += aDel ) += aAsynchron.GetSvIdlString( SvHash_Asynchron() ); 822 else if( !aSynchron ) 823 // wegen Default == sal_True, nur wenn kein anderer gesetzt 824 ( aOut += aDel ) += aSynchron.GetSvIdlString( SvHash_Synchron() ); 825 else 826 aDel1 = aDel; 827 828 aDel = ", "; 829 if( aRecordManual ) 830 ( aOut += aDel1 ) += aRecordManual.GetSvIdlString( SvHash_RecordManual() ); 831 else if( aNoRecord ) 832 ( aOut += aDel1 ) += aNoRecord.GetSvIdlString( SvHash_NoRecord() ); 833 else if( !aRecordPerSet ) 834 // wegen Default == sal_True, nur wenn kein anderer gesetzt 835 ( aOut += aDel1 ) += aRecordPerSet.GetSvIdlString( SvHash_RecordPerSet() ); 836 else if( aRecordPerItem ) 837 ( aOut += aDel1 ) += aRecordPerItem.GetSvIdlString( SvHash_RecordPerItem() ); 838 else 839 aDel = aDel1; 840 841 if( aRecordAbsolute ) 842 { 843 ( aOut += aDel ) += aRecordAbsolute.GetSvIdlString( SvHash_RecordAbsolute() ); 844 aDel = ", "; 845 } 846 if( aHasDialog ) 847 { 848 ( aOut += aDel ) += aHasDialog.GetSvIdlString( SvHash_HasDialog() ); 849 aDel = ", "; 850 } 851 if( aMenuConfig ) 852 { 853 ( aOut += aDel ) += aMenuConfig.GetSvIdlString( SvHash_MenuConfig() ); 854 aDel = ", "; 855 } 856 if( aToolBoxConfig ) 857 { 858 ( aOut += aDel ) += aToolBoxConfig.GetSvIdlString( SvHash_ToolBoxConfig() ); 859 aDel = ", "; 860 } 861 if( aStatusBarConfig ) 862 { 863 ( aOut += aDel ) += aStatusBarConfig.GetSvIdlString( SvHash_StatusBarConfig() ); 864 aDel = ", "; 865 } 866 if( aAccelConfig ) 867 { 868 ( aOut += aDel ) += aAccelConfig.GetSvIdlString( SvHash_AccelConfig() ); 869 aDel = ", "; 870 } 871 if( aFastCall ) 872 { 873 ( aOut += aDel ) += aFastCall.GetSvIdlString( SvHash_FastCall() ); 874 aDel = ", "; 875 } 876 if( aContainer ) 877 { 878 ( aOut += aDel ) += aContainer.GetSvIdlString( SvHash_Container() ); 879 aDel = ", "; 880 } 881 if( aImageRotation ) 882 { 883 ( aOut += aDel ) += aImageRotation.GetSvIdlString( SvHash_ImageRotation() ); 884 aDel = ", "; 885 } 886 887 if( aImageReflection ) 888 { 889 ( aOut += aDel ) += aImageReflection.GetSvIdlString( SvHash_ImageReflection() ); 890 aDel = ", "; 891 } 892 893 if( aOut.Len() ) 894 { 895 WriteTab( rOutStm, nTab ); 896 rOutStm << aOut.GetBuffer() << endl; 897 } 898 } 899 900 901 /************************************************************************* 902 |* SvMetaSlot::Test() 903 |* 904 |* Beschreibung 905 *************************************************************************/ 906 sal_Bool SvMetaSlot::Test( SvIdlDataBase & rBase, SvTokenStream & rInStm ) 907 { 908 sal_Bool bOk = SvMetaAttribute::Test( rBase, rInStm ); 909 if( bOk ) 910 { 911 SvMetaType * pType = GetType(); 912 if( pType->GetType() == TYPE_METHOD ) 913 pType = pType->GetReturnType(); 914 if( !pType->IsItem() ) 915 { 916 rBase.SetError( "this attribute is not a slot", rInStm.GetToken() ); 917 rBase.WriteError( rInStm ); 918 bOk = sal_False; 919 } 920 } 921 922 return bOk; 923 } 924 925 /************************************************************************* 926 |* SvMetaSlot::ReadSvIdl() 927 |* 928 |* Beschreibung 929 *************************************************************************/ 930 sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) 931 { 932 sal_uInt32 nTokPos = rInStm.Tell(); 933 sal_Bool bOk = sal_True; 934 935 SvMetaAttribute * pAttr = rBase.ReadKnownAttr( rInStm, GetType() ); 936 if( pAttr ) 937 { 938 // F"ur Testzwecke: Referenz bei Kurz-Syntax 939 SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr ); 940 if( pKnownSlot ) 941 { 942 SetRef( pKnownSlot ); 943 SetName( pKnownSlot->GetName(), &rBase ); 944 bOk = SvMetaName::ReadSvIdl( rBase, rInStm ); 945 } 946 else 947 { 948 ByteString aStr( "attribute " ); 949 aStr += pAttr->GetName(); 950 aStr += " is method or variable but not a slot"; 951 rBase.SetError( aStr, rInStm.GetToken() ); 952 rBase.WriteError( rInStm ); 953 bOk = sal_False; 954 } 955 } 956 else 957 { 958 bOk = SvMetaAttribute::ReadSvIdl( rBase, rInStm ); 959 960 SvMetaAttribute *pAttr2 = rBase.SearchKnownAttr( GetSlotId() ); 961 if( pAttr2 ) 962 { 963 // F"ur Testzwecke: Referenz bei kompletter Definition 964 SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr2 ); 965 if( pKnownSlot ) 966 { 967 SetRef( pKnownSlot ); 968 969 // Namen d"urfen abweichen, da mit angegeben 970 if ( pKnownSlot->GetName() != GetName() ) 971 { 972 DBG_ERROR("Illegal definition!"); 973 rInStm.Seek( nTokPos ); 974 return sal_False; 975 } 976 977 SetName( pKnownSlot->GetName(), &rBase ); 978 } 979 else 980 { 981 ByteString aStr( "attribute " ); 982 aStr += pAttr2->GetName(); 983 aStr += " is method or variable but not a slot"; 984 rBase.SetError( aStr, rInStm.GetToken() ); 985 rBase.WriteError( rInStm ); 986 bOk = sal_False; 987 } 988 } 989 } 990 991 if( !bOk ) 992 rInStm.Seek( nTokPos ); 993 994 return bOk; 995 } 996 997 /************************************************************************* 998 |* SvMetaSlot::WriteSvIdl() 999 |* 1000 |* Beschreibung 1001 *************************************************************************/ 1002 void SvMetaSlot::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm, 1003 sal_uInt16 nTab ) 1004 { 1005 SvMetaAttribute::WriteSvIdl( rBase, rOutStm, nTab ); 1006 } 1007 1008 /************************************************************************* 1009 |* SvMetaSlot::Write() 1010 |* 1011 |* Beschreibung 1012 *************************************************************************/ 1013 void SvMetaSlot::Write( SvIdlDataBase & rBase, 1014 SvStream & rOutStm, sal_uInt16 nTab, 1015 WriteType nT, WriteAttribute nA ) 1016 { 1017 if ( nT == WRITE_DOCU ) 1018 { 1019 if ( GetHidden() ) 1020 return; 1021 } 1022 else 1023 { 1024 // keine Attribut fuer Automation 1025 if( !GetAutomation() || !GetExport() ) 1026 return; 1027 } 1028 1029 if( !(nA & WA_VARIABLE) ) 1030 { 1031 SvMetaAttributeRef xM = GetMethod(); 1032 if( xM.Is() ) 1033 { 1034 xM->SetSlotId( GetSlotId() ); 1035 xM->SetDescription( GetDescription() ); 1036 xM->Write( rBase, rOutStm, nTab, nT, nA ); 1037 return; 1038 } 1039 } 1040 1041 SvMetaAttribute::Write( rBase, rOutStm, nTab, nT, nA ); 1042 } 1043 1044 1045 void SvMetaSlot::Insert( SvSlotElementList& rList, const ByteString & rPrefix, 1046 SvIdlDataBase& rBase) 1047 { 1048 // Einf"ugeposition durch bin"are Suche in der SlotListe ermitteln 1049 sal_uInt16 nId = (sal_uInt16) GetSlotId().GetValue(); 1050 sal_uInt16 nListCount = (sal_uInt16) rList.Count(); 1051 sal_uInt16 nPos; 1052 sal_uLong m; // for inner "for" loop 1053 1054 if ( !nListCount ) 1055 nPos = 0; 1056 else if ( nListCount == 1 ) 1057 nPos = rList.GetObject(0)->xSlot->GetSlotId().GetValue() >= nId ? 0 : 1; 1058 else 1059 { 1060 sal_uInt16 nMid = 0, nLow = 0; 1061 sal_uInt16 nHigh = nListCount - 1; 1062 sal_Bool bFound = sal_False; 1063 while ( !bFound && nLow <= nHigh ) 1064 { 1065 nMid = (nLow + nHigh) >> 1; 1066 DBG_ASSERT( nMid < nListCount, "bsearch ist buggy" ); 1067 int nDiff = (int) nId - (int) rList.GetObject(nMid)->xSlot->GetSlotId().GetValue(); 1068 if ( nDiff < 0) 1069 { 1070 if ( nMid == 0 ) 1071 break; 1072 nHigh = nMid - 1; 1073 } 1074 else if ( nDiff > 0 ) 1075 { 1076 nLow = nMid + 1; 1077 if ( nLow == 0 ) 1078 break; 1079 } 1080 else 1081 bFound = sal_True; 1082 } 1083 1084 DBG_ASSERT(!bFound, "Duplicate SlotId!"); 1085 nPos = bFound ? nMid : nLow; 1086 } 1087 1088 DBG_ASSERT( nPos <= nListCount, 1089 "nPos too large" ); 1090 DBG_ASSERT( nPos == nListCount || nId <= 1091 (sal_uInt16) rList.GetObject(nPos)->xSlot->GetSlotId().GetValue(), 1092 "Successor has lower SlotId" ); 1093 DBG_ASSERT( nPos == 0 || nId > 1094 (sal_uInt16) rList.GetObject(nPos-1)->xSlot->GetSlotId().GetValue(), 1095 "Predecessor has higher SlotId" ); 1096 DBG_ASSERT( nPos+1 >= nListCount || nId < 1097 (sal_uInt16) rList.GetObject(nPos+1)->xSlot->GetSlotId().GetValue(), 1098 "Successor has lower SlotId" ); 1099 1100 rList.Insert( new SvSlotElement( this, rPrefix ), nPos ); 1101 1102 // EnumSlots plattklopfen 1103 SvMetaTypeEnum * pEnum = NULL; 1104 SvMetaType * pBType = GetType()->GetBaseType(); 1105 pEnum = PTR_CAST( SvMetaTypeEnum, pBType ); 1106 if( GetPseudoSlots() && pEnum && pEnum->Count() ) 1107 { 1108 // Den MasterSlot clonen 1109 SvMetaSlotRef xEnumSlot; 1110 SvMetaSlot *pFirstEnumSlot = NULL; 1111 for( sal_uLong n = 0; n < pEnum->Count(); n++ ) 1112 { 1113 // Die SlotId erzeugen 1114 SvMetaEnumValue *enumValue = pEnum->GetObject(n); 1115 ByteString aValName = enumValue->GetName(); 1116 ByteString aSId( GetSlotId() ); 1117 if( GetPseudoPrefix().Len() ) 1118 aSId = GetPseudoPrefix(); 1119 aSId += '_'; 1120 aSId += aValName.Copy( pEnum->GetPrefix().Len() ); 1121 1122 xEnumSlot = NULL; 1123 for( m=0; m<rBase.GetAttrList().Count(); m++ ) 1124 { 1125 SvMetaAttribute * pAttr = rBase.GetAttrList().GetObject( m ); 1126 if( pAttr->GetSlotId() == aSId ) 1127 { 1128 SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr ); 1129 xEnumSlot = pSlot->Clone(); 1130 break; 1131 } 1132 } 1133 1134 if ( m == rBase.GetAttrList().Count() ) 1135 { 1136 DBG_ERROR("Invalid EnumSlot!"); 1137 xEnumSlot = Clone(); 1138 sal_uLong nValue; 1139 if ( rBase.FindId(aSId , &nValue) ) 1140 { 1141 SvNumberIdentifier aId; 1142 *((SvIdentifier*)&aId) = aSId; 1143 aId.SetValue(nValue); 1144 xEnumSlot->SetSlotId(aId); 1145 } 1146 } 1147 1148 // Die Slaves sind kein Master ! 1149 xEnumSlot->aPseudoSlots = sal_False; 1150 xEnumSlot->SetEnumValue(enumValue); 1151 1152 if ( !pFirstEnumSlot || xEnumSlot->GetSlotId().GetValue() < pFirstEnumSlot->GetSlotId().GetValue() ) 1153 pFirstEnumSlot = xEnumSlot; 1154 1155 // Den erzeugten Slave ebenfalls einf"ugen 1156 xEnumSlot->Insert( rList, rPrefix, rBase); 1157 1158 // Die EnumSlots mit dem Master verketten 1159 xEnumSlot->pLinkedSlot = this; 1160 } 1161 1162 // Master zeigt auf den ersten Slave 1163 pLinkedSlot = pFirstEnumSlot; 1164 1165 // Slaves untereinander verketten 1166 rList.Seek((sal_uLong)0); 1167 xEnumSlot = pFirstEnumSlot; 1168 SvSlotElement *pEle; 1169 do 1170 { 1171 pEle = rList.Next(); 1172 if ( pEle && pEle->xSlot->pLinkedSlot == this ) 1173 { 1174 xEnumSlot->pNextSlot = pEle->xSlot; 1175 xEnumSlot = pEle->xSlot; 1176 } 1177 } 1178 while ( pEle ); 1179 xEnumSlot->pNextSlot = pFirstEnumSlot; 1180 } 1181 } 1182 1183 1184 /************************************************************************* 1185 |* SvMetaSlot::WriteSlotMap() 1186 |* 1187 |* Beschreibung 1188 *************************************************************************/ 1189 static ByteString MakeSlotName( SvStringHashEntry * pEntry ) 1190 { 1191 ByteString aName( "SFX_SLOT_" ); 1192 aName += pEntry->GetName(); 1193 return aName.ToUpperAscii(); 1194 }; 1195 1196 void SvMetaSlot::WriteSlotStubs( const ByteString & rShellName, 1197 ByteStringList & rList, 1198 SvStream & rOutStm ) 1199 { 1200 /* 1201 ByteString aName = GetName(); 1202 SvMetaAttribute * pAttr = rAttrList.First(); 1203 while( pAttr ) 1204 { 1205 if( pAttr->GetName() == aName ) 1206 break; 1207 pAttr = rAttrList.Next(); 1208 } 1209 if( pAttr ) 1210 return; 1211 */ 1212 if ( !GetExport() && !GetHidden() ) 1213 return; 1214 1215 ByteString aMethodName( GetExecMethod() ); 1216 if ( aMethodName.Len() && aMethodName != "NoExec" ) 1217 { 1218 sal_Bool bIn = sal_False; 1219 for( sal_uInt16 n = 0; n < rList.Count(); n++ ) 1220 { 1221 if( *(rList.GetObject(n)) == aMethodName ) 1222 { 1223 bIn=sal_True; 1224 break; 1225 } 1226 } 1227 1228 if ( !bIn ) 1229 { 1230 rList.Insert( new ByteString(aMethodName), LIST_APPEND ); 1231 rOutStm << "SFX_EXEC_STUB(" 1232 << rShellName.GetBuffer() 1233 << ',' 1234 << aMethodName.GetBuffer() 1235 << ')' << endl; 1236 } 1237 } 1238 1239 aMethodName = GetStateMethod(); 1240 if ( aMethodName.Len() && aMethodName != "NoState" ) 1241 { 1242 sal_Bool bIn = sal_False; 1243 for ( sal_uInt16 n=0; n < rList.Count(); n++ ) 1244 { 1245 if ( *(rList.GetObject(n)) == aMethodName ) 1246 { 1247 bIn=sal_True; 1248 break; 1249 } 1250 } 1251 1252 if ( !bIn ) 1253 { 1254 rList.Insert( new ByteString(aMethodName), LIST_APPEND ); 1255 rOutStm << "SFX_STATE_STUB(" 1256 << rShellName.GetBuffer() 1257 << ',' 1258 << aMethodName.GetBuffer() 1259 << ')' << endl; 1260 } 1261 } 1262 } 1263 1264 void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount, 1265 const ByteString & rSlotId, 1266 SvSlotElementList& rSlotList, 1267 const ByteString & rPrefix, 1268 SvIdlDataBase & rBase, SvStream & rOutStm ) 1269 { 1270 if ( !GetExport() && !GetHidden() ) 1271 return; 1272 1273 // sal_Bool bIsEnumSlot = 0 != rValueName.Len(); 1274 sal_Bool bIsEnumSlot = 0 != pEnumValue; 1275 1276 rOutStm << "// Slot Nr. " << ByteString::CreateFromInt32(nListPos).GetBuffer() << " : "; 1277 ByteString aSlotIdValue( ByteString::CreateFromInt32( GetSlotId().GetValue() ) ); 1278 rOutStm << aSlotIdValue.GetBuffer() << endl; 1279 WriteTab( rOutStm, 1 ); 1280 if( bIsEnumSlot ) 1281 rOutStm << "SFX_NEW_SLOT_ENUM( "; 1282 else 1283 rOutStm << "SFX_NEW_SLOT_ARG( " << rShellName.GetBuffer() << ',' ; 1284 1285 rOutStm << rSlotId.GetBuffer() << ','; 1286 const SvHelpContext& rHlpCtx = GetHelpContext(); 1287 if( rHlpCtx.IsSet() ) 1288 rOutStm << rHlpCtx.GetBuffer() << ','; 1289 else 1290 rOutStm << rSlotId.GetBuffer() << ','; 1291 1292 // GroupId 1293 if( GetGroupId().Len() ) 1294 rOutStm << GetGroupId().GetBuffer(); 1295 else 1296 rOutStm << '0'; 1297 rOutStm << ',' << endl; 1298 WriteTab( rOutStm, 4 ); 1299 1300 if( bIsEnumSlot ) 1301 { 1302 rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" 1303 << ByteString::CreateFromInt32(pLinkedSlot->GetListPos()).GetBuffer() 1304 << "] /*Offset Master*/, " << endl; 1305 WriteTab( rOutStm, 4 ); 1306 rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" 1307 << ByteString::CreateFromInt32(pNextSlot->GetListPos()).GetBuffer() 1308 << "] /*Offset Next*/, " << endl; 1309 1310 WriteTab( rOutStm, 4 ); 1311 1312 // SlotId 1313 if( GetSlotId().Len() ) 1314 rOutStm << pLinkedSlot->GetSlotId().GetBuffer(); 1315 else 1316 rOutStm << '0'; 1317 rOutStm << ','; 1318 rOutStm << pEnumValue->GetName().GetBuffer(); 1319 } 1320 else 1321 { 1322 // Den n"achsten Slot suchen, der die gleiche StateMethod hat wie ich 1323 // Die SlotList ist auf den aktuellen Slot geseekt 1324 SvSlotElement * pEle = rSlotList.Next(); 1325 pNextSlot = pEle ? &pEle->xSlot : NULL; 1326 while ( pNextSlot ) 1327 { 1328 if ( !pNextSlot->pNextSlot && 1329 pNextSlot->GetStateMethod() == GetStateMethod() ) 1330 break; 1331 pEle = rSlotList.Next(); 1332 pNextSlot = pEle ? &pEle->xSlot : NULL; 1333 } 1334 1335 if ( !pNextSlot ) 1336 { 1337 // Es gibt nach mir keinen Slot mehr, der die gleiche ExecMethode 1338 // hat. Also suche ich den ersten Slot, der diese hatte (das 1339 // k"onnte auch ich selbst sein) 1340 pEle = rSlotList.First(); 1341 pNextSlot = pEle ? &pEle->xSlot : NULL; 1342 while ( pNextSlot != this ) 1343 { 1344 if ( !pNextSlot->pEnumValue && 1345 pNextSlot->GetStateMethod() == GetStateMethod() ) 1346 break; 1347 pEle = rSlotList.Next(); 1348 pNextSlot = pEle ? &pEle->xSlot : NULL; 1349 } 1350 } 1351 1352 if ( !pLinkedSlot ) 1353 { 1354 rOutStm << "0 ,"; 1355 } 1356 else 1357 { 1358 rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" 1359 << ByteString::CreateFromInt32(pLinkedSlot->GetListPos()).GetBuffer() 1360 << "] /*Offset Linked*/, " << endl; 1361 WriteTab( rOutStm, 4 ); 1362 } 1363 1364 rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" 1365 << ByteString::CreateFromInt32(pNextSlot->GetListPos()).GetBuffer() 1366 << "] /*Offset Next*/, " << endl; 1367 1368 WriteTab( rOutStm, 4 ); 1369 1370 // ExecMethod schreiben, wenn nicht angegeben, standard Namen 1371 if( GetExecMethod().Len() && GetExecMethod() != "NoExec") 1372 rOutStm << "SFX_STUB_PTR(" << rShellName.GetBuffer() << ',' 1373 << GetExecMethod().GetBuffer() << ')'; 1374 else 1375 rOutStm << "SFX_STUB_PTR_EXEC_NONE"; 1376 rOutStm << ','; 1377 1378 // StateMethod schreiben, wenn nicht angegeben, standard Namen 1379 if( GetStateMethod().Len() && GetStateMethod() != "NoState") 1380 rOutStm << "SFX_STUB_PTR(" << rShellName.GetBuffer() << ',' 1381 << GetStateMethod().GetBuffer() << ')'; 1382 else 1383 rOutStm << "SFX_STUB_PTR_STATE_NONE"; 1384 } 1385 rOutStm << ',' << endl; 1386 WriteTab( rOutStm, 4 ); 1387 1388 // Flags schreiben 1389 if( GetHasCoreId() ) 1390 rOutStm << MakeSlotName( SvHash_HasCoreId() ).GetBuffer() << '|'; 1391 if( GetCachable() ) 1392 rOutStm << MakeSlotName( SvHash_Cachable() ).GetBuffer() << '|'; 1393 if( GetVolatile() ) 1394 rOutStm << MakeSlotName( SvHash_Volatile() ).GetBuffer() << '|'; 1395 if( GetToggle() ) 1396 rOutStm << MakeSlotName( SvHash_Toggle() ).GetBuffer() << '|'; 1397 if( GetAutoUpdate() ) 1398 rOutStm << MakeSlotName( SvHash_AutoUpdate() ).GetBuffer() << '|'; 1399 if( GetSynchron() ) 1400 rOutStm << MakeSlotName( SvHash_Synchron() ).GetBuffer() << '|'; 1401 if( GetAsynchron() ) 1402 rOutStm << MakeSlotName( SvHash_Asynchron() ).GetBuffer() << '|'; 1403 if( GetRecordPerItem() ) 1404 rOutStm << MakeSlotName( SvHash_RecordPerItem() ).GetBuffer() << '|'; 1405 if( GetRecordPerSet() ) 1406 rOutStm << MakeSlotName( SvHash_RecordPerSet() ).GetBuffer() << '|'; 1407 if( GetRecordManual() ) 1408 rOutStm << MakeSlotName( SvHash_RecordManual() ).GetBuffer() << '|'; 1409 if( GetNoRecord() ) 1410 rOutStm << MakeSlotName( SvHash_NoRecord() ).GetBuffer() << '|'; 1411 if( GetRecordAbsolute() ) 1412 rOutStm << MakeSlotName( SvHash_RecordAbsolute() ).GetBuffer() << '|'; 1413 if( GetHasDialog() ) 1414 rOutStm << MakeSlotName( SvHash_HasDialog() ).GetBuffer() << '|'; 1415 if( GetMenuConfig() ) 1416 rOutStm << MakeSlotName( SvHash_MenuConfig() ).GetBuffer() << '|'; 1417 if( GetToolBoxConfig() ) 1418 rOutStm << MakeSlotName( SvHash_ToolBoxConfig() ).GetBuffer() << '|'; 1419 if( GetStatusBarConfig() ) 1420 rOutStm << MakeSlotName( SvHash_StatusBarConfig() ).GetBuffer() << '|'; 1421 if( GetAccelConfig() ) 1422 rOutStm << MakeSlotName( SvHash_AccelConfig() ).GetBuffer() << '|'; 1423 if( GetFastCall() ) 1424 rOutStm << MakeSlotName( SvHash_FastCall() ).GetBuffer() << '|'; 1425 if( GetContainer() ) 1426 rOutStm << MakeSlotName( SvHash_Container() ).GetBuffer() << '|'; 1427 if ( GetReadOnlyDoc() ) 1428 rOutStm << MakeSlotName( SvHash_ReadOnlyDoc() ).GetBuffer() << '|'; 1429 if( GetImageRotation() ) 1430 rOutStm << MakeSlotName( SvHash_ImageRotation() ).GetBuffer() << '|'; 1431 if( GetImageReflection() ) 1432 rOutStm << MakeSlotName( SvHash_ImageReflection() ).GetBuffer() << '|'; 1433 rOutStm << '0'; 1434 1435 rOutStm << ',' << endl; 1436 WriteTab( rOutStm, 4 ); 1437 if ( !GetDisableFlags().Len() ) 1438 rOutStm << "0"; 1439 else 1440 rOutStm << GetDisableFlags().GetBuffer(); 1441 1442 // Attribut Typ schreiben 1443 if( !bIsEnumSlot ) 1444 { 1445 rOutStm << ',' << endl; 1446 WriteTab( rOutStm, 4 ); 1447 1448 SvMetaType * pT = GetSlotType(); 1449 if( !pT ) 1450 { 1451 if( !IsVariable() ) 1452 pT = rBase.FindType( "SfxVoidItem" ); 1453 else 1454 pT = GetType(); 1455 } 1456 if( pT ) 1457 { 1458 rOutStm << pT->GetName().GetBuffer(); 1459 if( !rBase.FindType( pT, rBase.aUsedTypes ) ) 1460 rBase.aUsedTypes.Append( pT ); 1461 } 1462 else 1463 rOutStm << "SfxVoidItem not defined"; 1464 } 1465 else 1466 { 1467 SvMetaType *pT = rBase.FindType( "SfxBoolItem" ); 1468 if ( pT && !rBase.FindType( pT, rBase.aUsedTypes ) ) 1469 rBase.aUsedTypes.Append( pT ); 1470 } 1471 1472 if( !bIsEnumSlot ) 1473 { 1474 rOutStm << ',' << endl; 1475 WriteTab( rOutStm, 4 ); 1476 rOutStm << ByteString::CreateFromInt32( nCount ).GetBuffer() << "/*Offset*/, "; 1477 1478 if( IsMethod() ) 1479 { 1480 SvMetaAttribute * pMethod = GetMethod(); 1481 SvMetaType * pType; 1482 if( pMethod ) 1483 pType = pMethod->GetType(); 1484 else 1485 pType = GetType(); 1486 sal_uLong nSCount = pType->GetAttrCount(); 1487 rOutStm << ByteString::CreateFromInt32( nSCount ).GetBuffer() << "/*Count*/"; 1488 } 1489 else 1490 rOutStm << '0'; 1491 1492 // Name f"urs Recording 1493 if ( GetExport() ) 1494 { 1495 rOutStm << ",\""; 1496 if( rPrefix.Len() ) 1497 rOutStm << rPrefix.GetBuffer(); 1498 rOutStm << '.'; 1499 if ( !IsVariable() || !GetType() || 1500 GetType()->GetBaseType()->GetType() != TYPE_STRUCT ) 1501 rOutStm << GetMangleName( sal_False ).GetBuffer(); 1502 rOutStm << "\","; 1503 } 1504 else 1505 rOutStm << ", 0, "; 1506 1507 // Method/Property Flags 1508 if( IsMethod() ) 1509 rOutStm << "SFX_SLOT_METHOD|"; 1510 if( IsVariable() ) 1511 { 1512 rOutStm << "SFX_SLOT_PROPGET|"; 1513 if( !GetReadonly() ) 1514 rOutStm << "SFX_SLOT_PROPSET|"; 1515 } 1516 1517 rOutStm << '0'; 1518 } 1519 1520 // if ( GetUnoName().Len() ) 1521 { 1522 rOutStm << ",\""; 1523 rOutStm << GetMangleName( sal_False ).GetBuffer(); 1524 //rOutStm << GetUnoName().GetBuffer(); 1525 rOutStm << "\""; 1526 } 1527 // else 1528 // rOutStm << ", 0"; 1529 1530 rOutStm << " )," << endl; 1531 } 1532 1533 sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm ) 1534 { 1535 if ( !GetExport() && !GetHidden() ) 1536 return 0; 1537 1538 SvMetaAttribute * pMethod = GetMethod(); 1539 if( IsMethod() ) 1540 { 1541 SvMetaType * pType; 1542 if( pMethod ) 1543 pType = pMethod->GetType(); 1544 else 1545 pType = GetType(); 1546 1547 if( !rBase.FindType( pType, rBase.aUsedTypes ) ) 1548 rBase.aUsedTypes.Append( pType ); 1549 1550 const SvMetaAttributeMemberList & rList = 1551 pType->GetAttrList(); 1552 for( sal_uLong n = 0; n < rList.Count(); n++ ) 1553 { 1554 SvMetaAttribute * pPar = rList.GetObject( n ); 1555 SvMetaType * pPType = pPar->GetType(); 1556 WriteTab( rOutStm, 1 ); 1557 rOutStm << "SFX_ARGUMENT(" 1558 << pPar->GetSlotId().GetBuffer() << ',' // SlodId 1559 // Parameter Name 1560 << "\"" << pPar->GetName().GetBuffer() << "\"," 1561 // Item Name 1562 << pPType->GetName().GetBuffer() << ")," << endl; 1563 if( !rBase.FindType( pPType, rBase.aUsedTypes ) ) 1564 rBase.aUsedTypes.Append( pPType ); 1565 } 1566 return (sal_uInt16)rList.Count(); 1567 } 1568 return 0; 1569 } 1570 1571 sal_uInt16 SvMetaSlot::WriteSlotMap( const ByteString & rShellName, sal_uInt16 nCount, 1572 SvSlotElementList& rSlotList, 1573 const ByteString & rPrefix, 1574 SvIdlDataBase & rBase, 1575 SvStream & rOutStm ) 1576 { 1577 // SlotId, wenn nicht angegeben, aus Namen generieren 1578 ByteString slotId = GetSlotId(); 1579 1580 sal_uInt16 nSCount = 0; 1581 if( IsMethod() ) 1582 { 1583 SvMetaType * pType; 1584 SvMetaAttribute * pMethod = GetMethod(); 1585 if( pMethod ) 1586 pType = pMethod->GetType(); 1587 else 1588 pType = GetType(); 1589 1590 nSCount = (sal_uInt16)pType->GetAttrCount(); 1591 } 1592 1593 WriteSlot( rShellName, nCount, slotId, rSlotList, rPrefix, rBase, rOutStm ); 1594 return nSCount; 1595 } 1596 1597 /************************************************************************* 1598 |* SvMetaSlot::WriteSrc() 1599 *************************************************************************/ 1600 void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm, 1601 Table * pTable ) 1602 { 1603 if (!GetToolBoxConfig() && !GetAccelConfig() && !GetMenuConfig() && !GetStatusBarConfig() ) 1604 return; 1605 1606 sal_uLong nSId = GetSlotId().GetValue(); 1607 if( !pTable->IsKeyValid( nSId ) ) 1608 { 1609 pTable->Insert( nSId, this ); 1610 rOutStm << "SfxSlotInfo " << ByteString::CreateFromInt32( nSId ).GetBuffer() 1611 << endl << '{' << endl; 1612 1613 WriteTab( rOutStm, 1 ); 1614 ByteString aStr = GetConfigName(); 1615 if( !aStr.Len() ) 1616 aStr = GetName(); 1617 1618 rOutStm << "SlotName = \"" << aStr.GetBuffer() << "\";" << endl; 1619 1620 aStr = GetHelpText(); 1621 if( aStr.Len() ) 1622 { 1623 WriteTab( rOutStm, 1 ); 1624 rOutStm << "HelpText = \"" << aStr.GetBuffer() << "\";" << endl; 1625 } 1626 1627 rOutStm << "};" << endl; 1628 } 1629 1630 SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() ); 1631 if( GetPseudoSlots() && pEnum ) 1632 { 1633 for( sal_uLong n = 0; n < pEnum->Count(); n++ ) 1634 { 1635 ByteString aValName = pEnum->GetObject( n )->GetName(); 1636 ByteString aSId( GetSlotId() ); 1637 if( GetPseudoPrefix().Len() ) 1638 aSId = GetPseudoPrefix(); 1639 aSId += '_'; 1640 aSId += aValName.Copy( pEnum->GetPrefix().Len() ); 1641 1642 sal_uLong nSId2; 1643 sal_Bool bIdOk = sal_False; 1644 if( rBase.FindId( aSId, &nSId2 ) ) 1645 { 1646 aSId = ByteString::CreateFromInt32( nSId2 ); 1647 bIdOk = sal_True; 1648 } 1649 1650 // wenn Id nicht gefunden, immer schreiben 1651 if( !bIdOk || !pTable->IsKeyValid( nSId2 ) ) 1652 { 1653 pTable->Insert( nSId2, this ); 1654 rOutStm << "SfxSlotInfo " << aSId.GetBuffer() 1655 << endl << '{' << endl; 1656 1657 WriteTab( rOutStm, 1 ); 1658 rOutStm << "SlotName = \"" << aValName.GetBuffer() << "\";" << endl; 1659 1660 ByteString aStr = GetHelpText(); 1661 if( aStr.Len() ) 1662 { 1663 WriteTab( rOutStm, 1 ); 1664 rOutStm << "HelpText = \"" << aStr.GetBuffer() << "\";" << endl; 1665 } 1666 rOutStm << "};" << endl; 1667 } 1668 } 1669 } 1670 } 1671 1672 void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm, 1673 Table * pTable ) 1674 { 1675 sal_uLong nSId = GetSlotId().GetValue(); 1676 if( !pTable->IsKeyValid( nSId ) ) 1677 { 1678 pTable->Insert( nSId, this ); 1679 rOutStm << "#define " << GetSlotId().GetBuffer() << '\t' << ByteString::CreateFromInt32( nSId ).GetBuffer() << endl; 1680 } 1681 1682 SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() ); 1683 if( GetPseudoSlots() && pEnum ) 1684 { 1685 for( sal_uLong n = 0; n < pEnum->Count(); n++ ) 1686 { 1687 ByteString aValName = pEnum->GetObject( n )->GetName(); 1688 ByteString aSId( GetSlotId() ); 1689 if( GetPseudoPrefix().Len() ) 1690 aSId = GetPseudoPrefix(); 1691 aSId += '_'; 1692 aSId += aValName.Copy( pEnum->GetPrefix().Len() ); 1693 1694 sal_uLong nSId2; 1695 sal_Bool bIdOk = sal_False; 1696 if( rBase.FindId( aSId, &nSId2 ) ) 1697 { 1698 aSId = ByteString::CreateFromInt32( nSId2 ); 1699 bIdOk = sal_True; 1700 } 1701 1702 // wenn Id nicht gefunden, immer schreiben 1703 if( !bIdOk || !pTable->IsKeyValid( nSId2 ) ) 1704 { 1705 pTable->Insert( nSId2, this ); 1706 1707 rOutStm << "#define " << aSId.GetBuffer() << '\t' 1708 << ByteString::CreateFromInt32( nSId2 ).GetBuffer() << endl; 1709 } 1710 } 1711 } 1712 } 1713 1714 void WriteBool( sal_Bool bSet, SvStream& rStream ) 1715 { 1716 if ( bSet ) 1717 rStream << "sal_True" << ','; 1718 else 1719 rStream << "sal_False" << ','; 1720 } 1721 1722 void SvMetaSlot::WriteCSV( SvIdlDataBase& rBase, SvStream& rStrm ) 1723 { 1724 rStrm << "PROJECT,"; 1725 rStrm << GetSlotId().GetBuffer() << ','; 1726 rStrm << ByteString::CreateFromInt32( GetSlotId().GetValue() ).GetBuffer() << ','; 1727 1728 if ( GetPseudoPrefix().Len() ) 1729 rStrm << GetPseudoPrefix().GetBuffer() << ','; 1730 else 1731 rStrm << ','; 1732 1733 rStrm << GetGroupId().GetBuffer() << ','; 1734 1735 WriteBool( GetAccelConfig(), rStrm ); 1736 WriteBool( GetMenuConfig(), rStrm ); 1737 WriteBool( GetStatusBarConfig(), rStrm ); 1738 WriteBool( GetToolBoxConfig(), rStrm ); 1739 1740 if ( GetSlotType() ) 1741 rStrm << GetSlotType()->GetName().GetBuffer() << ','; 1742 else 1743 rStrm << ','; 1744 1745 WriteBool( GetAutoUpdate(), rStrm ); 1746 if ( GetCachable() ) 1747 rStrm << "Cachable" << ','; 1748 else 1749 rStrm << "Volatile" << ','; 1750 1751 WriteBool( GetContainer(), rStrm ); 1752 WriteBool( GetFastCall(), rStrm ); 1753 WriteBool( GetHasCoreId(), rStrm ); 1754 WriteBool( GetHasDialog(), rStrm ); 1755 WriteBool( GetReadOnlyDoc(), rStrm ); 1756 WriteBool( GetImageRotation(), rStrm ); 1757 WriteBool( GetImageReflection(), rStrm ); 1758 rStrm << GetDisableFlags().GetBuffer() << ','; 1759 1760 if( GetSynchron() ) 1761 rStrm << "Synchron" << ','; 1762 else 1763 rStrm << "Asynchron" << ','; 1764 1765 WriteBool( GetToggle(), rStrm ); 1766 WriteBool( GetReadonly(), rStrm ); 1767 WriteBool( GetExport(), rStrm ); 1768 if( GetRecordPerItem() ) 1769 rStrm << "RecordPerItem" << ','; 1770 else if ( GetNoRecord() ) 1771 rStrm << "NoRecord" << ','; 1772 else if ( GetRecordManual() ) 1773 rStrm << "RecordManual" << ','; 1774 else 1775 rStrm << "RecordPerSet" << ','; 1776 1777 WriteBool( GetRecordAbsolute(), rStrm ); 1778 1779 if ( GetType()->GetType() != TYPE_METHOD && GetMethod() ) 1780 { 1781 rStrm << GetMethod()->GetType()->GetReturnType()->GetName().GetBuffer() << ','; 1782 rStrm << GetMethod()->GetName().GetBuffer() << ','; 1783 } 1784 else 1785 { 1786 rStrm << ",,"; 1787 } 1788 1789 rStrm << GetType()->GetSvName().GetBuffer() << ','; 1790 rStrm << GetName().GetBuffer() << ','; 1791 1792 if ( GetType()->GetType() == TYPE_METHOD || GetMethod() ) 1793 { 1794 SvMetaAttributeMemberList *pList = &GetType()->GetAttrList(); 1795 if ( GetMethod() ) 1796 pList = &GetMethod()->GetType()->GetAttrList(); 1797 1798 if( pList && pList->Count() ) 1799 { 1800 rStrm << "\"("; 1801 SvMetaAttribute* pAttr = pList->First(); 1802 while( pAttr ) 1803 { 1804 pAttr->WriteCSV( rBase, rStrm ); 1805 pAttr = pList->Next(); 1806 if( pAttr ) 1807 rStrm << ','; 1808 } 1809 rStrm << ")\""; 1810 } 1811 else 1812 rStrm << "()"; 1813 } 1814 1815 rStrm << endl; 1816 } 1817 1818 #endif // IDL_COMPILER 1819 1820 1821