Branch libreoffice-5-0-4
[LibreOffice.git] / sfx2 / source / appl / appreg.cxx
blobdc25cc26be30e7b4be32bbc27349f422d22daf8c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <vcl/toolbox.hxx>
23 #include <sfx2/app.hxx>
24 #include "appdata.hxx"
25 #include <sfx2/sfxhelp.hxx>
26 #include <sfx2/templdlg.hxx>
27 #include "inettbc.hxx"
28 #include <sfx2/stbitem.hxx>
29 #include <sfx2/infobar.hxx>
30 #include <sfx2/navigat.hxx>
31 #include <sfx2/taskpane.hxx>
32 #include <sfx2/module.hxx>
33 #include <sfx2/viewfrm.hxx>
34 #include "partwnd.hxx"
35 #include <sfx2/sfxsids.hrc>
36 #include "recfloat.hxx"
37 #include <ctrlfactoryimpl.hxx>
38 #include <sfx2/objsh.hxx>
39 #include <sfx2/viewsh.hxx>
40 #include <sfx2/objface.hxx>
41 #include <sfx2/mnuitem.hxx>
45 void SfxApplication::Registrations_Impl()
47 // Interfaces
48 SfxApplication::RegisterInterface();
49 SfxModule::RegisterInterface();
50 SfxViewFrame::RegisterInterface();
51 SfxObjectShell::RegisterInterface();
52 SfxViewShell::RegisterInterface();
54 // ChildWindows
55 SfxRecordingFloatWrapper_Impl::RegisterChildWindow();
56 SfxNavigatorWrapper::RegisterChildWindow( false, NULL, SfxChildWindowFlags::NEVERHIDE );
57 SfxPartChildWnd_Impl::RegisterChildWindow();
58 SfxDockingWrapper::RegisterChildWindow();
59 SfxInfoBarContainerChild::RegisterChildWindow( true, NULL, SfxChildWindowFlags::NEVERHIDE );
61 // Controller
62 SfxToolBoxControl::RegisterControl(SID_REPEAT);
63 SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
64 SfxRecentFilesToolBoxControl::RegisterControl( SID_OPENDOC );
69 void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
71 if ( pMod )
73 pMod->RegisterToolBoxControl( pFact );
74 return;
77 #ifdef DBG_UTIL
78 for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ )
80 SfxTbxCtrlFactory *pF = &(*pAppData_Impl->pTbxCtrlFac)[n];
81 if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
82 (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
84 DBG_WARNING("TbxController registration is not clearly defined!");
87 #endif
89 pAppData_Impl->pTbxCtrlFac->push_back( pFact );
94 void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
96 if ( pMod )
98 pMod->RegisterStatusBarControl( pFact );
99 return;
102 #ifdef DBG_UTIL
103 for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ )
105 SfxStbCtrlFactory *pF = &(*pAppData_Impl->pStbCtrlFac)[n];
106 if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
107 (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
109 DBG_WARNING("StbController registration is not clearly defined!");
112 #endif
114 pAppData_Impl->pStbCtrlFac->push_back( pFact );
119 void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
121 if ( pMod )
123 pMod->RegisterMenuControl( pFact );
124 return;
127 #ifdef DBG_UTIL
128 for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ )
130 SfxMenuCtrlFactory *pF = &(*pAppData_Impl->pMenuCtrlFac)[n];
131 if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
132 (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
134 DBG_WARNING("MenuController register is not clearly defined!");
137 #endif
139 pAppData_Impl->pMenuCtrlFac->push_back( pFact );
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */