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