xref: /aoo41x/main/idl/inc/slot.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SLOT_HXX
29 #define _SLOT_HXX
30 
31 #include <types.hxx>
32 #include <command.hxx>
33 
34 /******************** class SvMetaSlot **********************************/
35 //class SbxObject;
36 class SvMetaSlotMemberList;
37 class SvMetaSlot : public SvMetaAttribute
38 {
39     SvMetaTypeRef   aSlotType;
40     SvMetaAttributeRef aMethod;
41     SvIdentifier    aGroupId;
42     SvBOOL          aHasCoreId;
43     SvIdentifier    aConfigId;
44     SvIdentifier    aExecMethod;
45     SvIdentifier    aStateMethod;
46     SvIdentifier    aDefault;
47     SvBOOL          aPseudoSlots;
48     SvBOOL          aGet;
49     SvBOOL          aSet;
50 
51     SvBOOL          aCachable;  // exclusiv
52     SvBOOL          aVolatile;
53     SvBOOL          aToggle;
54     SvBOOL          aAutoUpdate;
55 
56     SvBOOL          aSynchron;  // exclusiv
57     SvBOOL          aAsynchron;
58 
59     SvBOOL          aRecordPerItem;// exclusiv
60     SvBOOL          aRecordPerSet;
61     SvBOOL          aRecordManual;
62     SvBOOL          aNoRecord;
63     SvBOOL          aRecordAbsolute;
64 
65     SvBOOL          aHasDialog;
66     SvBOOL          aMenuConfig;
67     SvBOOL          aToolBoxConfig;
68     SvBOOL          aStatusBarConfig;
69     SvBOOL          aAccelConfig;
70     SvBOOL          aFastCall;
71     SvBOOL          aContainer;
72     SvBOOL          aImageRotation;
73     SvBOOL          aImageReflection;
74     SvIdentifier    aPseudoPrefix;
75 	SvString		aDisableFlags;
76 	SvMetaSlot*		pLinkedSlot;
77 	SvMetaSlot*		pNextSlot;
78 	sal_uLong			nListPos;
79 	SvMetaEnumValue* pEnumValue;
80     SvString    aUnoName;
81 
82 #ifdef IDL_COMPILER
83     void			WriteSlot( const ByteString & rShellName,
84 							sal_uInt16 nCount, const ByteString & rSlotId,
85 							SvSlotElementList &rList,
86 							const ByteString & rPrefix,
87                            	SvIdlDataBase & rBase, SvStream & rOutStm );
88     virtual void    Write( SvIdlDataBase & rBase,
89 							SvStream & rOutStm, sal_uInt16 nTab,
90 	 						WriteType, WriteAttribute = 0 );
91 
92 	void			SetEnumValue(SvMetaEnumValue *p)
93 					{ pEnumValue = p; }
94 #endif
95 protected:
96     void    SetCachable( sal_Bool bSet )
97             {
98                 aCachable = bSet;
99                 if( bSet )
100                     aVolatile = sal_False;
101             }
102     void    SetVolatile( sal_Bool bSet )
103             {
104                 aVolatile = bSet;
105                 if( bSet )
106                     aCachable = sal_False;
107             }
108     void    SetToggle( sal_Bool bSet )
109             {
110                 aToggle = bSet;
111             }
112     void    SetAutoUpdate( sal_Bool bSet )
113             {
114                 aAutoUpdate = bSet;
115             }
116 
117     void    SetSynchron( sal_Bool bSet )
118             {
119                 aSynchron = bSet;
120                 if( bSet )
121                     aAsynchron = sal_False;
122             }
123     void    SetAsynchron( sal_Bool bSet )
124             {
125                 aAsynchron = bSet;
126                 if( bSet )
127                     aSynchron = sal_False;
128             }
129 
130     void    SetRecordPerItem( sal_Bool bSet )
131             {
132                 aRecordPerItem = bSet;
133                 if( bSet )
134                     aRecordPerSet = aRecordManual = aNoRecord = sal_False;
135             }
136     void    SetRecordPerSet( sal_Bool bSet )
137             {
138                 aRecordPerSet = bSet;
139                 if( bSet )
140                     aRecordPerItem = aRecordManual = aNoRecord = sal_False;
141             }
142     void    SetRecordManual( sal_Bool bSet )
143             {
144                 aRecordManual = bSet;
145                 if( bSet )
146                     aRecordPerItem = aRecordPerSet = aNoRecord = sal_False;
147             }
148     void    SetNoRecord( sal_Bool bSet )
149             {
150                 aNoRecord = bSet;
151                 if( bSet )
152                     aRecordPerItem = aRecordPerSet = aRecordManual = sal_False;
153             }
154     void    SetRecordAbsolute( sal_Bool bSet )
155             { aRecordAbsolute = bSet; }
156     void    SetHasDialog( sal_Bool bSet )
157             { aHasDialog = bSet; }
158     void    SetMenuConfig( sal_Bool bSet )
159             { aMenuConfig = bSet; }
160     void    SetToolBoxConfig( sal_Bool bSet )
161             { aToolBoxConfig = bSet; }
162     void    SetStatusBarConfig( sal_Bool bSet )
163             { aStatusBarConfig = bSet; }
164     void    SetAccelConfig( sal_Bool bSet )
165             { aAccelConfig = bSet; }
166     void    SetAllConfig( sal_Bool bSet )
167             {
168                 aMenuConfig     = bSet;
169                 aToolBoxConfig  = bSet;
170                 aStatusBarConfig = bSet;
171                 aAccelConfig    = bSet;
172             }
173     void    SetFastCall( sal_Bool bSet )
174             { aFastCall = bSet; }
175     void    SetContainer( sal_Bool bSet )
176             { aContainer = bSet; }
177     void    SetImageRotation( sal_Bool bSet )
178             { aImageRotation = bSet; }
179     void    SetImageReflection( sal_Bool bSet )
180             { aImageReflection = bSet; }
181 
182 public:
183             SV_DECL_META_FACTORY1( SvMetaSlot, SvMetaReference, 11 )
184             SvMetaObject *  MakeClone() const;
185             SvMetaSlot *Clone() const { return (SvMetaSlot *)MakeClone(); }
186 
187             SvMetaSlot();
188             SvMetaSlot( SvMetaType * pType );
189 
190     virtual sal_Bool    IsVariable() const;
191     virtual sal_Bool    IsMethod() const;
192 	virtual ByteString	GetMangleName( sal_Bool bVariable ) const;
193 
194     SvMetaAttribute *	GetMethod() const;
195     SvMetaType *		GetSlotType() const;
196     sal_Bool                GetHasCoreId() const;
197     const ByteString &      GetGroupId() const;
198     const ByteString &      GetConfigId() const;
199     const ByteString &      GetExecMethod() const;
200     const ByteString &      GetStateMethod() const;
201     const ByteString &      GetDefault() const;
202 	const ByteString &		GetDisableFlags() const;
203     sal_Bool                GetPseudoSlots() const;
204 	/*
205     sal_Bool                GetGet() const;
206     sal_Bool                GetSet() const;
207 	*/
208     sal_Bool                GetCachable() const;
209     sal_Bool                GetVolatile() const;
210     sal_Bool                GetToggle() const;
211     sal_Bool                GetAutoUpdate() const;
212 
213     sal_Bool                GetSynchron() const;
214     sal_Bool                GetAsynchron() const;
215 
216     sal_Bool                GetRecordPerItem() const;
217     sal_Bool                GetRecordPerSet() const;
218     sal_Bool                GetRecordManual() const;
219     sal_Bool                GetNoRecord() const;
220     sal_Bool                GetRecordAbsolute() const;
221 
222     sal_Bool                GetHasDialog() const;
223     const ByteString &      GetPseudoPrefix() const;
224     const ByteString &      GetUnoName() const;
225     sal_Bool                GetMenuConfig() const;
226     sal_Bool                GetToolBoxConfig() const;
227     sal_Bool                GetStatusBarConfig() const;
228     sal_Bool                GetAccelConfig() const;
229     sal_Bool                GetFastCall() const;
230     sal_Bool                GetContainer() const;
231     sal_Bool                GetImageRotation() const;
232     sal_Bool                GetImageReflection() const;
233 	SvMetaSlot*			GetLinkedSlot() const
234 						{ return pLinkedSlot; }
235 	SvMetaSlot*			GetNextSlot() const
236 						{ return pNextSlot; }
237 	sal_uLong				GetListPos() const
238 						{ return nListPos; }
239 	void 				SetListPos(sal_uLong n)
240 						{ nListPos = n; }
241 	void				ResetSlotPointer()
242 						{ pNextSlot = pLinkedSlot = 0; }
243 
244 //    void                FillSbxObject( SvIdlDataBase & rBase, SbxObject *, sal_Bool bProp );
245 #ifdef IDL_COMPILER
246 	SvMetaEnumValue*	GetEnumValue() const
247 						{ return pEnumValue; }
248 	virtual sal_Bool 		Test( SvIdlDataBase &, SvTokenStream & rInStm );
249     virtual void        ReadAttributesSvIdl( SvIdlDataBase & rBase,
250                                              SvTokenStream & rInStm );
251     virtual void        WriteAttributesSvIdl( SvIdlDataBase & rBase,
252                                               SvStream & rOutStm, sal_uInt16 nTab );
253     virtual sal_Bool        ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm );
254     virtual void        WriteSvIdl( SvIdlDataBase & rBase,
255                                     SvStream & rOutStm, sal_uInt16 nTab );
256 	virtual	void		Insert( SvSlotElementList&, const ByteString & rPrefix,
257 								SvIdlDataBase& );
258 	void				WriteSlotStubs( const ByteString & rShellName,
259                                     ByteStringList & rList,
260 									SvStream & rOutStm );
261     sal_uInt16      		WriteSlotMap( const ByteString & rShellName,
262 									sal_uInt16 nCount,
263 									SvSlotElementList&,
264 									const ByteString &,
265 									SvIdlDataBase & rBase,
266                                     SvStream & rOutStm );
267 	sal_uInt16  			WriteSlotParamArray( SvIdlDataBase & rBase,
268 											SvStream & rOutStm );
269     virtual void        WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm,
270                                   Table * pIdTable );
271     virtual void        WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm,
272                                   Table * pIdTable );
273 	virtual void		WriteCSV( SvIdlDataBase&, SvStream& );
274 #endif
275 };
276 SV_DECL_IMPL_REF(SvMetaSlot)
277 SV_DECL_IMPL_PERSIST_LIST(SvMetaSlot,SvMetaSlot *)
278 
279 #endif // _SLOT_HXX
280