Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 :
21 : #include <ctype.h>
22 : #include <stdio.h>
23 : #include <rtl/strbuf.hxx>
24 : #include <tools/debug.hxx>
25 : #include <slot.hxx>
26 : #include <globals.hxx>
27 : #include <database.hxx>
28 :
29 0 : SV_IMPL_META_FACTORY1( SvMetaSlot, SvMetaAttribute );
30 :
31 0 : SvMetaObject *SvMetaSlot::MakeClone() const
32 : {
33 0 : return new SvMetaSlot( *this );
34 : }
35 :
36 0 : SvMetaSlot::SvMetaSlot()
37 : : aCachable( sal_True, sal_False )
38 : , aSynchron( sal_True, sal_False )
39 : , aRecordPerSet( sal_True, sal_False )
40 : , aRecordAbsolute( sal_False, sal_False )
41 : , pLinkedSlot(0)
42 : , pNextSlot(0)
43 0 : , pEnumValue(0)
44 : {
45 0 : }
46 :
47 0 : SvMetaSlot::SvMetaSlot( SvMetaType * pType )
48 : : SvMetaAttribute( pType )
49 : , aCachable( sal_True, sal_False )
50 : , aSynchron( sal_True, sal_False )
51 : , aRecordPerSet( sal_True, sal_False )
52 : , aRecordAbsolute( sal_False, sal_False )
53 : , pLinkedSlot(0)
54 : , pNextSlot(0)
55 0 : , pEnumValue(0)
56 : {
57 0 : }
58 :
59 : #define TEST_READ
60 : #define TEST_WRITE
61 :
62 0 : void SvMetaSlot::Load( SvPersistStream & rStm )
63 : {
64 0 : SvMetaAttribute::Load( rStm );
65 :
66 : sal_uInt16 nMask;
67 0 : rStm >> nMask;
68 :
69 : TEST_READ
70 0 : if( nMask & 0x0001 )
71 : {
72 : SvMetaAttribute * pMeth;
73 0 : rStm >> pMeth;
74 0 : aMethod = pMeth;
75 : }
76 :
77 : TEST_READ
78 0 : if( nMask & 0x0002 ) rStm >> aGroupId;
79 : TEST_READ
80 0 : if( nMask & 0x0004 ) rStm >> aHasCoreId;
81 : TEST_READ
82 0 : if( nMask & 0x0008 ) rStm >> aConfigId;
83 : TEST_READ
84 0 : if( nMask & 0x0010 ) rStm >> aExecMethod;
85 : TEST_READ
86 0 : if( nMask & 0x0020 ) rStm >> aStateMethod;
87 : TEST_READ
88 0 : if( nMask & 0x0040 ) rStm >> aDefault;
89 : TEST_READ
90 0 : if( nMask & 0x0080 ) rStm >> aPseudoSlots;
91 : TEST_READ
92 0 : if( nMask & 0x0100 ) rStm >> aGet;
93 : TEST_READ
94 0 : if( nMask & 0x0200 ) rStm >> aSet;
95 : TEST_READ
96 0 : if( nMask & 0x0400 ) rStm >> aCachable;
97 : TEST_READ
98 0 : if( nMask & 0x0800 ) rStm >> aVolatile;
99 : TEST_READ
100 0 : if( nMask & 0x1000 ) rStm >> aToggle;
101 : TEST_READ
102 0 : if( nMask & 0x2000 ) rStm >> aAutoUpdate;
103 : TEST_READ
104 0 : if( nMask & 0x4000 ) rStm >> aSynchron;
105 : TEST_READ
106 0 : if( nMask & 0x8000 ) rStm >> aAsynchron;
107 :
108 0 : nMask = 0;
109 0 : rStm >> nMask;
110 :
111 : TEST_READ
112 0 : if( nMask & 0x0001 ) rStm >> aRecordPerItem;
113 : TEST_READ
114 0 : if( nMask & 0x0002 ) rStm >> aRecordManual;
115 : TEST_READ
116 0 : if( nMask & 0x0004 ) rStm >> aNoRecord;
117 : TEST_READ
118 0 : if( nMask & 0x0008 ) rStm >> aHasDialog;
119 : TEST_READ
120 0 : if( nMask & 0x0010 ) rStm >> aDisableFlags;
121 : TEST_READ
122 0 : if( nMask & 0x0020 ) rStm >> aPseudoPrefix;
123 : TEST_READ
124 0 : if( nMask & 0x0040 ) rStm >> aRecordPerSet;
125 : TEST_READ
126 0 : if( nMask & 0x0080 ) rStm >> aMenuConfig;
127 : TEST_READ
128 0 : if( nMask & 0x0100 ) rStm >> aToolBoxConfig;
129 : TEST_READ
130 0 : if( nMask & 0x0200 ) rStm >> aStatusBarConfig;
131 : TEST_READ
132 0 : if( nMask & 0x0400 ) rStm >> aAccelConfig;
133 : TEST_READ
134 0 : if( nMask & 0x0800 ) rStm >> aFastCall;
135 : TEST_READ
136 0 : if( nMask & 0x1000 ) rStm >> aContainer;
137 : TEST_READ
138 :
139 0 : if( nMask & 0x2000 )
140 : {
141 : SvMetaType * pT;
142 0 : rStm >> pT;
143 0 : aSlotType = pT;
144 : }
145 :
146 : TEST_READ
147 0 : if( nMask & 0x4000 ) rStm >> aRecordAbsolute;
148 : TEST_READ
149 0 : if( nMask & 0x8000 ) rStm >> aImageRotation;
150 :
151 0 : nMask = 0;
152 0 : rStm >> nMask;
153 :
154 : TEST_READ
155 0 : if( nMask & 0x0001 ) rStm >> aUnoName;
156 0 : if( nMask & 0x0002 ) rStm >> aImageReflection;
157 0 : }
158 :
159 0 : void SvMetaSlot::Save( SvPersistStream & rStm )
160 : {
161 0 : SvMetaAttribute::Save( rStm );
162 :
163 : // create mask
164 0 : sal_uInt16 nMask = 0;
165 0 : if( aMethod.Is() ) nMask |= 0x0001;
166 0 : if( !aGroupId.getString().isEmpty() ) nMask |= 0x0002;
167 0 : if( aHasCoreId.IsSet() ) nMask |= 0x0004;
168 0 : if( !aConfigId.getString().isEmpty() ) nMask |= 0x0008;
169 0 : if( !aExecMethod.getString().isEmpty() ) nMask |= 0x0010;
170 0 : if( !aStateMethod.getString().isEmpty() ) nMask |= 0x0020;
171 0 : if( !aDefault.getString().isEmpty() ) nMask |= 0x0040;
172 0 : if( aPseudoSlots.IsSet() ) nMask |= 0x0080;
173 0 : if( aGet.IsSet() ) nMask |= 0x0100;
174 0 : if( aSet.IsSet() ) nMask |= 0x0200;
175 0 : if( aCachable.IsSet() ) nMask |= 0x0400;
176 0 : if( aVolatile.IsSet() ) nMask |= 0x0800;
177 0 : if( aToggle.IsSet() ) nMask |= 0x1000;
178 0 : if( aAutoUpdate.IsSet() ) nMask |= 0x2000;
179 0 : if( aSynchron.IsSet() ) nMask |= 0x4000;
180 0 : if( aAsynchron.IsSet() ) nMask |= 0x8000;
181 :
182 : // write data
183 0 : rStm << nMask;
184 : TEST_WRITE
185 0 : if( nMask & 0x0001 ) rStm << aMethod;
186 : TEST_WRITE
187 0 : if( nMask & 0x0002 ) rStm << aGroupId;
188 : TEST_WRITE
189 0 : if( nMask & 0x0004 ) rStm << aHasCoreId;
190 : TEST_WRITE
191 0 : if( nMask & 0x0008 ) rStm << aConfigId;
192 : TEST_WRITE
193 0 : if( nMask & 0x0010 ) rStm << aExecMethod;
194 : TEST_WRITE
195 0 : if( nMask & 0x0020 ) rStm << aStateMethod;
196 : TEST_WRITE
197 0 : if( nMask & 0x0040 ) rStm << aDefault;
198 : TEST_WRITE
199 0 : if( nMask & 0x0080 ) rStm << aPseudoSlots;
200 : TEST_WRITE
201 0 : if( nMask & 0x0100 ) rStm << aGet;
202 : TEST_WRITE
203 0 : if( nMask & 0x0200 ) rStm << aSet;
204 : TEST_WRITE
205 0 : if( nMask & 0x0400 ) rStm << aCachable;
206 : TEST_WRITE
207 0 : if( nMask & 0x0800 ) rStm << aVolatile;
208 : TEST_WRITE
209 0 : if( nMask & 0x1000 ) rStm << aToggle;
210 : TEST_WRITE
211 0 : if( nMask & 0x2000 ) rStm << aAutoUpdate;
212 : TEST_WRITE
213 0 : if( nMask & 0x4000 ) rStm << aSynchron;
214 : TEST_WRITE
215 0 : if( nMask & 0x8000 ) rStm << aAsynchron;
216 :
217 : // write next bunch
218 : // create mask
219 0 : nMask = 0;
220 0 : if( aRecordPerItem.IsSet() ) nMask |= 0x0001;
221 0 : if( aRecordManual.IsSet() ) nMask |= 0x0002;
222 0 : if( aNoRecord.IsSet() ) nMask |= 0x0004;
223 0 : if( aHasDialog.IsSet() ) nMask |= 0x0008;
224 0 : if ( aDisableFlags.IsSet() ) nMask |= 0x0010;
225 0 : if( !aPseudoPrefix.getString().isEmpty() ) nMask |= 0x0020;
226 0 : if( aRecordPerSet.IsSet() ) nMask |= 0x0040;
227 0 : if( aMenuConfig.IsSet() ) nMask |= 0x0080;
228 0 : if( aToolBoxConfig.IsSet() ) nMask |= 0x0100;
229 0 : if( aStatusBarConfig.IsSet() )nMask |= 0x0200;
230 0 : if( aAccelConfig.IsSet() ) nMask |= 0x0400;
231 0 : if( aFastCall.IsSet() ) nMask |= 0x0800;
232 0 : if( aContainer.IsSet() ) nMask |= 0x1000;
233 0 : if( aSlotType.Is() ) nMask |= 0x2000;
234 0 : if( aRecordAbsolute.IsSet() ) nMask |= 0x4000;
235 0 : if( aImageRotation.IsSet() ) nMask |= 0x8000;
236 :
237 : // write data
238 0 : rStm << nMask;
239 : TEST_WRITE
240 0 : if( nMask & 0x0001 ) rStm << aRecordPerItem;
241 : TEST_WRITE
242 0 : if( nMask & 0x0002 ) rStm << aRecordManual;
243 : TEST_WRITE
244 0 : if( nMask & 0x0004 ) rStm << aNoRecord;
245 : TEST_WRITE
246 0 : if( nMask & 0x0008 ) rStm << aHasDialog;
247 : TEST_WRITE
248 0 : if( nMask & 0x0010 ) rStm << aDisableFlags;
249 : TEST_WRITE
250 0 : if( nMask & 0x0020 ) rStm << aPseudoPrefix;
251 : TEST_WRITE
252 0 : if( nMask & 0x0040 ) rStm << aRecordPerSet;
253 : TEST_WRITE
254 0 : if( nMask & 0x0080 ) rStm << aMenuConfig;
255 : TEST_WRITE
256 0 : if( nMask & 0x0100 ) rStm << aToolBoxConfig;
257 : TEST_WRITE
258 0 : if( nMask & 0x0200 ) rStm << aStatusBarConfig;
259 : TEST_WRITE
260 0 : if( nMask & 0x0400 ) rStm << aAccelConfig;
261 : TEST_WRITE
262 0 : if( nMask & 0x0800 ) rStm << aFastCall;
263 : TEST_WRITE
264 0 : if( nMask & 0x1000 ) rStm << aContainer;
265 : TEST_WRITE
266 0 : if( nMask & 0x2000 ) rStm << aSlotType;
267 : TEST_WRITE
268 0 : if( nMask & 0x4000 ) rStm << aRecordAbsolute;
269 : TEST_WRITE
270 0 : if( nMask & 0x8000 ) rStm << aImageRotation;
271 :
272 0 : nMask = 0;
273 0 : if( aUnoName.IsSet() ) nMask |= 0x0001;
274 0 : if( aImageReflection.IsSet() ) nMask |= 0x0002;
275 0 : rStm << nMask;
276 : TEST_WRITE
277 0 : if( nMask & 0x0001 ) rStm << aUnoName;
278 : TEST_WRITE
279 0 : if( nMask & 0x0002 ) rStm << aImageReflection;
280 0 : }
281 :
282 0 : sal_Bool SvMetaSlot::IsVariable() const
283 : {
284 0 : return SvMetaAttribute::IsVariable();
285 : }
286 :
287 0 : sal_Bool SvMetaSlot::IsMethod() const
288 : {
289 0 : sal_Bool b = SvMetaAttribute::IsMethod();
290 0 : b |= NULL != GetMethod();
291 0 : return b;
292 : }
293 :
294 0 : rtl::OString SvMetaSlot::GetMangleName( sal_Bool bVariable ) const
295 : {
296 0 : if( !bVariable )
297 : {
298 0 : SvMetaAttribute * pMeth = GetMethod();
299 0 : if( pMeth )
300 0 : return pMeth->GetName().getString();
301 : }
302 0 : return GetName().getString();
303 : }
304 :
305 : /*************************************************************************
306 : |* reference
307 : |*
308 : |* description Second FALSE in the SvBOOL-Objects means
309 : |* IsSet() provides FALSE (default initialization).
310 : *************************************************************************/
311 : /** reference disbandment **/
312 0 : SvMetaType * SvMetaSlot::GetSlotType() const
313 : {
314 0 : if( aSlotType.Is() || !GetRef() ) return aSlotType;
315 0 : return ((SvMetaSlot *)GetRef())->GetSlotType();
316 : }
317 0 : SvMetaAttribute * SvMetaSlot::GetMethod() const
318 : {
319 0 : if( aMethod.Is() || !GetRef() ) return aMethod;
320 0 : return ((SvMetaSlot *)GetRef())->GetMethod();
321 : }
322 0 : sal_Bool SvMetaSlot::GetHasCoreId() const
323 : {
324 0 : if( aHasCoreId.IsSet() || !GetRef() ) return aHasCoreId;
325 0 : return ((SvMetaSlot *)GetRef())->GetHasCoreId();
326 : }
327 0 : const rtl::OString& SvMetaSlot::GetGroupId() const
328 : {
329 0 : if( !aGroupId.getString().isEmpty() || !GetRef() ) return aGroupId.getString();
330 0 : return ((SvMetaSlot *)GetRef())->GetGroupId();
331 : }
332 0 : const rtl::OString& SvMetaSlot::GetDisableFlags() const
333 : {
334 0 : if( !aDisableFlags.getString().isEmpty() || !GetRef() ) return aDisableFlags.getString();
335 0 : return ((SvMetaSlot *)GetRef())->GetDisableFlags();
336 : }
337 0 : const rtl::OString& SvMetaSlot::GetConfigId() const
338 : {
339 0 : if( !aConfigId.getString().isEmpty() || !GetRef() ) return aConfigId.getString();
340 0 : return ((SvMetaSlot *)GetRef())->GetConfigId();
341 : }
342 0 : const rtl::OString& SvMetaSlot::GetExecMethod() const
343 : {
344 0 : if( !aExecMethod.getString().isEmpty() || !GetRef() ) return aExecMethod.getString();
345 0 : return ((SvMetaSlot *)GetRef())->GetExecMethod();
346 : }
347 0 : const rtl::OString& SvMetaSlot::GetStateMethod() const
348 : {
349 0 : if( !aStateMethod.getString().isEmpty() || !GetRef() ) return aStateMethod.getString();
350 0 : return ((SvMetaSlot *)GetRef())->GetStateMethod();
351 : }
352 0 : const rtl::OString& SvMetaSlot::GetDefault() const
353 : {
354 0 : if( !aDefault.getString().isEmpty() || !GetRef() ) return aDefault.getString();
355 0 : return ((SvMetaSlot *)GetRef())->GetDefault();
356 : }
357 0 : sal_Bool SvMetaSlot::GetPseudoSlots() const
358 : {
359 0 : if( aPseudoSlots.IsSet() || !GetRef() ) return aPseudoSlots;
360 0 : return ((SvMetaSlot *)GetRef())->GetPseudoSlots();
361 : }
362 0 : sal_Bool SvMetaSlot::GetCachable() const
363 : {
364 : // Cachable and Volatile are exclusive
365 0 : if( !GetRef() || aCachable.IsSet() || aVolatile.IsSet() )
366 0 : return aCachable;
367 0 : return ((SvMetaSlot *)GetRef())->GetCachable();
368 : }
369 0 : sal_Bool SvMetaSlot::GetVolatile() const
370 : {
371 : // Cachable and Volatile are exclusive
372 0 : if( !GetRef() || aVolatile.IsSet() || aCachable.IsSet() )
373 0 : return aVolatile;
374 0 : return ((SvMetaSlot *)GetRef())->GetVolatile();
375 : }
376 0 : sal_Bool SvMetaSlot::GetToggle() const
377 : {
378 0 : if( aToggle.IsSet() || !GetRef() ) return aToggle;
379 0 : return ((SvMetaSlot *)GetRef())->GetToggle();
380 : }
381 0 : sal_Bool SvMetaSlot::GetAutoUpdate() const
382 : {
383 0 : if( aAutoUpdate.IsSet() || !GetRef() ) return aAutoUpdate;
384 0 : return ((SvMetaSlot *)GetRef())->GetAutoUpdate();
385 : }
386 0 : sal_Bool SvMetaSlot::GetSynchron() const
387 : {
388 : // Synchron and Asynchron are exclusive
389 0 : if( !GetRef() || aSynchron.IsSet() || aAsynchron.IsSet() )
390 0 : return aSynchron;
391 0 : return ((SvMetaSlot *)GetRef())->GetSynchron();
392 : }
393 0 : sal_Bool SvMetaSlot::GetAsynchron() const
394 : {
395 : // Synchron and Asynchron are exclusive
396 0 : if( !GetRef() || aAsynchron.IsSet() || aSynchron.IsSet() )
397 0 : return aAsynchron;
398 0 : return ((SvMetaSlot *)GetRef())->GetAsynchron();
399 : }
400 0 : sal_Bool SvMetaSlot::GetRecordPerItem() const
401 : {
402 : // Record- PerItem, No, PerSet and Manual are exclusive
403 0 : if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
404 0 : || aRecordPerSet.IsSet() || aRecordManual.IsSet() )
405 0 : return aRecordPerItem;
406 0 : return ((SvMetaSlot *)GetRef())->GetRecordPerItem();
407 : }
408 0 : sal_Bool SvMetaSlot::GetRecordPerSet() const
409 : {
410 : // Record- PerItem, No, PerSet and Manual are exclusive
411 0 : if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
412 0 : || aRecordPerSet.IsSet() || aRecordManual.IsSet() )
413 0 : return aRecordPerSet;
414 0 : return ((SvMetaSlot *)GetRef())->GetRecordPerSet();
415 : }
416 0 : sal_Bool SvMetaSlot::GetRecordManual() const
417 : {
418 : // Record- PerItem, No, PerSet and Manual are exclusive
419 0 : if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
420 0 : || aRecordPerSet.IsSet() || aRecordManual.IsSet() )
421 0 : return aRecordManual;
422 0 : return ((SvMetaSlot *)GetRef())->GetRecordManual();
423 : }
424 0 : sal_Bool SvMetaSlot::GetNoRecord() const
425 : {
426 : // Record- PerItem, No, PerSet and Manual are exclusive
427 0 : if( !GetRef() || aRecordPerItem.IsSet() || aNoRecord.IsSet()
428 0 : || aRecordPerSet.IsSet() || aRecordManual.IsSet() )
429 0 : return aNoRecord;
430 0 : return ((SvMetaSlot *)GetRef())->GetNoRecord();
431 : }
432 0 : sal_Bool SvMetaSlot::GetRecordAbsolute() const
433 : {
434 0 : if( !GetRef() || aRecordAbsolute.IsSet() )
435 0 : return aRecordAbsolute;
436 0 : return ((SvMetaSlot *)GetRef())->GetRecordAbsolute();
437 : }
438 0 : sal_Bool SvMetaSlot::GetHasDialog() const
439 : {
440 0 : if( aHasDialog.IsSet() || !GetRef() ) return aHasDialog;
441 0 : return ((SvMetaSlot *)GetRef())->GetHasDialog();
442 : }
443 0 : const rtl::OString& SvMetaSlot::GetPseudoPrefix() const
444 : {
445 0 : if( !aPseudoPrefix.getString().isEmpty() || !GetRef() ) return aPseudoPrefix.getString();
446 0 : return ((SvMetaSlot *)GetRef())->GetPseudoPrefix();
447 : }
448 0 : sal_Bool SvMetaSlot::GetMenuConfig() const
449 : {
450 0 : if( aMenuConfig.IsSet() || !GetRef() ) return aMenuConfig;
451 0 : return ((SvMetaSlot *)GetRef())->GetMenuConfig();
452 : }
453 0 : sal_Bool SvMetaSlot::GetToolBoxConfig() const
454 : {
455 0 : if( aToolBoxConfig.IsSet() || !GetRef() ) return aToolBoxConfig;
456 0 : return ((SvMetaSlot *)GetRef())->GetToolBoxConfig();
457 : }
458 0 : sal_Bool SvMetaSlot::GetStatusBarConfig() const
459 : {
460 0 : if( aStatusBarConfig.IsSet() || !GetRef() ) return aStatusBarConfig;
461 0 : return ((SvMetaSlot *)GetRef())->GetStatusBarConfig();
462 : }
463 0 : sal_Bool SvMetaSlot::GetAccelConfig() const
464 : {
465 0 : if( aAccelConfig.IsSet() || !GetRef() ) return aAccelConfig;
466 0 : return ((SvMetaSlot *)GetRef())->GetAccelConfig();
467 : }
468 0 : sal_Bool SvMetaSlot::GetFastCall() const
469 : {
470 0 : if( aFastCall.IsSet() || !GetRef() ) return aFastCall;
471 0 : return ((SvMetaSlot *)GetRef())->GetFastCall();
472 : }
473 0 : sal_Bool SvMetaSlot::GetContainer() const
474 : {
475 0 : if( aContainer.IsSet() || !GetRef() ) return aContainer;
476 0 : return ((SvMetaSlot *)GetRef())->GetContainer();
477 : }
478 :
479 0 : sal_Bool SvMetaSlot::GetImageRotation() const
480 : {
481 0 : if( aImageRotation.IsSet() || !GetRef() ) return aImageRotation;
482 0 : return ((SvMetaSlot *)GetRef())->GetImageRotation();
483 : }
484 :
485 0 : sal_Bool SvMetaSlot::GetImageReflection() const
486 : {
487 0 : if( aImageReflection.IsSet() || !GetRef() ) return aImageReflection;
488 0 : return ((SvMetaSlot *)GetRef())->GetImageReflection();
489 : }
490 :
491 0 : const rtl::OString& SvMetaSlot::GetUnoName() const
492 : {
493 0 : if( aUnoName.IsSet() || !GetRef() ) return aUnoName.getString();
494 0 : return ((SvMetaSlot *)GetRef())->GetUnoName();
495 : }
496 :
497 0 : void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
498 : SvTokenStream & rInStm )
499 : {
500 0 : SvMetaAttribute::ReadAttributesSvIdl( rBase, rInStm );
501 :
502 0 : sal_Bool bOk = sal_False;
503 0 : bOk |= aDefault.ReadSvIdl( SvHash_Default(), rInStm );
504 0 : bOk |= aPseudoSlots.ReadSvIdl( SvHash_PseudoSlots(), rInStm );
505 0 : bOk |= aHasCoreId.ReadSvIdl( SvHash_HasCoreId(), rInStm );
506 0 : bOk |= aGroupId.ReadSvIdl( SvHash_GroupId(), rInStm );
507 0 : bOk |= aExecMethod.ReadSvIdl( SvHash_ExecMethod(), rInStm );
508 0 : bOk |= aStateMethod.ReadSvIdl( SvHash_StateMethod(), rInStm );
509 0 : bOk |= aDisableFlags.ReadSvIdl( SvHash_DisableFlags(), rInStm );
510 0 : if( aGet.ReadSvIdl( SvHash_Get(), rInStm ) )
511 : {
512 0 : rBase.WriteError( "warning", rtl::OUStringToOString(rInStm.GetFileName(), RTL_TEXTENCODING_UTF8),
513 : "<Get> old style, use Readonly",
514 : rInStm.GetToken()->GetLine(),
515 0 : rInStm.GetToken()->GetColumn() );
516 : }
517 0 : if( aSet.ReadSvIdl( SvHash_Set(), rInStm ) )
518 : {
519 0 : rBase.WriteError( "warning", rtl::OUStringToOString(rInStm.GetFileName(), RTL_TEXTENCODING_UTF8),
520 : "<Set> old style, use method declaration",
521 : rInStm.GetToken()->GetLine(),
522 0 : rInStm.GetToken()->GetColumn() );
523 : }
524 :
525 0 : if( aCachable.ReadSvIdl( SvHash_Cachable(), rInStm ) )
526 0 : SetCachable( aCachable ), bOk = sal_True;
527 0 : if( aVolatile.ReadSvIdl( SvHash_Volatile(), rInStm ) )
528 0 : SetVolatile( aVolatile ), bOk = sal_True;
529 0 : if( aToggle.ReadSvIdl( SvHash_Toggle(), rInStm ) )
530 0 : SetToggle( aToggle ), bOk = sal_True;
531 0 : if( aAutoUpdate.ReadSvIdl( SvHash_AutoUpdate(), rInStm ) )
532 0 : SetAutoUpdate( aAutoUpdate ), bOk = sal_True;
533 :
534 0 : if( aSynchron.ReadSvIdl( SvHash_Synchron(), rInStm ) )
535 0 : SetSynchron( aSynchron ), bOk = sal_True;
536 0 : if( aAsynchron.ReadSvIdl( SvHash_Asynchron(), rInStm ) )
537 0 : SetAsynchron( aAsynchron ), bOk = sal_True;
538 :
539 0 : if( aRecordAbsolute.ReadSvIdl( SvHash_RecordAbsolute(), rInStm ) )
540 0 : SetRecordAbsolute( aRecordAbsolute), bOk = sal_True;
541 0 : if( aRecordPerItem.ReadSvIdl( SvHash_RecordPerItem(), rInStm ) )
542 0 : SetRecordPerItem( aRecordPerItem ), bOk = sal_True;
543 0 : if( aRecordPerSet.ReadSvIdl( SvHash_RecordPerSet(), rInStm ) )
544 0 : SetRecordPerSet( aRecordPerSet ), bOk = sal_True;
545 0 : if( aRecordManual.ReadSvIdl( SvHash_RecordManual(), rInStm ) )
546 0 : SetRecordManual( aRecordManual ), bOk = sal_True;
547 0 : if( aNoRecord.ReadSvIdl( SvHash_NoRecord(), rInStm ) )
548 0 : SetNoRecord( aNoRecord ), bOk = sal_True;
549 :
550 0 : bOk |= aHasDialog.ReadSvIdl( SvHash_HasDialog(), rInStm );
551 0 : bOk |= aPseudoPrefix.ReadSvIdl( SvHash_PseudoPrefix(), rInStm );
552 0 : bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm );
553 0 : bOk |= aToolBoxConfig.ReadSvIdl( SvHash_ToolBoxConfig(), rInStm );
554 0 : bOk |= aStatusBarConfig.ReadSvIdl( SvHash_StatusBarConfig(), rInStm );
555 0 : bOk |= aAccelConfig.ReadSvIdl( SvHash_AccelConfig(), rInStm );
556 :
557 0 : SvBOOL aAllConfig;
558 0 : if( aAllConfig.ReadSvIdl( SvHash_AllConfig(), rInStm ) )
559 0 : SetAllConfig( aAllConfig ), bOk = sal_True;
560 0 : bOk |= aFastCall.ReadSvIdl( SvHash_FastCall(), rInStm );
561 0 : bOk |= aContainer.ReadSvIdl( SvHash_Container(), rInStm );
562 0 : bOk |= aImageRotation.ReadSvIdl( SvHash_ImageRotation(), rInStm );
563 0 : bOk |= aImageReflection.ReadSvIdl( SvHash_ImageReflection(), rInStm );
564 0 : bOk |= aUnoName.ReadSvIdl( SvHash_UnoName(), rInStm );
565 :
566 0 : if( !bOk )
567 : {
568 0 : if( !aSlotType.Is() )
569 : {
570 0 : sal_uInt32 nTokPos = rInStm.Tell();
571 0 : SvToken * pTok = rInStm.GetToken_Next();
572 0 : if( pTok->Is( SvHash_SlotType() ) )
573 : {
574 0 : sal_Bool bBraket = rInStm.Read( '(' );
575 0 : if( bBraket || rInStm.Read( '=' ) )
576 : {
577 0 : aSlotType = rBase.ReadKnownType( rInStm );
578 0 : if( aSlotType.Is() )
579 : {
580 0 : if( aSlotType->IsItem() )
581 : {
582 0 : if( bBraket )
583 : {
584 0 : if( rInStm.Read( ')' ) )
585 : return;
586 : }
587 : else
588 : return;
589 : }
590 0 : rBase.SetError( "the SlotType is not a item", rInStm.GetToken() );
591 0 : rBase.WriteError( rInStm );
592 : }
593 0 : rBase.SetError( "SlotType with unknown item type", rInStm.GetToken() );
594 0 : rBase.WriteError( rInStm );
595 : }
596 : }
597 0 : rInStm.Seek( nTokPos );
598 :
599 : }
600 0 : if( !aMethod.Is() )
601 : {
602 0 : SvToken * pTok = rInStm.GetToken();
603 0 : if( pTok->IsIdentifier() )
604 : {
605 0 : aMethod = new SvMetaSlot();
606 0 : sal_uInt32 nTokPos = rInStm.Tell();
607 0 : if( aMethod->ReadSvIdl( rBase, rInStm ) )
608 : {
609 0 : if( aMethod->IsMethod() )
610 : {
611 0 : aMethod->SetSlotId( GetSlotId() );
612 0 : if( aMethod->Test( rBase, rInStm ) )
613 : return;
614 : }
615 0 : rInStm.Seek( nTokPos );
616 : }
617 0 : aMethod.Clear();
618 : }
619 : }
620 : }
621 : }
622 :
623 0 : void SvMetaSlot::WriteAttributesSvIdl( SvIdlDataBase & rBase,
624 : SvStream & rOutStm,
625 : sal_uInt16 nTab )
626 : {
627 0 : SvMetaAttribute::WriteAttributesSvIdl( rBase, rOutStm, nTab );
628 :
629 0 : if( aSlotType.Is() )
630 : {
631 0 : WriteTab( rOutStm, nTab );
632 0 : rOutStm << SvHash_SlotType()->GetName().getStr() << '(';
633 0 : aSlotType->WriteTheType( rBase, rOutStm, nTab, WRITE_IDL );
634 0 : rOutStm << ");" << endl;
635 : }
636 0 : if( aMethod.Is() )
637 : {
638 0 : WriteTab( rOutStm, nTab );
639 0 : aMethod->WriteSvIdl( rBase, rOutStm, nTab );
640 0 : rOutStm << ';' << endl;
641 : }
642 0 : if( aHasCoreId )
643 : {
644 0 : aHasCoreId.WriteSvIdl( SvHash_HasCoreId(), rOutStm );
645 0 : rOutStm << ';' << endl;
646 : }
647 0 : if( !aGroupId.getString().isEmpty() )
648 : {
649 0 : WriteTab( rOutStm, nTab );
650 0 : aGroupId.WriteSvIdl( SvHash_GroupId(), rOutStm, nTab +1);
651 0 : rOutStm << ';' << endl;
652 : }
653 0 : if( !aExecMethod.getString().isEmpty() )
654 : {
655 0 : WriteTab( rOutStm, nTab );
656 0 : aExecMethod.WriteSvIdl( SvHash_ExecMethod(), rOutStm, nTab +1);
657 0 : rOutStm << ';' << endl;
658 : }
659 0 : if( !aStateMethod.getString().isEmpty() )
660 : {
661 0 : WriteTab( rOutStm, nTab );
662 0 : aStateMethod.WriteSvIdl( SvHash_StateMethod(), rOutStm, nTab +1);
663 0 : rOutStm << ';' << endl;
664 : }
665 :
666 0 : if( !aDisableFlags.getString().isEmpty() )
667 : {
668 0 : WriteTab( rOutStm, nTab );
669 0 : aDisableFlags.WriteSvIdl( SvHash_DisableFlags(), rOutStm, nTab +1);
670 0 : rOutStm << ';' << endl;
671 : }
672 :
673 0 : if( aSet || aGet || aPseudoSlots )
674 : {
675 0 : WriteTab( rOutStm, nTab );
676 0 : char const * p = "";
677 0 : if( aPseudoSlots )
678 : {
679 0 : aPseudoSlots.WriteSvIdl( SvHash_PseudoSlots(), rOutStm );
680 0 : p = ", ";
681 : }
682 0 : if( aGet )
683 : {
684 0 : rOutStm << p;
685 0 : aGet.WriteSvIdl( SvHash_Get(), rOutStm );
686 0 : p = ", ";
687 : }
688 0 : if( aSet )
689 : {
690 0 : rOutStm << p;
691 0 : aSet.WriteSvIdl( SvHash_Set(), rOutStm );
692 : }
693 0 : rOutStm << ';' << endl;
694 : }
695 :
696 0 : rtl::OString aDel(", ");
697 0 : rtl::OStringBuffer aOut;
698 0 : if( aVolatile )
699 0 : aOut.append(aVolatile.GetSvIdlString( SvHash_Volatile() ));
700 0 : else if( !aCachable )
701 : // because of Default == TRUE, only when no other is set
702 0 : aOut.append(aCachable.GetSvIdlString( SvHash_Cachable() ));
703 : else
704 0 : aDel = rtl::OString();
705 :
706 0 : if( aToggle )
707 : {
708 0 : aOut.append(aDel).append(aToggle.GetSvIdlString( SvHash_Toggle() ));
709 0 : aDel = ", ";
710 : }
711 0 : if( aAutoUpdate )
712 : {
713 0 : aOut.append(aDel).append(aAutoUpdate.GetSvIdlString( SvHash_AutoUpdate() ));
714 0 : aDel = ", ";
715 : }
716 :
717 0 : rtl::OString aDel1(", ");
718 0 : if( aAsynchron )
719 0 : aOut.append(aDel).append(aAsynchron.GetSvIdlString( SvHash_Asynchron() ));
720 0 : else if( !aSynchron )
721 : {
722 : // because of Default == TRUE, only when no other is set
723 0 : aOut.append(aDel).append(aSynchron.GetSvIdlString( SvHash_Synchron() ));
724 : }
725 : else
726 0 : aDel1 = aDel;
727 :
728 0 : aDel = ", ";
729 0 : if( aRecordManual )
730 0 : aOut.append(aDel1).append(aRecordManual.GetSvIdlString( SvHash_RecordManual() ));
731 0 : else if( aNoRecord )
732 0 : aOut.append(aDel1).append(aNoRecord.GetSvIdlString( SvHash_NoRecord() ));
733 0 : else if( !aRecordPerSet )
734 : // because of Default == TRUE, only when no other is set
735 0 : aOut.append(aDel1).append(aRecordPerSet.GetSvIdlString( SvHash_RecordPerSet() ));
736 0 : else if( aRecordPerItem )
737 0 : aOut.append(aDel1).append(aRecordPerItem.GetSvIdlString( SvHash_RecordPerItem() ));
738 : else
739 0 : aDel = aDel1;
740 :
741 0 : if( aRecordAbsolute )
742 : {
743 0 : aOut.append(aDel).append(aRecordAbsolute.GetSvIdlString( SvHash_RecordAbsolute() ));
744 0 : aDel = ", ";
745 : }
746 0 : if( aHasDialog )
747 : {
748 0 : aOut.append(aDel).append(aHasDialog.GetSvIdlString( SvHash_HasDialog() ));
749 0 : aDel = ", ";
750 : }
751 0 : if( aMenuConfig )
752 : {
753 0 : aOut.append(aDel).append(aMenuConfig.GetSvIdlString( SvHash_MenuConfig() ));
754 0 : aDel = ", ";
755 : }
756 0 : if( aToolBoxConfig )
757 : {
758 0 : aOut.append(aDel).append(aToolBoxConfig.GetSvIdlString( SvHash_ToolBoxConfig() ));
759 0 : aDel = ", ";
760 : }
761 0 : if( aStatusBarConfig )
762 : {
763 0 : aOut.append(aDel).append(aStatusBarConfig.GetSvIdlString( SvHash_StatusBarConfig() ));
764 0 : aDel = ", ";
765 : }
766 0 : if( aAccelConfig )
767 : {
768 0 : aOut.append(aDel).append(aAccelConfig.GetSvIdlString( SvHash_AccelConfig() ));
769 0 : aDel = ", ";
770 : }
771 0 : if( aFastCall )
772 : {
773 0 : aOut.append(aDel).append(aFastCall.GetSvIdlString( SvHash_FastCall() ));
774 0 : aDel = ", ";
775 : }
776 0 : if( aContainer )
777 : {
778 0 : aOut.append(aDel).append(aContainer.GetSvIdlString( SvHash_Container() ));
779 0 : aDel = ", ";
780 : }
781 0 : if( aImageRotation )
782 : {
783 0 : aOut.append(aDel).append(aImageRotation.GetSvIdlString( SvHash_ImageRotation() ));
784 0 : aDel = ", ";
785 : }
786 :
787 0 : if( aImageReflection )
788 : {
789 0 : aOut.append(aDel).append(aImageReflection.GetSvIdlString( SvHash_ImageReflection() ));
790 0 : aDel = ", ";
791 : }
792 :
793 0 : if( aOut.getLength() )
794 : {
795 0 : WriteTab( rOutStm, nTab );
796 0 : rOutStm << aOut.getStr() << endl;
797 0 : }
798 0 : }
799 :
800 :
801 0 : sal_Bool SvMetaSlot::Test( SvIdlDataBase & rBase, SvTokenStream & rInStm )
802 : {
803 0 : sal_Bool bOk = SvMetaAttribute::Test( rBase, rInStm );
804 0 : if( bOk )
805 : {
806 0 : SvMetaType * pType = GetType();
807 0 : if( pType->GetType() == TYPE_METHOD )
808 0 : pType = pType->GetReturnType();
809 0 : if( !pType->IsItem() )
810 : {
811 0 : rBase.SetError( "this attribute is not a slot", rInStm.GetToken() );
812 0 : rBase.WriteError( rInStm );
813 0 : bOk = sal_False;
814 : }
815 : }
816 :
817 0 : return bOk;
818 : }
819 :
820 0 : sal_Bool SvMetaSlot::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm )
821 : {
822 0 : sal_uInt32 nTokPos = rInStm.Tell();
823 0 : sal_Bool bOk = sal_True;
824 :
825 0 : SvMetaAttribute * pAttr = rBase.ReadKnownAttr( rInStm, GetType() );
826 0 : if( pAttr )
827 : {
828 : // c
829 0 : SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr );
830 0 : if( pKnownSlot )
831 : {
832 0 : SetRef( pKnownSlot );
833 0 : SetName( pKnownSlot->GetName().getString(), &rBase );
834 0 : bOk = SvMetaName::ReadSvIdl( rBase, rInStm );
835 : }
836 : else
837 : {
838 0 : rtl::OStringBuffer aStr( "attribute " );
839 0 : aStr.append(pAttr->GetName().getString());
840 0 : aStr.append(" is method or variable but not a slot");
841 0 : rBase.SetError( aStr.makeStringAndClear(), rInStm.GetToken() );
842 0 : rBase.WriteError( rInStm );
843 0 : bOk = sal_False;
844 : }
845 : }
846 : else
847 : {
848 0 : bOk = SvMetaAttribute::ReadSvIdl( rBase, rInStm );
849 :
850 0 : SvMetaAttribute *pAttr2 = rBase.SearchKnownAttr( GetSlotId() );
851 0 : if( pAttr2 )
852 : {
853 : // for testing purposes: reference in case of complete definition
854 0 : SvMetaSlot * pKnownSlot = PTR_CAST( SvMetaSlot, pAttr2 );
855 0 : if( pKnownSlot )
856 : {
857 0 : SetRef( pKnownSlot );
858 :
859 : // names may differ, because explicitly given
860 0 : if ( pKnownSlot->GetName().getString() != GetName().getString() )
861 : {
862 : OSL_FAIL("Illegal definition!");
863 0 : rInStm.Seek( nTokPos );
864 0 : return sal_False;
865 : }
866 :
867 0 : SetName( pKnownSlot->GetName().getString(), &rBase );
868 : }
869 : else
870 : {
871 0 : rtl::OStringBuffer aStr("attribute ");
872 0 : aStr.append(pAttr2->GetName().getString());
873 0 : aStr.append(" is method or variable but not a slot");
874 0 : rBase.SetError( aStr.makeStringAndClear(), rInStm.GetToken() );
875 0 : rBase.WriteError( rInStm );
876 0 : bOk = sal_False;
877 : }
878 : }
879 : }
880 :
881 0 : if( !bOk )
882 0 : rInStm.Seek( nTokPos );
883 :
884 0 : return bOk;
885 : }
886 :
887 0 : void SvMetaSlot::WriteSvIdl( SvIdlDataBase & rBase, SvStream & rOutStm,
888 : sal_uInt16 nTab )
889 : {
890 0 : SvMetaAttribute::WriteSvIdl( rBase, rOutStm, nTab );
891 0 : }
892 :
893 0 : void SvMetaSlot::Write( SvIdlDataBase & rBase,
894 : SvStream & rOutStm, sal_uInt16 nTab,
895 : WriteType nT, WriteAttribute nA )
896 : {
897 0 : if ( nT == WRITE_DOCU )
898 : {
899 0 : if ( GetHidden() )
900 0 : return;
901 : }
902 : else
903 : {
904 : // no attribute for Automation
905 0 : if( !GetAutomation() || !GetExport() )
906 0 : return;
907 : }
908 :
909 0 : if( !(nA & WA_VARIABLE) )
910 : {
911 0 : SvMetaAttributeRef xM = GetMethod();
912 0 : if( xM.Is() )
913 : {
914 0 : xM->SetSlotId( GetSlotId() );
915 0 : xM->SetDescription( GetDescription().getString() );
916 0 : xM->Write( rBase, rOutStm, nTab, nT, nA );
917 : return;
918 0 : }
919 : }
920 :
921 0 : SvMetaAttribute::Write( rBase, rOutStm, nTab, nT, nA );
922 : }
923 :
924 :
925 0 : void SvMetaSlot::Insert( SvSlotElementList& rList, const rtl::OString& rPrefix,
926 : SvIdlDataBase& rBase)
927 : {
928 : // get insert position through binary search in slotlist
929 0 : sal_uInt16 nId = (sal_uInt16) GetSlotId().GetValue();
930 0 : sal_uInt16 nListCount = (sal_uInt16) rList.size();
931 : sal_uInt16 nPos;
932 : sal_uLong m; // for inner "for" loop
933 :
934 0 : if ( !nListCount )
935 0 : nPos = 0;
936 0 : else if ( nListCount == 1 )
937 0 : nPos = rList[ 0 ]->xSlot->GetSlotId().GetValue() >= nId ? 0 : 1;
938 : else
939 : {
940 0 : sal_uInt16 nMid = 0, nLow = 0;
941 0 : sal_uInt16 nHigh = nListCount - 1;
942 0 : sal_Bool bFound = sal_False;
943 0 : while ( !bFound && nLow <= nHigh )
944 : {
945 0 : nMid = (nLow + nHigh) >> 1;
946 : DBG_ASSERT( nMid < nListCount, "bsearch ist buggy" );
947 0 : int nDiff = (int) nId - (int) rList[ nMid ]->xSlot->GetSlotId().GetValue();
948 0 : if ( nDiff < 0)
949 : {
950 0 : if ( nMid == 0 )
951 0 : break;
952 0 : nHigh = nMid - 1;
953 : }
954 0 : else if ( nDiff > 0 )
955 : {
956 0 : nLow = nMid + 1;
957 0 : if ( nLow == 0 )
958 0 : break;
959 : }
960 : else
961 0 : bFound = sal_True;
962 : }
963 :
964 : DBG_ASSERT(!bFound, "Duplicate SlotId!");
965 0 : nPos = bFound ? nMid : nLow;
966 : }
967 :
968 : DBG_ASSERT( nPos <= nListCount,
969 : "nPos too large" );
970 : DBG_ASSERT( nPos == nListCount || nId <=
971 : (sal_uInt16) rList[ nPos ]->xSlot->GetSlotId().GetValue(),
972 : "Successor has lower SlotId" );
973 : DBG_ASSERT( nPos == 0 || nId >
974 : (sal_uInt16) rList[ nPos-1 ]->xSlot->GetSlotId().GetValue(),
975 : "Predecessor has higher SlotId" );
976 : DBG_ASSERT( nPos+1 >= nListCount || nId <
977 : (sal_uInt16) rList[ nPos+1 ]->xSlot->GetSlotId().GetValue(),
978 : "Successor has lower SlotId" );
979 :
980 0 : if ( nPos < rList.size() )
981 : {
982 0 : SvSlotElementList::iterator it = rList.begin();
983 0 : std::advance( it, nPos );
984 0 : rList.insert( it, new SvSlotElement( this, rPrefix ) );
985 : }
986 : else
987 : {
988 0 : rList.push_back( new SvSlotElement( this, rPrefix ) );
989 : }
990 :
991 : // iron out EnumSlots
992 0 : SvMetaTypeEnum * pEnum = NULL;
993 0 : SvMetaType * pBType = GetType()->GetBaseType();
994 0 : pEnum = PTR_CAST( SvMetaTypeEnum, pBType );
995 0 : if( GetPseudoSlots() && pEnum && pEnum->Count() )
996 : {
997 : // clone the MasterSlot
998 0 : SvMetaSlotRef xEnumSlot;
999 0 : SvMetaSlot *pFirstEnumSlot = NULL;
1000 0 : for( sal_uLong n = 0; n < pEnum->Count(); n++ )
1001 : {
1002 : // create SlotId
1003 0 : SvMetaEnumValue *enumValue = pEnum->GetObject(n);
1004 0 : rtl::OString aValName = enumValue->GetName().getString();
1005 0 : rtl::OStringBuffer aBuf;
1006 0 : if( !GetPseudoPrefix().isEmpty() )
1007 0 : aBuf.append(GetPseudoPrefix());
1008 : else
1009 0 : aBuf.append(GetSlotId().getString());
1010 0 : aBuf.append('_');
1011 0 : aBuf.append(aValName.copy(pEnum->GetPrefix().getLength()));
1012 :
1013 0 : rtl::OString aSId = aBuf.makeStringAndClear();
1014 :
1015 0 : xEnumSlot = NULL;
1016 0 : for( m=0; m<rBase.GetAttrList().size(); m++ )
1017 : {
1018 0 : SvMetaAttribute * pAttr = rBase.GetAttrList()[m];
1019 0 : if (aSId.equals(pAttr->GetSlotId().getString()))
1020 : {
1021 0 : SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr );
1022 0 : xEnumSlot = pSlot->Clone();
1023 0 : break;
1024 : }
1025 : }
1026 :
1027 0 : if ( m == rBase.GetAttrList().size() )
1028 : {
1029 : OSL_FAIL("Invalid EnumSlot!");
1030 0 : xEnumSlot = Clone();
1031 : sal_uLong nValue;
1032 0 : if ( rBase.FindId(aSId , &nValue) )
1033 : {
1034 0 : SvNumberIdentifier aId;
1035 0 : aId.setString(aSId);
1036 0 : aId.SetValue(nValue);
1037 0 : xEnumSlot->SetSlotId(aId);
1038 : }
1039 : }
1040 :
1041 : // The slaves are no master!
1042 0 : xEnumSlot->aPseudoSlots = sal_False;
1043 0 : xEnumSlot->SetEnumValue(enumValue);
1044 :
1045 0 : if ( !pFirstEnumSlot || xEnumSlot->GetSlotId().GetValue() < pFirstEnumSlot->GetSlotId().GetValue() )
1046 0 : pFirstEnumSlot = xEnumSlot;
1047 :
1048 : // insert the created slave as well
1049 0 : xEnumSlot->Insert( rList, rPrefix, rBase);
1050 :
1051 : // concatenate the EnumSlots with the master
1052 0 : xEnumSlot->pLinkedSlot = this;
1053 0 : }
1054 :
1055 : // master points to the first slave
1056 0 : pLinkedSlot = pFirstEnumSlot;
1057 :
1058 : // concatenate slaves among themselves
1059 0 : xEnumSlot = pFirstEnumSlot;
1060 0 : size_t i = 0;
1061 : SvSlotElement *pEle;
1062 0 : do
1063 : {
1064 0 : pEle = ( ++i < rList.size() ) ? rList[ i ] : NULL;
1065 0 : if ( pEle && pEle->xSlot->pLinkedSlot == this )
1066 : {
1067 0 : xEnumSlot->pNextSlot = pEle->xSlot;
1068 0 : xEnumSlot = pEle->xSlot;
1069 : }
1070 : }
1071 : while ( pEle );
1072 0 : xEnumSlot->pNextSlot = pFirstEnumSlot;
1073 : }
1074 0 : }
1075 :
1076 :
1077 0 : static rtl::OString MakeSlotName( SvStringHashEntry * pEntry )
1078 : {
1079 0 : rtl::OStringBuffer aName(RTL_CONSTASCII_STRINGPARAM("SFX_SLOT_"));
1080 0 : aName.append(pEntry->GetName());
1081 0 : return aName.makeStringAndClear().toAsciiUpperCase();
1082 : };
1083 :
1084 0 : void SvMetaSlot::WriteSlotStubs( const rtl::OString& rShellName,
1085 : ByteStringList & rList,
1086 : SvStream & rOutStm )
1087 : {
1088 0 : if ( !GetExport() && !GetHidden() )
1089 0 : return;
1090 :
1091 0 : rtl::OString aMethodName( GetExecMethod() );
1092 0 : if ( !aMethodName.isEmpty() &&
1093 0 : !aMethodName.equalsL(RTL_CONSTASCII_STRINGPARAM("NoExec")) )
1094 : {
1095 0 : sal_Bool bIn = sal_False;
1096 0 : for( size_t n = 0; n < rList.size(); n++ )
1097 : {
1098 0 : if (rList[n]->equals(aMethodName))
1099 : {
1100 0 : bIn=sal_True;
1101 0 : break;
1102 : }
1103 : }
1104 :
1105 0 : if ( !bIn )
1106 : {
1107 0 : rList.push_back( new rtl::OString(aMethodName) );
1108 0 : rOutStm << "SFX_EXEC_STUB("
1109 0 : << rShellName.getStr()
1110 0 : << ','
1111 0 : << aMethodName.getStr()
1112 0 : << ')' << endl;
1113 : }
1114 : }
1115 :
1116 0 : aMethodName = GetStateMethod();
1117 0 : if (!aMethodName.isEmpty() &&
1118 0 : !aMethodName.equalsL(RTL_CONSTASCII_STRINGPARAM("NoState")))
1119 : {
1120 0 : sal_Bool bIn = sal_False;
1121 0 : for ( size_t n=0; n < rList.size(); n++ )
1122 : {
1123 0 : if (rList[n]->equals(aMethodName))
1124 : {
1125 0 : bIn=sal_True;
1126 0 : break;
1127 : }
1128 : }
1129 :
1130 0 : if ( !bIn )
1131 : {
1132 0 : rList.push_back( new rtl::OString(aMethodName) );
1133 0 : rOutStm << "SFX_STATE_STUB("
1134 0 : << rShellName.getStr()
1135 0 : << ','
1136 0 : << aMethodName.getStr()
1137 0 : << ')' << endl;
1138 : }
1139 0 : }
1140 : }
1141 :
1142 0 : void SvMetaSlot::WriteSlot( const rtl::OString& rShellName, sal_uInt16 nCount,
1143 : const rtl::OString& rSlotId,
1144 : SvSlotElementList& rSlotList,
1145 : size_t nStart,
1146 : const rtl::OString& rPrefix,
1147 : SvIdlDataBase & rBase, SvStream & rOutStm )
1148 : {
1149 0 : if ( !GetExport() && !GetHidden() )
1150 0 : return;
1151 :
1152 0 : sal_Bool bIsEnumSlot = 0 != pEnumValue;
1153 :
1154 0 : rOutStm << "// Slot Nr. "
1155 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(nListPos)).getStr()
1156 0 : << " : ";
1157 : rtl::OString aSlotIdValue(rtl::OString::valueOf(static_cast<sal_Int32>(
1158 0 : GetSlotId().GetValue())));
1159 0 : rOutStm << aSlotIdValue.getStr() << endl;
1160 0 : WriteTab( rOutStm, 1 );
1161 0 : if( bIsEnumSlot )
1162 0 : rOutStm << "SFX_NEW_SLOT_ENUM( ";
1163 : else
1164 0 : rOutStm << "SFX_NEW_SLOT_ARG( " << rShellName.getStr() << ',' ;
1165 :
1166 0 : rOutStm << rSlotId.getStr() << ',';
1167 0 : const SvHelpContext& rHlpCtx = GetHelpContext();
1168 0 : if( rHlpCtx.IsSet() )
1169 0 : rOutStm << rHlpCtx.getString().getStr() << ',';
1170 : else
1171 0 : rOutStm << rSlotId.getStr() << ',';
1172 :
1173 : // GroupId
1174 0 : if( !GetGroupId().isEmpty() )
1175 0 : rOutStm << GetGroupId().getStr();
1176 : else
1177 0 : rOutStm << '0';
1178 0 : rOutStm << ',' << endl;
1179 0 : WriteTab( rOutStm, 4 );
1180 :
1181 0 : if( bIsEnumSlot )
1182 : {
1183 0 : rOutStm << "&a" << rShellName.getStr() << "Slots_Impl["
1184 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(pLinkedSlot->GetListPos())).getStr()
1185 0 : << "] /*Offset Master*/, " << endl;
1186 0 : WriteTab( rOutStm, 4 );
1187 0 : rOutStm << "&a" << rShellName.getStr() << "Slots_Impl["
1188 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(pNextSlot->GetListPos())).getStr()
1189 0 : << "] /*Offset Next*/, " << endl;
1190 :
1191 0 : WriteTab( rOutStm, 4 );
1192 :
1193 : // SlotId
1194 0 : if( !GetSlotId().getString().isEmpty() )
1195 0 : rOutStm << pLinkedSlot->GetSlotId().getString().getStr();
1196 : else
1197 0 : rOutStm << '0';
1198 0 : rOutStm << ',';
1199 0 : rOutStm << pEnumValue->GetName().getString().getStr();
1200 : }
1201 : else
1202 : {
1203 : // look for the next slot with the same StateMethod like me
1204 : // the slotlist is set to the current slot
1205 0 : size_t i = nStart;
1206 0 : SvSlotElement* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL;
1207 0 : pNextSlot = pEle ? &pEle->xSlot : NULL;
1208 0 : while ( pNextSlot )
1209 : {
1210 0 : if ( !pNextSlot->pNextSlot &&
1211 0 : pNextSlot->GetStateMethod() == GetStateMethod()
1212 : ) {
1213 0 : break;
1214 : }
1215 0 : pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL;
1216 0 : pNextSlot = pEle ? &pEle->xSlot : NULL;
1217 : }
1218 :
1219 0 : if ( !pNextSlot )
1220 : {
1221 : // There is no slot behind me that has the same ExecMethod.
1222 : // So I search for the first slot with it (could be myself).
1223 0 : i = 0;
1224 0 : pEle = rSlotList.empty() ? NULL : rSlotList[ i ];
1225 0 : pNextSlot = pEle ? &pEle->xSlot : NULL;
1226 0 : while ( pNextSlot != this )
1227 : {
1228 0 : if ( !pNextSlot->pEnumValue &&
1229 0 : pNextSlot->GetStateMethod() == GetStateMethod() )
1230 0 : break;
1231 0 : pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL;
1232 0 : pNextSlot = pEle ? &pEle->xSlot : NULL;
1233 : }
1234 : }
1235 :
1236 0 : if ( !pLinkedSlot )
1237 : {
1238 0 : rOutStm << "0 ,";
1239 : }
1240 : else
1241 : {
1242 0 : rOutStm << "&a" << rShellName.getStr() << "Slots_Impl["
1243 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(pLinkedSlot->GetListPos())).getStr()
1244 0 : << "] /*Offset Linked*/, " << endl;
1245 0 : WriteTab( rOutStm, 4 );
1246 : }
1247 :
1248 0 : rOutStm << "&a" << rShellName.getStr() << "Slots_Impl["
1249 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(pNextSlot->GetListPos())).getStr()
1250 0 : << "] /*Offset Next*/, " << endl;
1251 :
1252 0 : WriteTab( rOutStm, 4 );
1253 :
1254 : // write ExecMethod, with standard name if not specified
1255 0 : if( !GetExecMethod().isEmpty() &&
1256 0 : !GetExecMethod().equalsL(RTL_CONSTASCII_STRINGPARAM("NoExec")))
1257 : {
1258 0 : rOutStm << "SFX_STUB_PTR(" << rShellName.getStr() << ','
1259 0 : << GetExecMethod().getStr() << ')';
1260 : }
1261 : else
1262 0 : rOutStm << "SFX_STUB_PTR_EXEC_NONE";
1263 0 : rOutStm << ',';
1264 :
1265 : // write StateMethod, with standard name if not specified
1266 0 : if( !GetStateMethod().isEmpty() &&
1267 0 : !GetStateMethod().equalsL(RTL_CONSTASCII_STRINGPARAM("NoState")))
1268 : {
1269 0 : rOutStm << "SFX_STUB_PTR(" << rShellName.getStr() << ','
1270 0 : << GetStateMethod().getStr() << ')';
1271 : }
1272 : else
1273 0 : rOutStm << "SFX_STUB_PTR_STATE_NONE";
1274 : }
1275 0 : rOutStm << ',' << endl;
1276 0 : WriteTab( rOutStm, 4 );
1277 :
1278 : // write flags
1279 0 : if( GetHasCoreId() )
1280 0 : rOutStm << MakeSlotName( SvHash_HasCoreId() ).getStr() << '|';
1281 0 : if( GetCachable() )
1282 0 : rOutStm << MakeSlotName( SvHash_Cachable() ).getStr() << '|';
1283 0 : if( GetVolatile() )
1284 0 : rOutStm << MakeSlotName( SvHash_Volatile() ).getStr() << '|';
1285 0 : if( GetToggle() )
1286 0 : rOutStm << MakeSlotName( SvHash_Toggle() ).getStr() << '|';
1287 0 : if( GetAutoUpdate() )
1288 0 : rOutStm << MakeSlotName( SvHash_AutoUpdate() ).getStr() << '|';
1289 0 : if( GetSynchron() )
1290 0 : rOutStm << MakeSlotName( SvHash_Synchron() ).getStr() << '|';
1291 0 : if( GetAsynchron() )
1292 0 : rOutStm << MakeSlotName( SvHash_Asynchron() ).getStr() << '|';
1293 0 : if( GetRecordPerItem() )
1294 0 : rOutStm << MakeSlotName( SvHash_RecordPerItem() ).getStr() << '|';
1295 0 : if( GetRecordPerSet() )
1296 0 : rOutStm << MakeSlotName( SvHash_RecordPerSet() ).getStr() << '|';
1297 0 : if( GetRecordManual() )
1298 0 : rOutStm << MakeSlotName( SvHash_RecordManual() ).getStr() << '|';
1299 0 : if( GetNoRecord() )
1300 0 : rOutStm << MakeSlotName( SvHash_NoRecord() ).getStr() << '|';
1301 0 : if( GetRecordAbsolute() )
1302 0 : rOutStm << MakeSlotName( SvHash_RecordAbsolute() ).getStr() << '|';
1303 0 : if( GetHasDialog() )
1304 0 : rOutStm << MakeSlotName( SvHash_HasDialog() ).getStr() << '|';
1305 0 : if( GetMenuConfig() )
1306 0 : rOutStm << MakeSlotName( SvHash_MenuConfig() ).getStr() << '|';
1307 0 : if( GetToolBoxConfig() )
1308 0 : rOutStm << MakeSlotName( SvHash_ToolBoxConfig() ).getStr() << '|';
1309 0 : if( GetStatusBarConfig() )
1310 0 : rOutStm << MakeSlotName( SvHash_StatusBarConfig() ).getStr() << '|';
1311 0 : if( GetAccelConfig() )
1312 0 : rOutStm << MakeSlotName( SvHash_AccelConfig() ).getStr() << '|';
1313 0 : if( GetFastCall() )
1314 0 : rOutStm << MakeSlotName( SvHash_FastCall() ).getStr() << '|';
1315 0 : if( GetContainer() )
1316 0 : rOutStm << MakeSlotName( SvHash_Container() ).getStr() << '|';
1317 0 : if ( GetReadOnlyDoc() )
1318 0 : rOutStm << MakeSlotName( SvHash_ReadOnlyDoc() ).getStr() << '|';
1319 0 : if( GetImageRotation() )
1320 0 : rOutStm << MakeSlotName( SvHash_ImageRotation() ).getStr() << '|';
1321 0 : if( GetImageReflection() )
1322 0 : rOutStm << MakeSlotName( SvHash_ImageReflection() ).getStr() << '|';
1323 0 : rOutStm << '0';
1324 :
1325 0 : rOutStm << ',' << endl;
1326 0 : WriteTab( rOutStm, 4 );
1327 0 : if ( GetDisableFlags().isEmpty() )
1328 0 : rOutStm << "0";
1329 : else
1330 0 : rOutStm << GetDisableFlags().getStr();
1331 :
1332 : // write attribute type
1333 0 : if( !bIsEnumSlot )
1334 : {
1335 0 : rOutStm << ',' << endl;
1336 0 : WriteTab( rOutStm, 4 );
1337 :
1338 0 : SvMetaType * pT = GetSlotType();
1339 0 : if( !pT )
1340 : {
1341 0 : if( !IsVariable() )
1342 0 : pT = rBase.FindType( "SfxVoidItem" );
1343 : else
1344 0 : pT = GetType();
1345 : }
1346 0 : if( pT )
1347 : {
1348 0 : rOutStm << pT->GetName().getString().getStr();
1349 0 : if( !rBase.FindType( pT, rBase.aUsedTypes ) )
1350 0 : rBase.aUsedTypes.push_back( pT );
1351 : }
1352 : else
1353 0 : rOutStm << "SfxVoidItem not defined";
1354 : }
1355 : else
1356 : {
1357 0 : SvMetaType *pT = rBase.FindType( "SfxBoolItem" );
1358 0 : if ( pT && !rBase.FindType( pT, rBase.aUsedTypes ) )
1359 0 : rBase.aUsedTypes.push_back( pT );
1360 : }
1361 :
1362 0 : if( !bIsEnumSlot )
1363 : {
1364 0 : rOutStm << ',' << endl;
1365 0 : WriteTab( rOutStm, 4 );
1366 : rOutStm
1367 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(nCount)).getStr()
1368 0 : << "/*Offset*/, ";
1369 :
1370 0 : if( IsMethod() )
1371 : {
1372 0 : SvMetaAttribute * pMethod = GetMethod();
1373 : SvMetaType * pType;
1374 0 : if( pMethod )
1375 0 : pType = pMethod->GetType();
1376 : else
1377 0 : pType = GetType();
1378 0 : sal_uLong nSCount = pType->GetAttrCount();
1379 : rOutStm
1380 : << rtl::OString::valueOf(static_cast<sal_Int32>(
1381 0 : nSCount)).getStr()
1382 0 : << "/*Count*/";
1383 : }
1384 : else
1385 0 : rOutStm << '0';
1386 :
1387 : // name for recording
1388 0 : if ( GetExport() )
1389 : {
1390 0 : rOutStm << ",\"";
1391 0 : if (!rPrefix.isEmpty())
1392 0 : rOutStm << rPrefix.getStr();
1393 0 : rOutStm << '.';
1394 0 : if ( !IsVariable() || !GetType() ||
1395 0 : GetType()->GetBaseType()->GetType() != TYPE_STRUCT )
1396 0 : rOutStm << GetMangleName( sal_False ).getStr();
1397 0 : rOutStm << "\",";
1398 : }
1399 : else
1400 0 : rOutStm << ", 0, ";
1401 :
1402 : // Method/Property flags
1403 0 : if( IsMethod() )
1404 0 : rOutStm << "SFX_SLOT_METHOD|";
1405 0 : if( IsVariable() )
1406 : {
1407 0 : rOutStm << "SFX_SLOT_PROPGET|";
1408 0 : if( !GetReadonly() )
1409 0 : rOutStm << "SFX_SLOT_PROPSET|";
1410 : }
1411 :
1412 0 : rOutStm << '0';
1413 : }
1414 :
1415 : {
1416 0 : rOutStm << ",\"";
1417 0 : rOutStm << GetMangleName( sal_False ).getStr();
1418 0 : rOutStm << "\"";
1419 : }
1420 :
1421 0 : rOutStm << " )," << endl;
1422 : }
1423 :
1424 0 : sal_uInt16 SvMetaSlot::WriteSlotParamArray( SvIdlDataBase & rBase, SvStream & rOutStm )
1425 : {
1426 0 : if ( !GetExport() && !GetHidden() )
1427 0 : return 0;
1428 :
1429 0 : SvMetaAttribute * pMethod = GetMethod();
1430 0 : if( IsMethod() )
1431 : {
1432 : SvMetaType * pType;
1433 0 : if( pMethod )
1434 0 : pType = pMethod->GetType();
1435 : else
1436 0 : pType = GetType();
1437 :
1438 0 : if( !rBase.FindType( pType, rBase.aUsedTypes ) )
1439 0 : rBase.aUsedTypes.push_back( pType );
1440 :
1441 : const SvMetaAttributeMemberList & rList =
1442 0 : pType->GetAttrList();
1443 0 : for( sal_uLong n = 0; n < rList.size(); n++ )
1444 : {
1445 0 : SvMetaAttribute * pPar = rList[n];
1446 0 : SvMetaType * pPType = pPar->GetType();
1447 0 : WriteTab( rOutStm, 1 );
1448 0 : rOutStm << "SFX_ARGUMENT("
1449 0 : << pPar->GetSlotId().getString().getStr() << ',' // SlodId
1450 : // parameter name
1451 0 : << "\"" << pPar->GetName().getString().getStr() << "\","
1452 : // item name
1453 0 : << pPType->GetName().getString().getStr() << ")," << endl;
1454 0 : if( !rBase.FindType( pPType, rBase.aUsedTypes ) )
1455 0 : rBase.aUsedTypes.push_back( pPType );
1456 : }
1457 0 : return (sal_uInt16)rList.size();
1458 : }
1459 0 : return 0;
1460 : }
1461 :
1462 0 : sal_uInt16 SvMetaSlot::WriteSlotMap( const rtl::OString& rShellName, sal_uInt16 nCount,
1463 : SvSlotElementList& rSlotList,
1464 : size_t nStart,
1465 : const rtl::OString& rPrefix,
1466 : SvIdlDataBase & rBase,
1467 : SvStream & rOutStm )
1468 : {
1469 : // SlotId, if not specified generate from name
1470 0 : rtl::OString slotId = GetSlotId().getString();
1471 :
1472 0 : sal_uInt16 nSCount = 0;
1473 0 : if( IsMethod() )
1474 : {
1475 : SvMetaType * pType;
1476 0 : SvMetaAttribute * pMethod = GetMethod();
1477 0 : if( pMethod )
1478 0 : pType = pMethod->GetType();
1479 : else
1480 0 : pType = GetType();
1481 :
1482 0 : nSCount = (sal_uInt16)pType->GetAttrCount();
1483 : }
1484 :
1485 0 : WriteSlot( rShellName, nCount, slotId, rSlotList, nStart, rPrefix, rBase, rOutStm );
1486 0 : return nSCount;
1487 : }
1488 :
1489 0 : void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
1490 : HelpIdTable& rTable )
1491 : {
1492 0 : sal_uLong nSId = GetSlotId().GetValue();
1493 0 : if( rTable.find( nSId ) == rTable.end() )
1494 : {
1495 0 : rTable[ nSId ] = this;
1496 0 : rOutStm << "#define " << GetSlotId().getString().getStr() << '\t'
1497 0 : << rtl::OString::valueOf(static_cast<sal_Int32>(nSId)).getStr()
1498 0 : << endl;
1499 : }
1500 :
1501 0 : SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() );
1502 0 : if( GetPseudoSlots() && pEnum )
1503 : {
1504 0 : for( sal_uLong n = 0; n < pEnum->Count(); ++n )
1505 : {
1506 0 : rtl::OString aValName = pEnum->GetObject( n )->GetName().getString();
1507 :
1508 0 : rtl::OStringBuffer aBuf;
1509 0 : if( !GetPseudoPrefix().isEmpty() )
1510 0 : aBuf.append(GetPseudoPrefix());
1511 : else
1512 0 : aBuf.append(GetSlotId().getString());
1513 0 : aBuf.append('_');
1514 0 : aBuf.append(aValName.copy(pEnum->GetPrefix().getLength()));
1515 :
1516 0 : rtl::OString aSId = aBuf.makeStringAndClear();
1517 :
1518 : sal_uLong nSId2;
1519 0 : sal_Bool bIdOk = sal_False;
1520 0 : if( rBase.FindId( aSId, &nSId2 ) )
1521 : {
1522 0 : aSId = rtl::OString::valueOf(static_cast<sal_Int32>(nSId2));
1523 0 : bIdOk = sal_True;
1524 : }
1525 :
1526 : // if id not found, write always
1527 0 : if( !bIdOk || rTable.find( nSId2 ) == rTable.end() )
1528 : {
1529 0 : rTable[ nSId2 ] = this;
1530 :
1531 0 : rOutStm << "#define " << aSId.getStr() << '\t'
1532 : << rtl::OString::valueOf(
1533 0 : static_cast<sal_Int32>(nSId2)).getStr()
1534 0 : << endl;
1535 : }
1536 0 : }
1537 : }
1538 0 : }
1539 :
1540 0 : void WriteBool( sal_Bool bSet, SvStream& rStream )
1541 : {
1542 0 : if ( bSet )
1543 0 : rStream << "TRUE" << ',';
1544 : else
1545 0 : rStream << "FALSE" << ',';
1546 0 : }
1547 :
1548 0 : void SvMetaSlot::WriteCSV( SvIdlDataBase& rBase, SvStream& rStrm )
1549 : {
1550 0 : rStrm << "PROJECT,";
1551 0 : rStrm << GetSlotId().getString().getStr() << ',';
1552 : rStrm
1553 : << rtl::OString::valueOf(
1554 0 : static_cast<sal_Int32>(GetSlotId().GetValue())).getStr()
1555 0 : << ',';
1556 :
1557 0 : if ( !GetPseudoPrefix().isEmpty() )
1558 0 : rStrm << GetPseudoPrefix().getStr() << ',';
1559 : else
1560 0 : rStrm << ',';
1561 :
1562 0 : rStrm << GetGroupId().getStr() << ',';
1563 :
1564 0 : WriteBool( GetAccelConfig(), rStrm );
1565 0 : WriteBool( GetMenuConfig(), rStrm );
1566 0 : WriteBool( GetStatusBarConfig(), rStrm );
1567 0 : WriteBool( GetToolBoxConfig(), rStrm );
1568 :
1569 0 : if ( GetSlotType() )
1570 0 : rStrm << GetSlotType()->GetName().getString().getStr() << ',';
1571 : else
1572 0 : rStrm << ',';
1573 :
1574 0 : WriteBool( GetAutoUpdate(), rStrm );
1575 0 : if ( GetCachable() )
1576 0 : rStrm << "Cachable" << ',';
1577 : else
1578 0 : rStrm << "Volatile" << ',';
1579 :
1580 0 : WriteBool( GetContainer(), rStrm );
1581 0 : WriteBool( GetFastCall(), rStrm );
1582 0 : WriteBool( GetHasCoreId(), rStrm );
1583 0 : WriteBool( GetHasDialog(), rStrm );
1584 0 : WriteBool( GetReadOnlyDoc(), rStrm );
1585 0 : WriteBool( GetImageRotation(), rStrm );
1586 0 : WriteBool( GetImageReflection(), rStrm );
1587 0 : rStrm << GetDisableFlags().getStr() << ',';
1588 :
1589 0 : if( GetSynchron() )
1590 0 : rStrm << "Synchron" << ',';
1591 : else
1592 0 : rStrm << "Asynchron" << ',';
1593 :
1594 0 : WriteBool( GetToggle(), rStrm );
1595 0 : WriteBool( GetReadonly(), rStrm );
1596 0 : WriteBool( GetExport(), rStrm );
1597 0 : if( GetRecordPerItem() )
1598 0 : rStrm << "RecordPerItem" << ',';
1599 0 : else if ( GetNoRecord() )
1600 0 : rStrm << "NoRecord" << ',';
1601 0 : else if ( GetRecordManual() )
1602 0 : rStrm << "RecordManual" << ',';
1603 : else
1604 0 : rStrm << "RecordPerSet" << ',';
1605 :
1606 0 : WriteBool( GetRecordAbsolute(), rStrm );
1607 :
1608 0 : if ( GetType()->GetType() != TYPE_METHOD && GetMethod() )
1609 : {
1610 0 : rStrm << GetMethod()->GetType()->GetReturnType()->GetName().getString().getStr() << ',';
1611 0 : rStrm << GetMethod()->GetName().getString().getStr() << ',';
1612 : }
1613 : else
1614 : {
1615 0 : rStrm << ",,";
1616 : }
1617 :
1618 0 : rStrm << GetType()->GetSvName().getStr() << ',';
1619 0 : rStrm << GetName().getString().getStr() << ',';
1620 :
1621 0 : if ( GetType()->GetType() == TYPE_METHOD || GetMethod() )
1622 : {
1623 0 : SvMetaAttributeMemberList *pList = &GetType()->GetAttrList();
1624 0 : if ( GetMethod() )
1625 0 : pList = &GetMethod()->GetType()->GetAttrList();
1626 :
1627 0 : if( pList && !pList->empty() )
1628 : {
1629 0 : rStrm << "\"(";
1630 0 : SvMetaAttributeMemberList::const_iterator it = pList->begin();
1631 0 : while( it != pList->end() )
1632 : {
1633 0 : SvMetaAttribute* pAttr = *it;
1634 0 : pAttr->WriteCSV( rBase, rStrm );
1635 0 : ++it;
1636 0 : if( it != pList->end() )
1637 0 : rStrm << ',';
1638 : }
1639 0 : rStrm << ")\"";
1640 : }
1641 : else
1642 0 : rStrm << "()";
1643 : }
1644 :
1645 0 : rStrm << endl;
1646 0 : }
1647 :
1648 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|