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