1353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3353d8f4dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4353d8f4dSAndrew Rist * or more contributor license agreements. See the NOTICE file
5353d8f4dSAndrew Rist * distributed with this work for additional information
6353d8f4dSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7353d8f4dSAndrew Rist * to you under the Apache License, Version 2.0 (the
8353d8f4dSAndrew Rist * "License"); you may not use this file except in compliance
9353d8f4dSAndrew Rist * with the License. You may obtain a copy of the License at
10353d8f4dSAndrew Rist *
11353d8f4dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12353d8f4dSAndrew Rist *
13353d8f4dSAndrew Rist * Unless required by applicable law or agreed to in writing,
14353d8f4dSAndrew Rist * software distributed under the License is distributed on an
15353d8f4dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16353d8f4dSAndrew Rist * KIND, either express or implied. See the License for the
17353d8f4dSAndrew Rist * specific language governing permissions and limitations
18353d8f4dSAndrew Rist * under the License.
19353d8f4dSAndrew Rist *
20353d8f4dSAndrew Rist *************************************************************/
21353d8f4dSAndrew Rist
22353d8f4dSAndrew Rist
23cdf0e10cSrcweir #ifndef _SFX_SHELL_HXX
24cdf0e10cSrcweir #define _SFX_SHELL_HXX
25cdf0e10cSrcweir
26cdf0e10cSrcweir #include "sal/config.h"
27cdf0e10cSrcweir #include "sfx2/dllapi.h"
28cdf0e10cSrcweir #include "sal/types.h"
29cdf0e10cSrcweir #include <com/sun/star/embed/VerbDescriptor.hpp>
30cdf0e10cSrcweir #include <tools/debug.hxx>
31cdf0e10cSrcweir #include <tools/rtti.hxx>
32cdf0e10cSrcweir #include <svl/brdcst.hxx>
33cdf0e10cSrcweir
34cdf0e10cSrcweir #include <tools/ownlist.hxx>
35cdf0e10cSrcweir #include <tools/unqid.hxx>
36cdf0e10cSrcweir #include <tools/string.hxx>
37cdf0e10cSrcweir
38cdf0e10cSrcweir #include <sfx2/sfxuno.hxx>
39cdf0e10cSrcweir
40cdf0e10cSrcweir class ResMgr;
41cdf0e10cSrcweir class Window;
42cdf0e10cSrcweir class ToolBox;
43cdf0e10cSrcweir class SfxItemPool;
44cdf0e10cSrcweir class SfxPoolItem;
45cdf0e10cSrcweir class SfxRequest;
46cdf0e10cSrcweir class SfxItemSet;
47cdf0e10cSrcweir struct SfxFormalArgument;
48cdf0e10cSrcweir class StatusBar;
49cdf0e10cSrcweir class SfxInterface;
50cdf0e10cSrcweir class SfxViewShell;
51cdf0e10cSrcweir class SfxObjectShell;
52cdf0e10cSrcweir class SfxSlotPool;
53cdf0e10cSrcweir class SvGlobalName;
54cdf0e10cSrcweir
55cdf0e10cSrcweir class SfxShellObject;
56cdf0e10cSrcweir class SfxShell;
57cdf0e10cSrcweir struct SfxShell_Impl;
58cdf0e10cSrcweir struct SfxTypeLibImpl;
59cdf0e10cSrcweir class SfxShellObject;
60cdf0e10cSrcweir class SfxShellSubObject;
61cdf0e10cSrcweir class SfxDispatcher;
62cdf0e10cSrcweir class SfxViewFrame;
63cdf0e10cSrcweir class SfxSlot;
64cdf0e10cSrcweir class SfxRepeatTarget;
65cdf0e10cSrcweir class SbxVariable;
66cdf0e10cSrcweir class SbxBase;
67cdf0e10cSrcweir class SfxBindings;
68cdf0e10cSrcweir
69cdf0e10cSrcweir namespace svl
70cdf0e10cSrcweir {
71cdf0e10cSrcweir class IUndoManager;
72cdf0e10cSrcweir }
73cdf0e10cSrcweir
74cdf0e10cSrcweir //====================================================================
75cdf0e10cSrcweir
76cdf0e10cSrcweir enum SfxInterfaceId
77cdf0e10cSrcweir
78cdf0e10cSrcweir /* [Beschreibung]
79cdf0e10cSrcweir
80cdf0e10cSrcweir Id f"ur die <SfxInterface>s, damit wird "uber ein Array an der
81cdf0e10cSrcweir <SfxApplication> ein quasi-statischer Zugriff auf die Interfaces
82cdf0e10cSrcweir erlaubt.
83cdf0e10cSrcweir */
84cdf0e10cSrcweir
85cdf0e10cSrcweir {
86cdf0e10cSrcweir SFX_INTERFACE_NONE,
87cdf0e10cSrcweir SFX_INTERFACE_SFXAPP,
88cdf0e10cSrcweir SFX_INTERFACE_SFXDOCSH,
89cdf0e10cSrcweir SFX_INTERFACE_SFXIPFRM,
90cdf0e10cSrcweir SFX_INTERFACE_SFXVIEWSH,
91cdf0e10cSrcweir SFX_INTERFACE_SFXVIEWFRM,
92cdf0e10cSrcweir SFX_INTERFACE_SFXPLUGINFRM,
93cdf0e10cSrcweir SFX_INTERFACE_SFXPLUGINOBJ,
94cdf0e10cSrcweir SFX_INTERFACE_SFXPLUGINVIEWSH,
95cdf0e10cSrcweir SFX_INTERFACE_SFXFRAMESETOBJ,
96cdf0e10cSrcweir SFX_INTERFACE_SFXFRAMESETVIEWSH,
97cdf0e10cSrcweir SFX_INTERFACE_SFXINTERNALFRM,
98cdf0e10cSrcweir SFX_INTERFACE_SFXCOMPONENTDOCSH,
99cdf0e10cSrcweir SFX_INTERFACE_SFXGENERICOBJ,
100cdf0e10cSrcweir SFX_INTERFACE_SFXGENERICVIEWSH,
101cdf0e10cSrcweir SFX_INTERFACE_SFXEXPLOBJ,
102cdf0e10cSrcweir SFX_INTERFACE_SFXEXPLVIEWSH,
103cdf0e10cSrcweir SFX_INTERFACE_SFXPLUGINVIEWSHDYNAMIC,
104cdf0e10cSrcweir SFX_INTERFACE_SFXEXTERNALVIEWFRM,
105cdf0e10cSrcweir SFX_INTERFACE_SFXMODULE,
106cdf0e10cSrcweir SFX_INTERFACE_SFXFRAMESETVIEW,
107cdf0e10cSrcweir SFX_INTERFACE_SFXFRAMESETSOURCEVIEW,
108cdf0e10cSrcweir SFX_INTERFACE_SFXHELP_DOCSH,
109cdf0e10cSrcweir SFX_INTERFACE_SFXHELP_VIEWSH,
110cdf0e10cSrcweir SFX_INTERFACE_SFXTASK,
111cdf0e10cSrcweir SFX_INTERFACE_OFA_START = 100,
112cdf0e10cSrcweir SFX_INTERFACE_OFA_END = 100,
113cdf0e10cSrcweir SFX_INTERFACE_SC_START = 150,
114cdf0e10cSrcweir SFX_INTERFACE_SC_END = 199,
115cdf0e10cSrcweir SFX_INTERFACE_SD_START = 200,
116cdf0e10cSrcweir SFX_INTERFACE_SD_END = 249,
117cdf0e10cSrcweir SFX_INTERFACE_SW_START = 250,
118cdf0e10cSrcweir SFX_INTERFACE_SW_END = 299,
119cdf0e10cSrcweir SFX_INTERFACE_SIM_START = 300,
120cdf0e10cSrcweir SFX_INTERFACE_SIM_END = 319,
121cdf0e10cSrcweir SFX_INTERFACE_SCH_START = 320,
122cdf0e10cSrcweir SFX_INTERFACE_SCH_END = 339,
123cdf0e10cSrcweir SFX_INTERFACE_SMA_START = 340,
124cdf0e10cSrcweir SFX_INTERFACE_SMA_END = 359,
125cdf0e10cSrcweir SFX_INTERFACE_SBA_START = 360,
126cdf0e10cSrcweir SFX_INTERFACE_SBA_END = 399,
127cdf0e10cSrcweir SFX_INTERFACE_IDE_START = 400,
128cdf0e10cSrcweir SFX_INTERFACE_IDE_END = 409,
129cdf0e10cSrcweir //-falls die noch einer braucht
130cdf0e10cSrcweir SFX_INTERFACE_APP = SFX_INTERFACE_SW_START,
131cdf0e10cSrcweir SFX_INTERFACE_LIB = 450
132cdf0e10cSrcweir };
133cdf0e10cSrcweir
134cdf0e10cSrcweir //TODO/CLEANUP: replace by UNO constant
135cdf0e10cSrcweir #define SVVERB_SHOW -1
136cdf0e10cSrcweir
137cdf0e10cSrcweir //====================================================================
138cdf0e10cSrcweir
139cdf0e10cSrcweir typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq);
140cdf0e10cSrcweir typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet);
141cdf0e10cSrcweir
142cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
143cdf0e10cSrcweir
144cdf0e10cSrcweir /* [Beschreibung]
145cdf0e10cSrcweir
146cdf0e10cSrcweir Die Klasse SfxShell ist Basisklasse f"ur alle Schichten, die
147cdf0e10cSrcweir Funktionalit"at Form von <Slot>s bereitstellen wollen.
148cdf0e10cSrcweir
149cdf0e10cSrcweir Jede Instanz hat einen Verweis auf eine Interface-Beschreibung, der
150cdf0e10cSrcweir mit <SfxShell::GetInterface()const> erh"altlich ist. Dieses Interface
151cdf0e10cSrcweir stellt die Verbindung zu konkreten Methoden her und enth"alt einige
152cdf0e10cSrcweir weitere beschreibende Daten f"ur Controller wie Menus und Toolboxen, aber
153cdf0e10cSrcweir auch f"ur die diversen APIs. Der Hautpteil der Interface-Beschreibung
154cdf0e10cSrcweir liegt in Form einer <Type-Library> vor, die mit dem <SVIDL-Compiler>
155cdf0e10cSrcweir aus einem IDL-File generiert wird. F"ur jede SfxShell-Subclass ist ein
156cdf0e10cSrcweir solches IDL-File zu schreiben.
157cdf0e10cSrcweir
158cdf0e10cSrcweir */
159cdf0e10cSrcweir
160cdf0e10cSrcweir {
161cdf0e10cSrcweir friend class SfxObjectItem;
162cdf0e10cSrcweir
163cdf0e10cSrcweir SfxShell_Impl* pImp;
164cdf0e10cSrcweir SfxItemPool* pPool;
165cdf0e10cSrcweir ::svl::IUndoManager* pUndoMgr;
166cdf0e10cSrcweir
167cdf0e10cSrcweir private:
168cdf0e10cSrcweir SfxShell( const SfxShell & ); // n.i.
169cdf0e10cSrcweir SfxShell& operator = ( const SfxShell & ); // n.i.
170cdf0e10cSrcweir
171cdf0e10cSrcweir protected:
172cdf0e10cSrcweir SfxShell();
173cdf0e10cSrcweir SfxShell( SfxViewShell *pViewSh );
174cdf0e10cSrcweir
175cdf0e10cSrcweir #ifndef _SFXSH_HXX
176cdf0e10cSrcweir SAL_DLLPRIVATE void SetViewShell_Impl( SfxViewShell* pView );
177cdf0e10cSrcweir SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId );
178cdf0e10cSrcweir SAL_DLLPRIVATE SfxShellObject* GetShellObj_Impl() const;
179cdf0e10cSrcweir SAL_DLLPRIVATE void SetShellObj_Impl( SfxShellObject* pObj );
180cdf0e10cSrcweir #endif
181cdf0e10cSrcweir
182cdf0e10cSrcweir public:
183cdf0e10cSrcweir TYPEINFO();
184cdf0e10cSrcweir virtual ~SfxShell();
185cdf0e10cSrcweir
186cdf0e10cSrcweir SfxBroadcaster* GetBroadcaster();
187cdf0e10cSrcweir
188cdf0e10cSrcweir // TODO/CLEANUP: still needed?!
189cdf0e10cSrcweir virtual SvGlobalName GetGlobalName() const;
190cdf0e10cSrcweir
191cdf0e10cSrcweir virtual SfxInterface* GetInterface() const;
GetStaticInterface()192cdf0e10cSrcweir static SfxInterface* GetStaticInterface() { return 0; }
193cdf0e10cSrcweir
194cdf0e10cSrcweir void SetName( const String &rName );
195cdf0e10cSrcweir const String& GetName() const;
196cdf0e10cSrcweir
197cdf0e10cSrcweir SfxViewShell* GetViewShell() const;
198cdf0e10cSrcweir
CallExec(SfxExecFunc pFunc,SfxRequest & rReq)199cdf0e10cSrcweir void CallExec( SfxExecFunc pFunc, SfxRequest &rReq )
200cdf0e10cSrcweir { (*pFunc)(this, rReq); }
CallState(SfxStateFunc pFunc,SfxItemSet & rSet)201cdf0e10cSrcweir void CallState( SfxStateFunc pFunc, SfxItemSet &rSet )
202cdf0e10cSrcweir { (*pFunc)(this, rSet); }
203cdf0e10cSrcweir
204cdf0e10cSrcweir static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
205cdf0e10cSrcweir static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
206cdf0e10cSrcweir
207cdf0e10cSrcweir const SfxPoolItem* GetSlotState( sal_uInt16 nSlotId, const SfxInterface *pIF = 0, SfxItemSet *pStateSet = 0 );
208cdf0e10cSrcweir const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, const SfxInterface *pIF = 0 );
209cdf0e10cSrcweir const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, sal_Bool bAsync );
210cdf0e10cSrcweir sal_uIntPtr ExecuteSlot( sal_uInt16 nSlot, sal_uInt16 nMemberId, SbxVariable& rRet, SbxBase* pArgs = 0 );
211cdf0e10cSrcweir
212cdf0e10cSrcweir inline SfxItemPool& GetPool() const;
213cdf0e10cSrcweir inline void SetPool( SfxItemPool *pNewPool ) ;
214cdf0e10cSrcweir
215cdf0e10cSrcweir virtual ::svl::IUndoManager*
216cdf0e10cSrcweir GetUndoManager();
217cdf0e10cSrcweir void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
218cdf0e10cSrcweir
219cdf0e10cSrcweir SfxRepeatTarget* GetRepeatTarget() const;
220cdf0e10cSrcweir void SetRepeatTarget( SfxRepeatTarget *pTarget );
221cdf0e10cSrcweir
222cdf0e10cSrcweir virtual void Invalidate(sal_uInt16 nId = 0);
223cdf0e10cSrcweir
224cdf0e10cSrcweir sal_Bool IsActive() const;
225cdf0e10cSrcweir virtual void Activate(sal_Bool bMDI);
226cdf0e10cSrcweir virtual void Deactivate(sal_Bool bMDI);
227cdf0e10cSrcweir virtual void ParentActivate();
228cdf0e10cSrcweir virtual void ParentDeactivate();
229cdf0e10cSrcweir
230cdf0e10cSrcweir SfxDispatcher* GetDispatcher() const;
231cdf0e10cSrcweir SfxViewFrame* GetFrame() const;
232cdf0e10cSrcweir ResMgr* GetResMgr() const;
233cdf0e10cSrcweir virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
234cdf0e10cSrcweir void UIFeatureChanged();
235cdf0e10cSrcweir
236cdf0e10cSrcweir // Items
237cdf0e10cSrcweir const SfxPoolItem* GetItem( sal_uInt16 nSlotId ) const;
238cdf0e10cSrcweir void PutItem( const SfxPoolItem& rItem );
239cdf0e10cSrcweir void RemoveItem( sal_uInt16 nSlotId );
240cdf0e10cSrcweir
241cdf0e10cSrcweir // TODO/CLEANUP: still needed?!
242cdf0e10cSrcweir void SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& aVerbs);
243cdf0e10cSrcweir const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& GetVerbs() const;
244cdf0e10cSrcweir void VerbExec (SfxRequest&);
245cdf0e10cSrcweir void VerbState (SfxItemSet&);
246cdf0e10cSrcweir SAL_DLLPRIVATE const SfxSlot* GetVerbSlot_Impl(sal_uInt16 nId) const;
247cdf0e10cSrcweir
248cdf0e10cSrcweir void SetHelpId(sal_uIntPtr nId);
249cdf0e10cSrcweir sal_uIntPtr GetHelpId() const;
250cdf0e10cSrcweir virtual SfxObjectShell* GetObjectShell();
251cdf0e10cSrcweir void SetDisableFlags( sal_uIntPtr nFlags );
252cdf0e10cSrcweir sal_uIntPtr GetDisableFlags() const;
253cdf0e10cSrcweir
254cdf0e10cSrcweir virtual SfxItemSet* CreateItemSet( sal_uInt16 nId );
255cdf0e10cSrcweir virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet );
256cdf0e10cSrcweir
2572a3f8a0eSAndre Fischer /** Set the name of the sidebar context that is broadcast on calls
2582a3f8a0eSAndre Fischer to Activation().
2592a3f8a0eSAndre Fischer */
2602a3f8a0eSAndre Fischer void SetContextName (const ::rtl::OUString& rsContextName);
2612a3f8a0eSAndre Fischer
2622a3f8a0eSAndre Fischer /** Broadcast a sidebar context change.
2632a3f8a0eSAndre Fischer This method is typically called from Activate() or
2642a3f8a0eSAndre Fischer Deactivate().
2652a3f8a0eSAndre Fischer @param bIsActivated
2662a3f8a0eSAndre Fischer When <TRUE/> then broadcast the context name that was
2672a3f8a0eSAndre Fischer defined with an earlier call to SetContextName().
2682a3f8a0eSAndre Fischer When <FALSE/> then broadcast the 'default' context.
2692a3f8a0eSAndre Fischer */
2702a3f8a0eSAndre Fischer void BroadcastContextForActivation (const bool bIsActivated);
271*8a5c5726SAndre Fischer
272*8a5c5726SAndre Fischer /** Enabled or disable the context broadcaster. Returns the old state.
273*8a5c5726SAndre Fischer */
274*8a5c5726SAndre Fischer bool SetContextBroadcasterEnabled (const bool bIsEnabled);
275*8a5c5726SAndre Fischer
276cdf0e10cSrcweir #ifndef _SFXSH_HXX
277cdf0e10cSrcweir SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot );
278cdf0e10cSrcweir SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI);
279cdf0e10cSrcweir SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI);
280cdf0e10cSrcweir #endif
281cdf0e10cSrcweir };
282cdf0e10cSrcweir
283cdf0e10cSrcweir //--------------------------------------------------------------------
GetPool() const284cdf0e10cSrcweir SfxItemPool& SfxShell::GetPool() const
285cdf0e10cSrcweir /*
286cdf0e10cSrcweir [Beschreibung]
287cdf0e10cSrcweir
288cdf0e10cSrcweir Jede Subclass von SfxShell mu"s einen Pool referenzieren. Dieser
289cdf0e10cSrcweir wird teilweise von SFx-eigenen Subklassen gesetzt (z.B. <SfxViewShell>),
290cdf0e10cSrcweir mu"s aber insbesondere bei direkt von SfxShell abgeleiteten Klassen
291cdf0e10cSrcweir und bei Ableitungen von SfxObjectShell selbst gesetzt werden.
292cdf0e10cSrcweir
293cdf0e10cSrcweir Die Klasse SfxShell selbst hat noch keinen SfxItemPool, es wird
294cdf0e10cSrcweir daher ein 0-Pointer zur"uckgeliefert.
295cdf0e10cSrcweir */
296cdf0e10cSrcweir
297cdf0e10cSrcweir {
298cdf0e10cSrcweir DBG_ASSERT( pPool, "no pool" );
299cdf0e10cSrcweir return *pPool;
300cdf0e10cSrcweir }
301cdf0e10cSrcweir //-------------------------------------------------------------------
SetPool(SfxItemPool * pNewPool)302cdf0e10cSrcweir inline void SfxShell::SetPool
303cdf0e10cSrcweir (
304cdf0e10cSrcweir SfxItemPool* pNewPool // Pointer auf den neuen Pool oder 0
305cdf0e10cSrcweir )
306cdf0e10cSrcweir
307cdf0e10cSrcweir /* [Beschreibung]
308cdf0e10cSrcweir
309cdf0e10cSrcweir Mit dieser Methode melden die Subklassen ihren speziellen <SfxItemPool>
310cdf0e10cSrcweir an der SfxShell an. Jede SfxShell Instanz mu\s Zugriff auf einen
311cdf0e10cSrcweir SfxItemPool haben. In der Regel ist dies der SfxItemPool der
312cdf0e10cSrcweir SfxDocumentShell. Die SfxShell Subklasse "ubernimmt nicht die
313cdf0e10cSrcweir Eigent"umerschaft "uber den "ubergebenen Pool. Bevor er gel"oscht
314cdf0e10cSrcweir wirde, mu\s er mit SetPool(0) abgemeldet werden.
315cdf0e10cSrcweir */
316cdf0e10cSrcweir
317cdf0e10cSrcweir {
318cdf0e10cSrcweir pPool = pNewPool;
319cdf0e10cSrcweir }
320cdf0e10cSrcweir
321cdf0e10cSrcweir //=====================================================================
322cdf0e10cSrcweir
323cdf0e10cSrcweir #define SFX_ARGUMENTMAP(ShellClass) static SfxFormalArgument __FAR_DATA a##ShellClass##Args_Impl[] =
324cdf0e10cSrcweir
325cdf0e10cSrcweir #define SFX_SLOTMAP(ShellClass) static SfxFormalArgument __FAR_DATA a##ShellClass##Args_Impl[1]; \
326cdf0e10cSrcweir static SfxSlot __FAR_DATA a##ShellClass##Slots_Impl[] =
327cdf0e10cSrcweir
328cdf0e10cSrcweir #define SFX_SLOTMAP_ARG(ShellClass) static SfxSlot __FAR_DATA a##ShellClass##Slots_Impl[] =
329cdf0e10cSrcweir
330cdf0e10cSrcweir #define SFX_DECL_INTERFACE(nId) \
331cdf0e10cSrcweir static SfxInterface* pInterface; \
332cdf0e10cSrcweir private: \
333cdf0e10cSrcweir static void InitInterface_Impl(); \
334cdf0e10cSrcweir public: \
335cdf0e10cSrcweir static const SfxFormalArgument* pSfxFormalArgs_Impl; \
336cdf0e10cSrcweir static SfxInterface* GetStaticInterface(); \
337cdf0e10cSrcweir static SfxInterfaceId GetInterfaceId() {return SfxInterfaceId(nId);} \
338cdf0e10cSrcweir static void RegisterInterface(SfxModule* pMod=NULL); \
339cdf0e10cSrcweir virtual SfxInterface* GetInterface() const;
340cdf0e10cSrcweir
341cdf0e10cSrcweir #define SFX_IMPL_INTERFACE(Class,SuperClass,NameResId) \
342cdf0e10cSrcweir \
343cdf0e10cSrcweir SfxInterface* Class::pInterface = 0; \
344cdf0e10cSrcweir const SfxFormalArgument* Class::pSfxFormalArgs_Impl = a##Class##Args_Impl;\
345cdf0e10cSrcweir SfxInterface* __EXPORT Class::GetStaticInterface() \
346cdf0e10cSrcweir { \
347cdf0e10cSrcweir if ( !pInterface ) \
348cdf0e10cSrcweir { \
349cdf0e10cSrcweir pInterface = \
350cdf0e10cSrcweir new SfxInterface( \
351cdf0e10cSrcweir #Class, NameResId, GetInterfaceId(), \
352cdf0e10cSrcweir SuperClass::GetStaticInterface(), \
353cdf0e10cSrcweir a##Class##Slots_Impl[0], \
354cdf0e10cSrcweir (sal_uInt16) (sizeof(a##Class##Slots_Impl) / sizeof(SfxSlot) ) ); \
355cdf0e10cSrcweir InitInterface_Impl(); \
356cdf0e10cSrcweir } \
357cdf0e10cSrcweir return pInterface; \
358cdf0e10cSrcweir } \
359cdf0e10cSrcweir \
360cdf0e10cSrcweir SfxInterface* Class::GetInterface() const \
361cdf0e10cSrcweir { \
362cdf0e10cSrcweir return GetStaticInterface(); \
363cdf0e10cSrcweir } \
364cdf0e10cSrcweir \
365cdf0e10cSrcweir void Class::RegisterInterface(SfxModule* pMod) \
366cdf0e10cSrcweir { \
367cdf0e10cSrcweir GetStaticInterface()->Register(pMod); \
368cdf0e10cSrcweir } \
369cdf0e10cSrcweir \
370cdf0e10cSrcweir void Class::InitInterface_Impl()
371cdf0e10cSrcweir
372cdf0e10cSrcweir #define SFX_POSITION_MASK 0x000F
373cdf0e10cSrcweir #define SFX_VISIBILITY_MASK 0xFFF0
374cdf0e10cSrcweir #define SFX_VISIBILITY_UNVISIBLE 0x0000 // nie sichtbar
375cdf0e10cSrcweir #define SFX_VISIBILITY_PLUGSERVER 0x0010
376cdf0e10cSrcweir #define SFX_VISIBILITY_PLUGCLIENT 0x0020
377cdf0e10cSrcweir #define SFX_VISIBILITY_VIEWER 0x0040
378cdf0e10cSrcweir // noch 1 sind frei!
379cdf0e10cSrcweir #define SFX_VISIBILITY_RECORDING 0x0200
380cdf0e10cSrcweir #define SFX_VISIBILITY_READONLYDOC 0x0400
381cdf0e10cSrcweir #define SFX_VISIBILITY_DESKTOP 0x0800
382cdf0e10cSrcweir #define SFX_VISIBILITY_STANDARD 0x1000
383cdf0e10cSrcweir #define SFX_VISIBILITY_FULLSCREEN 0x2000
384cdf0e10cSrcweir #define SFX_VISIBILITY_CLIENT 0x4000
385cdf0e10cSrcweir #define SFX_VISIBILITY_SERVER 0x8000
386cdf0e10cSrcweir #define SFX_VISIBILITY_NOCONTEXT 0xFFFF // immer sichtbar
387cdf0e10cSrcweir
388cdf0e10cSrcweir #define SFX_OBJECTBAR_REGISTRATION(nPos,rResId) \
389cdf0e10cSrcweir GetStaticInterface()->RegisterObjectBar( nPos, rResId )
390cdf0e10cSrcweir
391cdf0e10cSrcweir #define SFX_FEATURED_OBJECTBAR_REGISTRATION(nPos,rResId,nFeature) \
392cdf0e10cSrcweir GetStaticInterface()->RegisterObjectBar( nPos, rResId, nFeature )
393cdf0e10cSrcweir
394cdf0e10cSrcweir #define SFX_CHILDWINDOW_REGISTRATION(nId) \
395cdf0e10cSrcweir GetStaticInterface()->RegisterChildWindow( nId, (sal_Bool) sal_False )
396cdf0e10cSrcweir
397cdf0e10cSrcweir #define SFX_FEATURED_CHILDWINDOW_REGISTRATION(nId,nFeature) \
398cdf0e10cSrcweir GetStaticInterface()->RegisterChildWindow( nId, (sal_Bool) sal_False, nFeature )
399cdf0e10cSrcweir
400cdf0e10cSrcweir #define SFX_CHILDWINDOW_CONTEXT_REGISTRATION(nId) \
401cdf0e10cSrcweir GetStaticInterface()->RegisterChildWindow( nId, (sal_Bool) sal_True )
402cdf0e10cSrcweir
403cdf0e10cSrcweir #define SFX_POPUPMENU_REGISTRATION(rResId) \
404cdf0e10cSrcweir GetStaticInterface()->RegisterPopupMenu( rResId )
405cdf0e10cSrcweir
406cdf0e10cSrcweir #define SFX_OBJECTMENU_REGISTRATION(nPos,rResId) \
407cdf0e10cSrcweir GetStaticInterface()->RegisterObjectMenu( nPos, rResId )
408cdf0e10cSrcweir
409cdf0e10cSrcweir #define SFX_STATUSBAR_REGISTRATION(rResId) \
410cdf0e10cSrcweir GetStaticInterface()->RegisterStatusBar( rResId )
411cdf0e10cSrcweir
412cdf0e10cSrcweir #endif
413cdf0e10cSrcweir
414