xref: /AOO41X/main/sfx2/inc/sfx2/module.hxx (revision 353d8f4d17010cd2d0ea815067cad67e477f2bee)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SFXMODULE_HXX
24cdf0e10cSrcweir #define _SFXMODULE_HXX	// intern
25cdf0e10cSrcweir #define _SFXMOD_HXX		// extern
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #include "sfx2/dllapi.h"
29cdf0e10cSrcweir #include <sfx2/shell.hxx>
30cdf0e10cSrcweir #include <sfx2/imgdef.hxx>
31cdf0e10cSrcweir #include <sal/types.h>
32cdf0e10cSrcweir #include <tools/fldunit.hxx>
33cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class ImageList;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class SfxBindings;
38cdf0e10cSrcweir class SfxObjectFactory;
39cdf0e10cSrcweir class ModalDialog;
40cdf0e10cSrcweir class SfxObjectFactory;
41cdf0e10cSrcweir class SfxModuleArr_Impl;
42cdf0e10cSrcweir class SfxModule_Impl;
43cdf0e10cSrcweir class SfxSlotPool;
44cdf0e10cSrcweir struct SfxChildWinContextFactory;
45cdf0e10cSrcweir struct SfxChildWinFactory;
46cdf0e10cSrcweir struct SfxMenuCtrlFactory;
47cdf0e10cSrcweir struct SfxStbCtrlFactory;
48cdf0e10cSrcweir struct SfxTbxCtrlFactory;
49cdf0e10cSrcweir class SfxTbxCtrlFactArr_Impl;
50cdf0e10cSrcweir class SfxChildWinFactArr_Impl;
51cdf0e10cSrcweir class SfxMenuCtrlFactArr_Impl;
52cdf0e10cSrcweir class SfxStbCtrlFactArr_Impl;
53cdf0e10cSrcweir class SfxTabPage;
54cdf0e10cSrcweir class Window;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace frame {
57cdf0e10cSrcweir     class XFrame;
58cdf0e10cSrcweir } } } }
59cdf0e10cSrcweir //====================================================================
60cdf0e10cSrcweir 
61cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxModule : public SfxShell
62cdf0e10cSrcweir {
63cdf0e10cSrcweir private:
64cdf0e10cSrcweir 	ResMgr*                     pResMgr;
65cdf0e10cSrcweir     sal_Bool                    bDummy : 1;
66cdf0e10cSrcweir 	SfxModule_Impl*             pImpl;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
69cdf0e10cSrcweir 	SAL_DLLPRIVATE void Construct_Impl();
70cdf0e10cSrcweir //#endif
71cdf0e10cSrcweir 
72cdf0e10cSrcweir public:
73cdf0e10cSrcweir 								TYPEINFO();
74cdf0e10cSrcweir 								SFX_DECL_INTERFACE(SFX_INTERFACE_SFXMODULE)
75cdf0e10cSrcweir 
76cdf0e10cSrcweir 								SfxModule( ResMgr* pMgrP, sal_Bool bDummy,
77cdf0e10cSrcweir 									SfxObjectFactory* pFactoryP, ... );
78cdf0e10cSrcweir 								~SfxModule();
79cdf0e10cSrcweir 
GetResMgr() const80cdf0e10cSrcweir     ResMgr*                     GetResMgr() const { return SfxShell::GetResMgr(); }
81cdf0e10cSrcweir     virtual ResMgr*             GetResMgr();
82cdf0e10cSrcweir 	SfxSlotPool*				GetSlotPool() const;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	void						RegisterToolBoxControl(SfxTbxCtrlFactory*);
85cdf0e10cSrcweir 	void                        RegisterChildWindow(SfxChildWinFactory*);
86cdf0e10cSrcweir 	void                        RegisterChildWindowContext( sal_uInt16,	SfxChildWinContextFactory* );
87cdf0e10cSrcweir 	void                        RegisterStatusBarControl(SfxStbCtrlFactory*);
88cdf0e10cSrcweir 	void                        RegisterMenuControl(SfxMenuCtrlFactory*);
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	virtual SfxTabPage*			CreateTabPage( sal_uInt16 nId,
91cdf0e10cSrcweir 											   Window* pParent,
92cdf0e10cSrcweir 											   const SfxItemSet& rSet );
93cdf0e10cSrcweir     virtual void                Invalidate(sal_uInt16 nId = 0);
94cdf0e10cSrcweir 	sal_Bool						IsActive() const;
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     /*virtual*/ bool            IsChildWindowAvailable( const sal_uInt16 i_nId, const SfxViewFrame* i_pViewFrame ) const;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir     static SfxModule*           GetActiveModule( SfxViewFrame* pFrame=NULL );
99cdf0e10cSrcweir 	static FieldUnit			GetCurrentFieldUnit();
100cdf0e10cSrcweir     /** retrieves the field unit of the module belonging to the document displayed in the given frame
101cdf0e10cSrcweir 
102cdf0e10cSrcweir         Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to
103cdf0e10cSrcweir         the document in this frame, then this module's field unit.
104cdf0e10cSrcweir 
105cdf0e10cSrcweir         Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned.
106cdf0e10cSrcweir      */
107cdf0e10cSrcweir     static FieldUnit            GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame );
108cdf0e10cSrcweir 	FieldUnit					GetFieldUnit() const;
109cdf0e10cSrcweir 
110cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
111cdf0e10cSrcweir     SAL_DLLPRIVATE static SfxModuleArr_Impl& GetModules_Impl();
112cdf0e10cSrcweir     SAL_DLLPRIVATE static void DestroyModules_Impl();
113cdf0e10cSrcweir     SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl* GetTbxCtrlFactories_Impl() const;
114cdf0e10cSrcweir     SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl* GetStbCtrlFactories_Impl() const;
115cdf0e10cSrcweir     SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl* GetMenuCtrlFactories_Impl() const;
116cdf0e10cSrcweir     SAL_DLLPRIVATE SfxChildWinFactArr_Impl* GetChildWinFactories_Impl() const;
117cdf0e10cSrcweir     SAL_DLLPRIVATE ImageList* GetImageList_Impl( sal_Bool bBig );
118cdf0e10cSrcweir     SAL_DLLPRIVATE ImageList* GetImageList_Impl( sal_Bool bBig, sal_Bool bHiContrast );
119cdf0e10cSrcweir //#endif
120cdf0e10cSrcweir };
121cdf0e10cSrcweir 
122cdf0e10cSrcweir #endif
123cdf0e10cSrcweir 
124