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