xref: /aoo41x/main/sfx2/source/appl/appreg.cxx (revision 3dcccbb6)
1cdf0e10cSrcweir /*************************************************************************
2cdf0e10cSrcweir  *
3cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4cdf0e10cSrcweir  *
5cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6cdf0e10cSrcweir  *
7cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8cdf0e10cSrcweir  *
9cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10cdf0e10cSrcweir  *
11cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14cdf0e10cSrcweir  *
15cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20cdf0e10cSrcweir  *
21cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25cdf0e10cSrcweir  *
26cdf0e10cSrcweir  ************************************************************************/
27cdf0e10cSrcweir 
28cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <vcl/toolbox.hxx>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #ifndef GCC
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <sfx2/app.hxx>
37cdf0e10cSrcweir #include "appdata.hxx"
38cdf0e10cSrcweir #include "arrdecl.hxx"
39cdf0e10cSrcweir #include "sfx2/sfxhelp.hxx"
40cdf0e10cSrcweir #include <sfx2/templdlg.hxx>
41cdf0e10cSrcweir #include "inettbc.hxx"
42cdf0e10cSrcweir #include "sfx2/stbitem.hxx"
43cdf0e10cSrcweir #include <sfx2/navigat.hxx>
44cdf0e10cSrcweir #include <sfx2/taskpane.hxx>
45cdf0e10cSrcweir #include <sfx2/module.hxx>
46cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
47cdf0e10cSrcweir #include "partwnd.hxx"
48cdf0e10cSrcweir #include <sfx2/sfxsids.hrc>
49cdf0e10cSrcweir #include "recfloat.hxx"
50cdf0e10cSrcweir #include <sfx2/objsh.hxx>
51cdf0e10cSrcweir #include <sfx2/viewsh.hxx>
52cdf0e10cSrcweir #include <sfx2/objface.hxx>
53*3dcccbb6SPedro Giffuni #include <sfx2/mnuitem.hxx>
54cdf0e10cSrcweir 
55cdf0e10cSrcweir //===================================================================
56cdf0e10cSrcweir 
57cdf0e10cSrcweir void SfxApplication::Registrations_Impl()
58cdf0e10cSrcweir {
59cdf0e10cSrcweir 	// Interfaces
60cdf0e10cSrcweir 	SfxApplication::RegisterInterface();
61cdf0e10cSrcweir 	SfxModule::RegisterInterface();
62cdf0e10cSrcweir 	SfxViewFrame::RegisterInterface();
63cdf0e10cSrcweir 	SfxObjectShell::RegisterInterface();
64cdf0e10cSrcweir 	SfxViewShell::RegisterInterface();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	// ChildWindows
67cdf0e10cSrcweir 	SfxRecordingFloatWrapper_Impl::RegisterChildWindow();
68cdf0e10cSrcweir 	SfxNavigatorWrapper::RegisterChildWindow( sal_False, NULL, SFX_CHILDWIN_NEVERHIDE );
69cdf0e10cSrcweir 	SfxPartChildWnd_Impl::RegisterChildWindow();
70cdf0e10cSrcweir 	SfxTemplateDialogWrapper::RegisterChildWindow(sal_True);
71cdf0e10cSrcweir 	SfxDockingWrapper::RegisterChildWindow();
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	// Controller
74cdf0e10cSrcweir 	SfxToolBoxControl::RegisterControl(SID_REPEAT);
75cdf0e10cSrcweir 	SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
76cdf0e10cSrcweir 	SfxAppToolBoxControl_Impl::RegisterControl( SID_NEWDOCDIRECT );
77cdf0e10cSrcweir 	SfxAppToolBoxControl_Impl::RegisterControl( SID_AUTOPILOTMENU );
78cdf0e10cSrcweir };
79cdf0e10cSrcweir 
80cdf0e10cSrcweir //--------------------------------------------------------------------
81cdf0e10cSrcweir 
82cdf0e10cSrcweir void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
83cdf0e10cSrcweir {
84cdf0e10cSrcweir 	if ( pMod )
85cdf0e10cSrcweir 	{
86cdf0e10cSrcweir 		pMod->RegisterToolBoxControl( pFact );
87cdf0e10cSrcweir 		return;
88cdf0e10cSrcweir 	}
89cdf0e10cSrcweir 
90cdf0e10cSrcweir #ifdef DBG_UTIL
91cdf0e10cSrcweir     for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ )
92cdf0e10cSrcweir 	{
93cdf0e10cSrcweir         SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n];
94cdf0e10cSrcweir 		if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
95cdf0e10cSrcweir 			(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
96cdf0e10cSrcweir 		{
97cdf0e10cSrcweir 			DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
98cdf0e10cSrcweir 		}
99cdf0e10cSrcweir 	}
100cdf0e10cSrcweir #endif
101cdf0e10cSrcweir 
102cdf0e10cSrcweir     pAppData_Impl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pAppData_Impl->pTbxCtrlFac->Count() );
103cdf0e10cSrcweir }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir //--------------------------------------------------------------------
106cdf0e10cSrcweir 
107cdf0e10cSrcweir void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
108cdf0e10cSrcweir {
109cdf0e10cSrcweir 	if ( pMod )
110cdf0e10cSrcweir 	{
111cdf0e10cSrcweir 		pMod->RegisterStatusBarControl( pFact );
112cdf0e10cSrcweir 		return;
113cdf0e10cSrcweir 	}
114cdf0e10cSrcweir 
115cdf0e10cSrcweir #ifdef DBG_UTIL
116cdf0e10cSrcweir     for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ )
117cdf0e10cSrcweir 	{
118cdf0e10cSrcweir         SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n];
119cdf0e10cSrcweir 		if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
120cdf0e10cSrcweir 			(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
121cdf0e10cSrcweir 		{
122cdf0e10cSrcweir 			DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
123cdf0e10cSrcweir 		}
124cdf0e10cSrcweir 	}
125cdf0e10cSrcweir #endif
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     pAppData_Impl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pAppData_Impl->pStbCtrlFac->Count() );
128cdf0e10cSrcweir }
129cdf0e10cSrcweir 
130cdf0e10cSrcweir //--------------------------------------------------------------------
131cdf0e10cSrcweir 
132cdf0e10cSrcweir void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
133cdf0e10cSrcweir {
134cdf0e10cSrcweir 	if ( pMod )
135cdf0e10cSrcweir 	{
136cdf0e10cSrcweir 		pMod->RegisterMenuControl( pFact );
137cdf0e10cSrcweir 		return;
138cdf0e10cSrcweir 	}
139cdf0e10cSrcweir 
140cdf0e10cSrcweir #ifdef DBG_UTIL
141cdf0e10cSrcweir     for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ )
142cdf0e10cSrcweir 	{
143cdf0e10cSrcweir         SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n];
144cdf0e10cSrcweir 		if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
145cdf0e10cSrcweir 			(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
146cdf0e10cSrcweir 		{
147cdf0e10cSrcweir 			DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
148cdf0e10cSrcweir 		}
149cdf0e10cSrcweir 	}
150cdf0e10cSrcweir #endif
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     pAppData_Impl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pAppData_Impl->pMenuCtrlFac->Count() );
153cdf0e10cSrcweir }
154