xref: /aoo41x/main/idl/inc/slot.hxx (revision 67e470da)
1*f3ea6674SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f3ea6674SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f3ea6674SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f3ea6674SAndrew Rist  * distributed with this work for additional information
6*f3ea6674SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f3ea6674SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f3ea6674SAndrew Rist  * "License"); you may not use this file except in compliance
9*f3ea6674SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f3ea6674SAndrew Rist  *
11*f3ea6674SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f3ea6674SAndrew Rist  *
13*f3ea6674SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f3ea6674SAndrew Rist  * software distributed under the License is distributed on an
15*f3ea6674SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f3ea6674SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f3ea6674SAndrew Rist  * specific language governing permissions and limitations
18*f3ea6674SAndrew Rist  * under the License.
19*f3ea6674SAndrew Rist  *
20*f3ea6674SAndrew Rist  *************************************************************/
21*f3ea6674SAndrew Rist 
22*f3ea6674SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SLOT_HXX
25cdf0e10cSrcweir #define _SLOT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <types.hxx>
28cdf0e10cSrcweir #include <command.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /******************** class SvMetaSlot **********************************/
31cdf0e10cSrcweir //class SbxObject;
32cdf0e10cSrcweir class SvMetaSlotMemberList;
33cdf0e10cSrcweir class SvMetaSlot : public SvMetaAttribute
34cdf0e10cSrcweir {
35cdf0e10cSrcweir     SvMetaTypeRef   aSlotType;
36cdf0e10cSrcweir     SvMetaAttributeRef aMethod;
37cdf0e10cSrcweir     SvIdentifier    aGroupId;
38cdf0e10cSrcweir     SvBOOL          aHasCoreId;
39cdf0e10cSrcweir     SvIdentifier    aConfigId;
40cdf0e10cSrcweir     SvIdentifier    aExecMethod;
41cdf0e10cSrcweir     SvIdentifier    aStateMethod;
42cdf0e10cSrcweir     SvIdentifier    aDefault;
43cdf0e10cSrcweir     SvBOOL          aPseudoSlots;
44cdf0e10cSrcweir     SvBOOL          aGet;
45cdf0e10cSrcweir     SvBOOL          aSet;
46cdf0e10cSrcweir 
47cdf0e10cSrcweir     SvBOOL          aCachable;  // exclusiv
48cdf0e10cSrcweir     SvBOOL          aVolatile;
49cdf0e10cSrcweir     SvBOOL          aToggle;
50cdf0e10cSrcweir     SvBOOL          aAutoUpdate;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     SvBOOL          aSynchron;  // exclusiv
53cdf0e10cSrcweir     SvBOOL          aAsynchron;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     SvBOOL          aRecordPerItem;// exclusiv
56cdf0e10cSrcweir     SvBOOL          aRecordPerSet;
57cdf0e10cSrcweir     SvBOOL          aRecordManual;
58cdf0e10cSrcweir     SvBOOL          aNoRecord;
59cdf0e10cSrcweir     SvBOOL          aRecordAbsolute;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     SvBOOL          aHasDialog;
62cdf0e10cSrcweir     SvBOOL          aMenuConfig;
63cdf0e10cSrcweir     SvBOOL          aToolBoxConfig;
64cdf0e10cSrcweir     SvBOOL          aStatusBarConfig;
65cdf0e10cSrcweir     SvBOOL          aAccelConfig;
66cdf0e10cSrcweir     SvBOOL          aFastCall;
67cdf0e10cSrcweir     SvBOOL          aContainer;
68cdf0e10cSrcweir     SvBOOL          aImageRotation;
69cdf0e10cSrcweir     SvBOOL          aImageReflection;
70cdf0e10cSrcweir     SvIdentifier    aPseudoPrefix;
71cdf0e10cSrcweir 	SvString		aDisableFlags;
72cdf0e10cSrcweir 	SvMetaSlot*		pLinkedSlot;
73cdf0e10cSrcweir 	SvMetaSlot*		pNextSlot;
74cdf0e10cSrcweir 	sal_uLong			nListPos;
75cdf0e10cSrcweir 	SvMetaEnumValue* pEnumValue;
76cdf0e10cSrcweir     SvString    aUnoName;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir #ifdef IDL_COMPILER
79cdf0e10cSrcweir     void			WriteSlot( const ByteString & rShellName,
80cdf0e10cSrcweir 							sal_uInt16 nCount, const ByteString & rSlotId,
81cdf0e10cSrcweir 							SvSlotElementList &rList,
82cdf0e10cSrcweir 							const ByteString & rPrefix,
83cdf0e10cSrcweir                            	SvIdlDataBase & rBase, SvStream & rOutStm );
84cdf0e10cSrcweir     virtual void    Write( SvIdlDataBase & rBase,
85cdf0e10cSrcweir 							SvStream & rOutStm, sal_uInt16 nTab,
86cdf0e10cSrcweir 	 						WriteType, WriteAttribute = 0 );
87cdf0e10cSrcweir 
SetEnumValue(SvMetaEnumValue * p)88cdf0e10cSrcweir 	void			SetEnumValue(SvMetaEnumValue *p)
89cdf0e10cSrcweir 					{ pEnumValue = p; }
90cdf0e10cSrcweir #endif
91cdf0e10cSrcweir protected:
SetCachable(sal_Bool bSet)92cdf0e10cSrcweir     void    SetCachable( sal_Bool bSet )
93cdf0e10cSrcweir             {
94cdf0e10cSrcweir                 aCachable = bSet;
95cdf0e10cSrcweir                 if( bSet )
96cdf0e10cSrcweir                     aVolatile = sal_False;
97cdf0e10cSrcweir             }
SetVolatile(sal_Bool bSet)98cdf0e10cSrcweir     void    SetVolatile( sal_Bool bSet )
99cdf0e10cSrcweir             {
100cdf0e10cSrcweir                 aVolatile = bSet;
101cdf0e10cSrcweir                 if( bSet )
102cdf0e10cSrcweir                     aCachable = sal_False;
103cdf0e10cSrcweir             }
SetToggle(sal_Bool bSet)104cdf0e10cSrcweir     void    SetToggle( sal_Bool bSet )
105cdf0e10cSrcweir             {
106cdf0e10cSrcweir                 aToggle = bSet;
107cdf0e10cSrcweir             }
SetAutoUpdate(sal_Bool bSet)108cdf0e10cSrcweir     void    SetAutoUpdate( sal_Bool bSet )
109cdf0e10cSrcweir             {
110cdf0e10cSrcweir                 aAutoUpdate = bSet;
111cdf0e10cSrcweir             }
112cdf0e10cSrcweir 
SetSynchron(sal_Bool bSet)113cdf0e10cSrcweir     void    SetSynchron( sal_Bool bSet )
114cdf0e10cSrcweir             {
115cdf0e10cSrcweir                 aSynchron = bSet;
116cdf0e10cSrcweir                 if( bSet )
117cdf0e10cSrcweir                     aAsynchron = sal_False;
118cdf0e10cSrcweir             }
SetAsynchron(sal_Bool bSet)119cdf0e10cSrcweir     void    SetAsynchron( sal_Bool bSet )
120cdf0e10cSrcweir             {
121cdf0e10cSrcweir                 aAsynchron = bSet;
122cdf0e10cSrcweir                 if( bSet )
123cdf0e10cSrcweir                     aSynchron = sal_False;
124cdf0e10cSrcweir             }
125cdf0e10cSrcweir 
SetRecordPerItem(sal_Bool bSet)126cdf0e10cSrcweir     void    SetRecordPerItem( sal_Bool bSet )
127cdf0e10cSrcweir             {
128cdf0e10cSrcweir                 aRecordPerItem = bSet;
129cdf0e10cSrcweir                 if( bSet )
130cdf0e10cSrcweir                     aRecordPerSet = aRecordManual = aNoRecord = sal_False;
131cdf0e10cSrcweir             }
SetRecordPerSet(sal_Bool bSet)132cdf0e10cSrcweir     void    SetRecordPerSet( sal_Bool bSet )
133cdf0e10cSrcweir             {
134cdf0e10cSrcweir                 aRecordPerSet = bSet;
135cdf0e10cSrcweir                 if( bSet )
136cdf0e10cSrcweir                     aRecordPerItem = aRecordManual = aNoRecord = sal_False;
137cdf0e10cSrcweir             }
SetRecordManual(sal_Bool bSet)138cdf0e10cSrcweir     void    SetRecordManual( sal_Bool bSet )
139cdf0e10cSrcweir             {
140cdf0e10cSrcweir                 aRecordManual = bSet;
141cdf0e10cSrcweir                 if( bSet )
142cdf0e10cSrcweir                     aRecordPerItem = aRecordPerSet = aNoRecord = sal_False;
143cdf0e10cSrcweir             }
SetNoRecord(sal_Bool bSet)144cdf0e10cSrcweir     void    SetNoRecord( sal_Bool bSet )
145cdf0e10cSrcweir             {
146cdf0e10cSrcweir                 aNoRecord = bSet;
147cdf0e10cSrcweir                 if( bSet )
148cdf0e10cSrcweir                     aRecordPerItem = aRecordPerSet = aRecordManual = sal_False;
149cdf0e10cSrcweir             }
SetRecordAbsolute(sal_Bool bSet)150cdf0e10cSrcweir     void    SetRecordAbsolute( sal_Bool bSet )
151cdf0e10cSrcweir             { aRecordAbsolute = bSet; }
SetHasDialog(sal_Bool bSet)152cdf0e10cSrcweir     void    SetHasDialog( sal_Bool bSet )
153cdf0e10cSrcweir             { aHasDialog = bSet; }
SetMenuConfig(sal_Bool bSet)154cdf0e10cSrcweir     void    SetMenuConfig( sal_Bool bSet )
155cdf0e10cSrcweir             { aMenuConfig = bSet; }
SetToolBoxConfig(sal_Bool bSet)156cdf0e10cSrcweir     void    SetToolBoxConfig( sal_Bool bSet )
157cdf0e10cSrcweir             { aToolBoxConfig = bSet; }
SetStatusBarConfig(sal_Bool bSet)158cdf0e10cSrcweir     void    SetStatusBarConfig( sal_Bool bSet )
159cdf0e10cSrcweir             { aStatusBarConfig = bSet; }
SetAccelConfig(sal_Bool bSet)160cdf0e10cSrcweir     void    SetAccelConfig( sal_Bool bSet )
161cdf0e10cSrcweir             { aAccelConfig = bSet; }
SetAllConfig(sal_Bool bSet)162cdf0e10cSrcweir     void    SetAllConfig( sal_Bool bSet )
163cdf0e10cSrcweir             {
164cdf0e10cSrcweir                 aMenuConfig     = bSet;
165cdf0e10cSrcweir                 aToolBoxConfig  = bSet;
166cdf0e10cSrcweir                 aStatusBarConfig = bSet;
167cdf0e10cSrcweir                 aAccelConfig    = bSet;
168cdf0e10cSrcweir             }
SetFastCall(sal_Bool bSet)169cdf0e10cSrcweir     void    SetFastCall( sal_Bool bSet )
170cdf0e10cSrcweir             { aFastCall = bSet; }
SetContainer(sal_Bool bSet)171cdf0e10cSrcweir     void    SetContainer( sal_Bool bSet )
172cdf0e10cSrcweir             { aContainer = bSet; }
SetImageRotation(sal_Bool bSet)173cdf0e10cSrcweir     void    SetImageRotation( sal_Bool bSet )
174cdf0e10cSrcweir             { aImageRotation = bSet; }
SetImageReflection(sal_Bool bSet)175cdf0e10cSrcweir     void    SetImageReflection( sal_Bool bSet )
176cdf0e10cSrcweir             { aImageReflection = bSet; }
177cdf0e10cSrcweir 
178cdf0e10cSrcweir public:
179cdf0e10cSrcweir             SV_DECL_META_FACTORY1( SvMetaSlot, SvMetaReference, 11 )
180cdf0e10cSrcweir             SvMetaObject *  MakeClone() const;
Clone() const181cdf0e10cSrcweir             SvMetaSlot *Clone() const { return (SvMetaSlot *)MakeClone(); }
182cdf0e10cSrcweir 
183cdf0e10cSrcweir             SvMetaSlot();
184cdf0e10cSrcweir             SvMetaSlot( SvMetaType * pType );
185cdf0e10cSrcweir 
186cdf0e10cSrcweir     virtual sal_Bool    IsVariable() const;
187cdf0e10cSrcweir     virtual sal_Bool    IsMethod() const;
188cdf0e10cSrcweir 	virtual ByteString	GetMangleName( sal_Bool bVariable ) const;
189cdf0e10cSrcweir 
190cdf0e10cSrcweir     SvMetaAttribute *	GetMethod() const;
191cdf0e10cSrcweir     SvMetaType *		GetSlotType() const;
192cdf0e10cSrcweir     sal_Bool                GetHasCoreId() const;
193cdf0e10cSrcweir     const ByteString &      GetGroupId() const;
194cdf0e10cSrcweir     const ByteString &      GetConfigId() const;
195cdf0e10cSrcweir     const ByteString &      GetExecMethod() const;
196cdf0e10cSrcweir     const ByteString &      GetStateMethod() const;
197cdf0e10cSrcweir     const ByteString &      GetDefault() const;
198cdf0e10cSrcweir 	const ByteString &		GetDisableFlags() const;
199cdf0e10cSrcweir     sal_Bool                GetPseudoSlots() const;
200cdf0e10cSrcweir 	/*
201cdf0e10cSrcweir     sal_Bool                GetGet() const;
202cdf0e10cSrcweir     sal_Bool                GetSet() const;
203cdf0e10cSrcweir 	*/
204cdf0e10cSrcweir     sal_Bool                GetCachable() const;
205cdf0e10cSrcweir     sal_Bool                GetVolatile() const;
206cdf0e10cSrcweir     sal_Bool                GetToggle() const;
207cdf0e10cSrcweir     sal_Bool                GetAutoUpdate() const;
208cdf0e10cSrcweir 
209cdf0e10cSrcweir     sal_Bool                GetSynchron() const;
210cdf0e10cSrcweir     sal_Bool                GetAsynchron() const;
211cdf0e10cSrcweir 
212cdf0e10cSrcweir     sal_Bool                GetRecordPerItem() const;
213cdf0e10cSrcweir     sal_Bool                GetRecordPerSet() const;
214cdf0e10cSrcweir     sal_Bool                GetRecordManual() const;
215cdf0e10cSrcweir     sal_Bool                GetNoRecord() const;
216cdf0e10cSrcweir     sal_Bool                GetRecordAbsolute() const;
217cdf0e10cSrcweir 
218cdf0e10cSrcweir     sal_Bool                GetHasDialog() const;
219cdf0e10cSrcweir     const ByteString &      GetPseudoPrefix() const;
220cdf0e10cSrcweir     const ByteString &      GetUnoName() const;
221cdf0e10cSrcweir     sal_Bool                GetMenuConfig() const;
222cdf0e10cSrcweir     sal_Bool                GetToolBoxConfig() const;
223cdf0e10cSrcweir     sal_Bool                GetStatusBarConfig() const;
224cdf0e10cSrcweir     sal_Bool                GetAccelConfig() const;
225cdf0e10cSrcweir     sal_Bool                GetFastCall() const;
226cdf0e10cSrcweir     sal_Bool                GetContainer() const;
227cdf0e10cSrcweir     sal_Bool                GetImageRotation() const;
228cdf0e10cSrcweir     sal_Bool                GetImageReflection() const;
GetLinkedSlot() const229cdf0e10cSrcweir 	SvMetaSlot*			GetLinkedSlot() const
230cdf0e10cSrcweir 						{ return pLinkedSlot; }
GetNextSlot() const231cdf0e10cSrcweir 	SvMetaSlot*			GetNextSlot() const
232cdf0e10cSrcweir 						{ return pNextSlot; }
GetListPos() const233cdf0e10cSrcweir 	sal_uLong				GetListPos() const
234cdf0e10cSrcweir 						{ return nListPos; }
SetListPos(sal_uLong n)235cdf0e10cSrcweir 	void 				SetListPos(sal_uLong n)
236cdf0e10cSrcweir 						{ nListPos = n; }
ResetSlotPointer()237cdf0e10cSrcweir 	void				ResetSlotPointer()
238cdf0e10cSrcweir 						{ pNextSlot = pLinkedSlot = 0; }
239cdf0e10cSrcweir 
240cdf0e10cSrcweir //    void                FillSbxObject( SvIdlDataBase & rBase, SbxObject *, sal_Bool bProp );
241cdf0e10cSrcweir #ifdef IDL_COMPILER
GetEnumValue() const242cdf0e10cSrcweir 	SvMetaEnumValue*	GetEnumValue() const
243cdf0e10cSrcweir 						{ return pEnumValue; }
244cdf0e10cSrcweir 	virtual sal_Bool 		Test( SvIdlDataBase &, SvTokenStream & rInStm );
245cdf0e10cSrcweir     virtual void        ReadAttributesSvIdl( SvIdlDataBase & rBase,
246cdf0e10cSrcweir                                              SvTokenStream & rInStm );
247cdf0e10cSrcweir     virtual void        WriteAttributesSvIdl( SvIdlDataBase & rBase,
248cdf0e10cSrcweir                                               SvStream & rOutStm, sal_uInt16 nTab );
249cdf0e10cSrcweir     virtual sal_Bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
250cdf0e10cSrcweir     virtual void        WriteSvIdl( SvIdlDataBase & rBase,
251cdf0e10cSrcweir                                     SvStream & rOutStm, sal_uInt16 nTab );
252cdf0e10cSrcweir 	virtual	void		Insert( SvSlotElementList&, const ByteString & rPrefix,
253cdf0e10cSrcweir 								SvIdlDataBase& );
254cdf0e10cSrcweir 	void				WriteSlotStubs( const ByteString & rShellName,
255cdf0e10cSrcweir                                     ByteStringList & rList,
256cdf0e10cSrcweir 									SvStream & rOutStm );
257cdf0e10cSrcweir     sal_uInt16      		WriteSlotMap( const ByteString & rShellName,
258cdf0e10cSrcweir 									sal_uInt16 nCount,
259cdf0e10cSrcweir 									SvSlotElementList&,
260cdf0e10cSrcweir 									const ByteString &,
261cdf0e10cSrcweir 									SvIdlDataBase & rBase,
262cdf0e10cSrcweir                                     SvStream & rOutStm );
263cdf0e10cSrcweir 	sal_uInt16  			WriteSlotParamArray( SvIdlDataBase & rBase,
264cdf0e10cSrcweir 											SvStream & rOutStm );
265cdf0e10cSrcweir     virtual void        WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
266cdf0e10cSrcweir                                   Table * pIdTable );
267cdf0e10cSrcweir     virtual void        WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
268cdf0e10cSrcweir                                   Table * pIdTable );
269cdf0e10cSrcweir 	virtual void		WriteCSV( SvIdlDataBase&, SvStream& );
270cdf0e10cSrcweir #endif
271cdf0e10cSrcweir };
272cdf0e10cSrcweir SV_DECL_IMPL_REF(SvMetaSlot)
273cdf0e10cSrcweir SV_DECL_IMPL_PERSIST_LIST(SvMetaSlot,SvMetaSlot *)
274cdf0e10cSrcweir 
275cdf0e10cSrcweir #endif // _SLOT_HXX
276