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