Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_SFX2_SHELL_HXX
20 : #define INCLUDED_SFX2_SHELL_HXX
21 :
22 : #include <com/sun/star/embed/VerbDescriptor.hpp>
23 : #include <rtl/ustring.hxx>
24 : #include <sal/config.h>
25 : #include <sal/types.h>
26 : #include <sfx2/dllapi.h>
27 : #include <sfx2/sfxuno.hxx>
28 : #include <svl/SfxBroadcaster.hxx>
29 : #include <tools/rtti.hxx>
30 :
31 : class ResMgr;
32 : namespace vcl { class Window; }
33 : class ToolBox;
34 : class SfxItemPool;
35 : class SfxPoolItem;
36 : class SfxRequest;
37 : class SfxItemSet;
38 : struct SfxFormalArgument;
39 : class StatusBar;
40 : class SfxInterface;
41 : class SfxViewShell;
42 : class SfxObjectShell;
43 : class SfxSlotPool;
44 : class SvGlobalName;
45 :
46 : class SfxShellObject;
47 : class SfxShell;
48 : struct SfxShell_Impl;
49 : class SfxShellObject;
50 : class SfxDispatcher;
51 : class SfxViewFrame;
52 : class SfxSlot;
53 : class SfxRepeatTarget;
54 : class SbxVariable;
55 : class SbxBase;
56 : class SfxBindings;
57 :
58 : namespace svl
59 : {
60 : class IUndoManager;
61 : }
62 :
63 : /**
64 : Id for <SfxInterface>s, gives a quasi-static access to the interface
65 : through an array to <SfxApplication>.
66 : */
67 : enum SfxInterfaceId
68 : {
69 : SFX_INTERFACE_NONE,
70 : SFX_INTERFACE_SFXAPP,
71 : SFX_INTERFACE_SFXDOCSH,
72 : SFX_INTERFACE_SFXIPFRM,
73 : SFX_INTERFACE_SFXVIEWSH,
74 : SFX_INTERFACE_SFXVIEWFRM,
75 : SFX_INTERFACE_SFXPLUGINFRM,
76 : SFX_INTERFACE_SFXPLUGINOBJ,
77 : SFX_INTERFACE_SFXPLUGINVIEWSH,
78 : SFX_INTERFACE_SFXFRAMESETOBJ,
79 : SFX_INTERFACE_SFXFRAMESETVIEWSH,
80 : SFX_INTERFACE_SFXINTERNALFRM,
81 : SFX_INTERFACE_SFXCOMPONENTDOCSH,
82 : SFX_INTERFACE_SFXGENERICOBJ,
83 : SFX_INTERFACE_SFXGENERICVIEWSH,
84 : SFX_INTERFACE_SFXEXPLOBJ,
85 : SFX_INTERFACE_SFXEXPLVIEWSH,
86 : SFX_INTERFACE_SFXPLUGINVIEWSHDYNAMIC,
87 : SFX_INTERFACE_SFXEXTERNALVIEWFRM,
88 : SFX_INTERFACE_SFXMODULE,
89 : SFX_INTERFACE_SFXFRAMESETVIEW,
90 : SFX_INTERFACE_SFXFRAMESETSOURCEVIEW,
91 : SFX_INTERFACE_SFXHELP_DOCSH,
92 : SFX_INTERFACE_SFXHELP_VIEWSH,
93 : SFX_INTERFACE_SFXTASK,
94 : SFX_INTERFACE_OFA_START = 100,
95 : SFX_INTERFACE_OFA_END = 100,
96 : SFX_INTERFACE_SC_START = 150,
97 : SFX_INTERFACE_SC_END = 199,
98 : SFX_INTERFACE_SD_START = 200,
99 : SFX_INTERFACE_SD_END = 249,
100 : SFX_INTERFACE_SW_START = 250,
101 : SFX_INTERFACE_SW_END = 299,
102 : SFX_INTERFACE_SIM_START = 300,
103 : SFX_INTERFACE_SIM_END = 319,
104 : SFX_INTERFACE_SCH_START = 320,
105 : SFX_INTERFACE_SCH_END = 339,
106 : SFX_INTERFACE_SMA_START = 340,
107 : SFX_INTERFACE_SMA_END = 359,
108 : SFX_INTERFACE_SBA_START = 360,
109 : SFX_INTERFACE_SBA_END = 399,
110 : SFX_INTERFACE_IDE_START = 400,
111 : SFX_INTERFACE_IDE_END = 409,
112 : //-if one is still needed
113 : SFX_INTERFACE_APP = SFX_INTERFACE_SW_START,
114 : SFX_INTERFACE_LIB = 450
115 : };
116 :
117 : //TODO/CLEANUP: replace by UNO constant
118 : #define SVVERB_SHOW -1
119 :
120 : typedef void (*SfxExecFunc)(SfxShell *, SfxRequest &rReq);
121 : typedef void (*SfxStateFunc)(SfxShell *, SfxItemSet &rSet);
122 :
123 : /**
124 : The class SfxShell is the base class for all classes, which provide
125 : the functionality of the form <Slot>s.
126 :
127 : Each instance has a reference to an interface description, which is
128 : obtainable through <SfxShell::GetInterface()const>. This interface
129 : provides the connection to specific methods and contains some other
130 : descriptive data for controllers like menus and toolboxes, but also
131 : for the various APIs. The main part of the interface description is in
132 : the form of a <Type-Library>, which is generated from an IDL-file by
133 : the <SVIDL-Compiler>. For each SfxShell Subclass-File there is one
134 : such IDL-file to write.
135 : */
136 : class SFX2_DLLPUBLIC SfxShell: public SfxBroadcaster
137 : {
138 : friend class SfxObjectItem;
139 :
140 : SfxShell_Impl* pImp;
141 : SfxItemPool* pPool;
142 : ::svl::IUndoManager* pUndoMgr;
143 :
144 : private:
145 : SfxShell( const SfxShell & ); // internal
146 : SfxShell& operator = ( const SfxShell & ); // internal
147 :
148 : protected:
149 : /**
150 : The constructor of the SfxShell class initializes only simple types,
151 : the corresponding SbxObject is only created on-demand. Therefore,
152 : the application of a SfxShell instance is very cheap.
153 : */
154 : SfxShell();
155 :
156 : /**
157 : The constructor of the SfxShell class initializes only simple types,
158 : the corresponding SbxObject is only created on-demand. Therefore,
159 : the application of a SfxShell instance is very cheap.
160 : */
161 : SfxShell( SfxViewShell *pViewSh );
162 :
163 : void SetViewShell_Impl( SfxViewShell* pView );
164 : SAL_DLLPRIVATE void Invalidate_Impl( SfxBindings& rBindings, sal_uInt16 nId );
165 : SAL_DLLPRIVATE SfxShellObject* GetShellObj_Impl() const;
166 : SAL_DLLPRIVATE void SetShellObj_Impl( SfxShellObject* pObj );
167 :
168 : public:
169 : TYPEINFO_OVERRIDE();
170 :
171 : /**
172 : The connection to a possible corresponding SbxObject is dissolved.
173 : The SbxObject may continoue to exist, but can not any longer perform
174 : any functions and can not provide any properties.
175 : */
176 : virtual ~SfxShell();
177 :
178 : /**
179 : With this virtual method, which is automatically overloaded by each subclass
180 : with its own slots through the macro <SFX_DECL_INTERFACE>, one can access
181 : each of the <SfxInterface> instance beloning to the subclass.
182 :
183 : The class SfxShell itself has no own SfxInterface (no slots), therefore a
184 : NULL-pointer is returned.
185 : */
186 : virtual SfxInterface* GetInterface() const;
187 3257 : static SfxInterface* GetStaticInterface() { return 0; }
188 :
189 : /**
190 : Sets the name of the Shell object. With this name, the SfxShell instance
191 : of BASIC can be expressed.
192 : */
193 : void SetName( const OUString &rName );
194 :
195 : /**
196 : Returns the name of the Shell object. With this name, the SfxShell instance
197 : of BASIC can be expressed.
198 : */
199 : const OUString& GetName() const;
200 :
201 : /**
202 : Returns the SfxViewShell in which they are located in the subshells.
203 : Otherwise, and if not specified by the App developer, this method
204 : returns NULL.
205 : */
206 : SfxViewShell* GetViewShell() const;
207 :
208 1816 : void CallExec( SfxExecFunc pFunc, SfxRequest &rReq )
209 1816 : { (*pFunc)(this, rReq); }
210 162005 : void CallState( SfxStateFunc pFunc, SfxItemSet &rSet )
211 162005 : { (*pFunc)(this, rSet); }
212 :
213 : static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
214 : static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
215 :
216 : /**
217 : This method returns the status of the slot with the specified slot ID
218 : on the specified interface.
219 :
220 : If the slot is disabled or in this SfxShell (and their parent shells) are
221 : not known, a Null-pointer is returned.
222 :
223 : If the slot does not have a Status, a SfxVoidItem is returned.
224 :
225 : The status is set directly in this Set when pStateSet != 0 , so that
226 : overloaded Slots of the <SfxShell> Subclasses and also in the Status
227 : method of the base implementation can be called.
228 :
229 : [Example]
230 :
231 : In a derived class of SfxViewShell the SID_PRINTDOCDIRECT will be
232 : intercepted. Under certain circumstances a query should appear before
233 : you print, and the request will be aborted if necessary.
234 :
235 : Also in the IDL of this subclass of the above slot is entered. The status
236 : method will contain in outline:
237 :
238 : void SubViewShell::PrintState( SfxItemSet &rState )
239 : {
240 : if ( rState.GetItemState( SID_PRINTDOCDIRECT ) != SfxItemState::UNKNOWN )
241 : GetSlotState( SID_PRINTDOCDIRECT, SfxViewShell::GetInterface(),
242 : &rState );
243 : ...
244 : }
245 :
246 : [Cross-reference]
247 :
248 : <SfxShell::ExecuteSlot(SfxRequest&)>
249 : */
250 : const SfxPoolItem* GetSlotState( sal_uInt16 nSlotId, const SfxInterface *pIF = 0, SfxItemSet *pStateSet = 0 );
251 :
252 : /**
253 : This method allows you to forward a <SfxRequest> to the specified
254 : base <SfxShell>.
255 :
256 : [Example]
257 :
258 : In a derived class of SfxViewShell the SID_PRINTDOCDIRECT will be
259 : intercepted. Under certain circumstances a query should appear before
260 : you print, and the request will be aborted if necessary.
261 :
262 : Also in the IDL of this subclass of the above slot is entered. The status
263 : method will contain in outline:
264 :
265 : void SubViewShell::Exec( SfxRequest &rReq )
266 : {
267 : if ( rReq.GetSlot() == SID_PRINTDOCDIRECT )
268 : {
269 : 'dialog'
270 : if ( 'condition' )
271 : ExecuteSlot( rReq, SfxViewShell::GetInterface() );
272 : }
273 : }
274 :
275 : It usually takes no rReq.Done() to be called as that is already completed
276 : in implementation of the SfxViewShell, for instance it has been canceled.
277 :
278 : [Cross-reference]
279 :
280 : <SfxShell::GetSlotState(sal_uInt16,const SfxInterface*,SfxItemSet*)>
281 : */
282 : const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, const SfxInterface *pIF = 0 );
283 :
284 : /**
285 : Asynchronous ExecuteSlot for the RELOAD
286 : */
287 : const SfxPoolItem* ExecuteSlot( SfxRequest &rReq, bool bAsync );
288 : sal_uIntPtr ExecuteSlot( sal_uInt16 nSlot, sal_uInt16 nMemberId, SbxVariable& rRet, SbxBase* pArgs = 0 );
289 :
290 : inline SfxItemPool& GetPool() const;
291 : inline void SetPool( SfxItemPool *pNewPool ) ;
292 :
293 : /**
294 : Each Subclass of SfxShell can hava a <SfxUndoManager>. This can be set in
295 : the derived class with <SfxShell:SetUndoManager()>.
296 :
297 : The class SfxShell itself does not have a SfxUndoManager, a NULL-pointer
298 : is therefore returned.
299 : */
300 : virtual ::svl::IUndoManager* GetUndoManager();
301 :
302 : /**
303 : Sets a <SfxUndoManager> for this <SfxShell> Instance. For the undo
304 : is only the undo-manager used for SfxShell at the top of the stack of each
305 : <SfxDispatcher>.
306 :
307 : On the given <SfxUndoManager> is automatically the current
308 : Max-Undo-Action-Count setting set form the options.
309 :
310 : 'pNewUndoMgr' must exist until the Destuctor of SfxShell instance is called
311 : or until the next 'SetUndoManager()'.
312 : */
313 : void SetUndoManager( ::svl::IUndoManager *pNewUndoMgr );
314 :
315 : /**
316 : Returns a pointer to the <SfxRepeatTarget> instance that is used in
317 : SID_REPEAT as repeat target when it is addressed from the <SfxUndoManager>
318 : supplied by this SfxShell. The return value can be NULL.
319 :
320 : [Note]
321 :
322 : A derivation of <SfxShell> or one of its subclasses of <SfxRepeatTarget>
323 : is not recommended, as compiler errors are provoked.
324 : (due to Call-to-Pointer-to-Member-Function to the subclass).
325 : */
326 : SfxRepeatTarget* GetRepeatTarget() const;
327 :
328 : /**
329 : Sets the <SfxRepeatTarget> instance that is used in SID_REPEAT as
330 : RepeatTarget, when the current supplied by this <SfxUndoManager> is
331 : addressed. By 'pTarget==0' the SID_REPEAT is disabled for this SfxShell.
332 : The instance '*pTarget' must live as long as it is registered.
333 :
334 : [Note]
335 :
336 : A derivation of <SfxShell> or one of its subclasses of <SfxRepeatTarget>
337 : is not recommended, as compiler errors are provoked.
338 : (due to Call-to-Pointer-to-Member-Function to the subclass).
339 : */
340 : void SetRepeatTarget( SfxRepeatTarget *pTarget );
341 :
342 : /**
343 : With this method can the slots of the subclasses be invalidated through the
344 : slot Id or alternatively through the Which ID. Slot IDs, which are
345 : inherited by the subclass are also invalidert.
346 :
347 : [Cross-reference]
348 :
349 : <SfxBindings::Invalidate(sal_uInt16)>
350 : <SfxBindings::InvalidateAll(sal_Bool)>
351 : */
352 : virtual void Invalidate(sal_uInt16 nId = 0);
353 :
354 0 : virtual bool IsDesignMode() const { return false; };
355 :
356 : bool IsActive() const;
357 :
358 : /**
359 : Virtual method that is called when enabling the SfxShell instance,
360 : in order to give the Subclasses the opportunity to respond to the
361 : to the enabling.
362 :
363 : [Cross-reference]
364 :
365 : StarView SystemWindow::Activate(bool)
366 : */
367 : virtual void Activate(bool bMDI);
368 :
369 : /**
370 : Virtual method that is called when disabling the SfxShell instance,
371 : to give the Subclasses the opportunity to respond to the disabling.
372 :
373 : [Cross-reference]
374 :
375 : StarView SystemWindow::Dectivate(bool)
376 : */
377 : virtual void Deactivate(bool bMDI);
378 :
379 : /**
380 : A parent of the <SfxDispatcher> on which the SfxShell is located, has
381 : become active, or the SfxShell instance was pushed on a <SfxDispatcher>,
382 : which parent is active.
383 :
384 : The base implementation is empty and does not need to be called.
385 :
386 : [Cross-reference]
387 :
388 : SfxShell::Activate()
389 : */
390 : virtual void ParentActivate();
391 :
392 : /**
393 : The active parent of the <SfxDispatcher> on which the SfxShell is located,
394 : has been disabled.
395 :
396 : The base implementation is empty and does not need to be called.
397 :
398 : [Cross-reference]
399 :
400 : SfxShell::Deactivate()
401 : */
402 : virtual void ParentDeactivate();
403 :
404 : /**
405 : This method returns a pointer to the <SfxDispatcher>, when the SfxShell
406 : is currently <UI-active> or a NULL-pointer if it is not UI-active.
407 :
408 : The returned pointer is only valid in the immediate context of the method
409 : call.
410 : */
411 : SfxDispatcher* GetDispatcher() const;
412 :
413 : /**
414 : This method returns a pointer to the <SfxViewFrame> to which this SfxShell
415 : instance is associated or in which they currently is <UI-active>.
416 : A NULL pointer is returned if this SfxShell instance is not UI-active at
417 : the moment and also no SfxViewFrame is permanently assigned.
418 :
419 : The returned pointer is only valid in the immediate context of the method
420 : call.
421 :
422 : [Note]
423 :
424 : Only instances of a subclass of SfxApplication and SfxObjectShell
425 : should here provide a NULL-pointer. Otherwise, there is an error in the
426 : application program (wrong constructor was called from SfxShell).
427 :
428 : [Cross-reference]
429 :
430 : <SfxViewShell::GetViewFrame()const>
431 : */
432 : SfxViewFrame* GetFrame() const;
433 :
434 : /**
435 : This method provides the ResMgr of the <Resource-DLL> that are used by
436 : the SfxShell instance. If this is a NULL-pointer, then the current
437 : resource manager is to be used.
438 : */
439 : ResMgr* GetResMgr() const;
440 : virtual bool HasUIFeature( sal_uInt32 nFeature );
441 : void UIFeatureChanged();
442 :
443 : // Items
444 : /**
445 : With this method any objects of <SfxPoolItemu> subclasses can be accessed.
446 : This exchange method is needed if, for example special <SfxToolBoxControl>
447 : subclasses need access to certain data such as the <SfxObjectShell>.
448 :
449 : The returned instance belongs to the particular SfxShell and may be
450 : used only in the immediate context of the method call.
451 :
452 : [Cross-reference]
453 :
454 : <SfxShell::PutItem(const SfxPoolItem&)>
455 : <SfxShell::RemoveItem(sal_uInt16)>
456 : */
457 : const SfxPoolItem* GetItem( sal_uInt16 nSlotId ) const;
458 :
459 : /**
460 : With this method, any objects of subclasses of <SfxPoolItem> can be made
461 : available. This exchange technology is needed if, for example, special
462 : <SfxToolBoxControl> Subclasses need access to certain data such as the
463 : <SfxObjectShell>
464 :
465 : If a SfxPoolItem exists with the same slot ID, it is deleted automatically.
466 :
467 : [Cross-reference]
468 :
469 : <SfxShell::RemoveItem(sal_uInt16)>
470 : <SfxShell::GetItem(sal_uInt16)>
471 : */
472 : void PutItem( const SfxPoolItem& rItem );
473 :
474 : // TODO/CLEANUP: still needed?!
475 : void SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& aVerbs);
476 : const com::sun::star::uno::Sequence < com::sun::star::embed::VerbDescriptor >& GetVerbs() const;
477 : void VerbExec (SfxRequest&);
478 : void VerbState (SfxItemSet&);
479 : SAL_DLLPRIVATE const SfxSlot* GetVerbSlot_Impl(sal_uInt16 nId) const;
480 :
481 : void SetHelpId(sal_uIntPtr nId);
482 : sal_uIntPtr GetHelpId() const;
483 : virtual SfxObjectShell* GetObjectShell();
484 : void SetDisableFlags( sal_uIntPtr nFlags );
485 : sal_uIntPtr GetDisableFlags() const;
486 :
487 : virtual SfxItemSet* CreateItemSet( sal_uInt16 nId );
488 : virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet );
489 :
490 : /** Set the name of the sidebar context that is broadcast on calls
491 : to Activation().
492 : */
493 : void SetContextName (const ::rtl::OUString& rsContextName);
494 :
495 : /** Broadcast a sidebar context change.
496 : This method is typically called from Activate() or
497 : Deactivate().
498 : @param bIsActivated
499 : When <TRUE/> then broadcast the context name that was
500 : defined with an earlier call to SetContextName().
501 : When <FALSE/> then broadcast the 'default' context.
502 : */
503 : void BroadcastContextForActivation (const bool bIsActivated);
504 :
505 : /** Enabled or disable the context broadcaster. Returns the old state.
506 : */
507 : bool SetContextBroadcasterEnabled (const bool bIsEnabled);
508 :
509 : /**
510 :
511 : This method determines by calling the status function whether 'rSlot'
512 : can be executed currently.
513 : */
514 : SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot );
515 :
516 : /**
517 :
518 : This method controls the activation of SfxShell instance. First, by calling
519 : the virtual method <SfxShell::Activate(sal_Bool)> which gives the subclass the
520 : opportunity to respond to the event.
521 :
522 : When bMDI == TRUE, the associated SbxObject is being 'armed', so that
523 : unqualified methods of the object (without the name of the object)
524 : from BASIC are found.
525 : */
526 : SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, bool bMDI);
527 :
528 : /**
529 :
530 : This method controls the deactivation of the SfxShell instance. When
531 : bMDI == TRUE the SbxObject is first set to a status that only qualified
532 : BASIC methods can be called.
533 :
534 : Then the subclass gets the opportunity in every case to respond to the
535 : event by calling the virtual method <SfxShell::Deactivate(sal_Bool)>.
536 : */
537 : SAL_DLLPRIVATE void DoDeactivate_Impl( SfxViewFrame *pFrame, bool bMDI);
538 : };
539 :
540 : /**
541 : Each Subclass of SfxShell must reference a pool. This is partly set by
542 : SFx's own set of subclasses (eg <SfxViewShell>). In particular however
543 : this must be set directly from one derived SfxShell class and ny
544 : derivatives of SfxObjectShell.
545 :
546 : The SfxShell class itself does not have any SfxItemPool, therfore a
547 : null-pointer is returned.
548 : */
549 392555 : SfxItemPool& SfxShell::GetPool() const
550 : {
551 : assert(pPool && "no pool");
552 392555 : return *pPool;
553 : }
554 :
555 : /**
556 : With this method, the subclasses register their special <SfxItemPool>
557 : in the SfxShell. Each SfxShell instance must have access to a SfxItemPool.
558 : Usually this is the SfxItemPool of the SfxDocumentShell. The SfxShell
559 : subclass does not take ownership of the orphaned pool. Before it is
560 : deleted it has to be deregisted with SetPool(0).
561 : */
562 45987 : inline void SfxShell::SetPool
563 : (
564 : SfxItemPool* pNewPool // Pointer to the new Pool or null
565 : )
566 : {
567 45987 : pPool = pNewPool;
568 45987 : }
569 :
570 : #define SFX_SLOTMAP(ShellClass) static SfxSlot a##ShellClass##Slots_Impl[] =
571 :
572 : #define SFX_DECL_INTERFACE(nId) \
573 : static SfxInterface* pInterface; \
574 : static SfxInterface* GetStaticInterface(); \
575 : static SfxInterfaceId GetInterfaceId() {return SfxInterfaceId(nId);} \
576 : static void RegisterInterface(SfxModule* pMod=NULL); \
577 : virtual SfxInterface* GetInterface() const SAL_OVERRIDE;
578 :
579 : #define SFX_IMPL_INTERFACE(Class,SuperClass,NameResId) \
580 : \
581 : SfxInterface* Class::pInterface = 0; \
582 : SfxInterface* Class::GetStaticInterface() \
583 : { \
584 : if ( !pInterface ) \
585 : { \
586 : pInterface = \
587 : new SfxInterface( \
588 : #Class, NameResId, GetInterfaceId(), \
589 : SuperClass::GetStaticInterface(), \
590 : a##Class##Slots_Impl[0], \
591 : (sal_uInt16) (sizeof(a##Class##Slots_Impl) / sizeof(SfxSlot) ) ); \
592 : InitInterface_Impl(); \
593 : } \
594 : return pInterface; \
595 : } \
596 : \
597 : SfxInterface* Class::GetInterface() const \
598 : { \
599 : return GetStaticInterface(); \
600 : } \
601 : \
602 : void Class::RegisterInterface(SfxModule* pMod) \
603 : { \
604 : GetStaticInterface()->Register(pMod); \
605 : }
606 :
607 : #define SFX_POSITION_MASK 0x000F
608 : #define SFX_VISIBILITY_MASK 0xFFF0
609 : #define SFX_VISIBILITY_UNVISIBLE 0x0000 // Never visible
610 : #define SFX_VISIBILITY_VIEWER 0x0040
611 : #define SFX_VISIBILITY_READONLYDOC 0x0400
612 : #define SFX_VISIBILITY_DESKTOP 0x0800
613 : #define SFX_VISIBILITY_STANDARD 0x1000
614 : #define SFX_VISIBILITY_FULLSCREEN 0x2000
615 : #define SFX_VISIBILITY_CLIENT 0x4000
616 : #define SFX_VISIBILITY_SERVER 0x8000
617 : #define SFX_VISIBILITY_NOCONTEXT 0xFFFF // Always visable
618 :
619 : #endif
620 :
621 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|