xref: /trunk/main/sfx2/source/appl/appreg.cxx (revision 595fd105)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sfx2.hxx"
26 
27 #include <vcl/toolbox.hxx>
28 
29 #ifndef GCC
30 #endif
31 
32 #include <sfx2/app.hxx>
33 #include "appdata.hxx"
34 #include "arrdecl.hxx"
35 #include "sfx2/sfxhelp.hxx"
36 #include <sfx2/templdlg.hxx>
37 #include "inettbc.hxx"
38 #include "sfx2/stbitem.hxx"
39 #include <sfx2/navigat.hxx>
40 #include <sfx2/taskpane.hxx>
41 #include <sfx2/module.hxx>
42 #include <sfx2/viewfrm.hxx>
43 #include "partwnd.hxx"
44 #include <sfx2/sfxsids.hrc>
45 #include "recfloat.hxx"
46 #include <sfx2/objsh.hxx>
47 #include <sfx2/viewsh.hxx>
48 #include <sfx2/objface.hxx>
49 #include <sfx2/mnuitem.hxx>
50 
51 //===================================================================
52 
Registrations_Impl()53 void SfxApplication::Registrations_Impl()
54 {
55 	// Interfaces
56 	SfxApplication::RegisterInterface();
57 	SfxModule::RegisterInterface();
58 	SfxViewFrame::RegisterInterface();
59 	SfxObjectShell::RegisterInterface();
60 	SfxViewShell::RegisterInterface();
61 
62 	// ChildWindows
63 	SfxRecordingFloatWrapper_Impl::RegisterChildWindow();
64 	SfxNavigatorWrapper::RegisterChildWindow( sal_False, NULL, SFX_CHILDWIN_NEVERHIDE );
65 	SfxPartChildWnd_Impl::RegisterChildWindow();
66 	SfxTemplateDialogWrapper::RegisterChildWindow(sal_True);
67 	SfxDockingWrapper::RegisterChildWindow();
68 
69 	// Controller
70 	SfxToolBoxControl::RegisterControl(SID_REPEAT);
71 	SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
72 };
73 
74 //--------------------------------------------------------------------
75 
RegisterToolBoxControl_Impl(SfxModule * pMod,SfxTbxCtrlFactory * pFact)76 void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
77 {
78 	if ( pMod )
79 	{
80 		pMod->RegisterToolBoxControl( pFact );
81 		return;
82 	}
83 
84 #ifdef DBG_UTIL
85     for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ )
86 	{
87         SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n];
88 		if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
89 			(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
90 		{
91 			DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
92 		}
93 	}
94 #endif
95 
96     pAppData_Impl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pAppData_Impl->pTbxCtrlFac->Count() );
97 }
98 
99 //--------------------------------------------------------------------
100 
RegisterStatusBarControl_Impl(SfxModule * pMod,SfxStbCtrlFactory * pFact)101 void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
102 {
103 	if ( pMod )
104 	{
105 		pMod->RegisterStatusBarControl( pFact );
106 		return;
107 	}
108 
109 #ifdef DBG_UTIL
110     for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ )
111 	{
112         SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n];
113 		if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
114 			(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
115 		{
116 			DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
117 		}
118 	}
119 #endif
120 
121     pAppData_Impl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pAppData_Impl->pStbCtrlFac->Count() );
122 }
123 
124 //--------------------------------------------------------------------
125 
RegisterMenuControl_Impl(SfxModule * pMod,SfxMenuCtrlFactory * pFact)126 void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
127 {
128 	if ( pMod )
129 	{
130 		pMod->RegisterMenuControl( pFact );
131 		return;
132 	}
133 
134 #ifdef DBG_UTIL
135     for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ )
136 	{
137         SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n];
138 		if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
139 			(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
140 		{
141 			DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
142 		}
143 	}
144 #endif
145 
146     pAppData_Impl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pAppData_Impl->pMenuCtrlFac->Count() );
147 }
148