1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: appreg.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sfx2.hxx"
34 #include <vcl/toolbox.hxx>
39 #include <sfx2/app.hxx>
40 #include "appdata.hxx"
41 #include "arrdecl.hxx"
42 #include "sfxhelp.hxx"
43 #include <sfx2/templdlg.hxx>
44 #include "objmnctl.hxx"
45 #include "inettbc.hxx"
46 #include "stbitem.hxx"
47 #include <sfx2/navigat.hxx>
48 #include <sfx2/module.hxx>
49 #include <sfx2/topfrm.hxx>
50 #include "partwnd.hxx"
51 #include <sfx2/sfxsids.hrc>
52 #include "recfloat.hxx"
53 #include <sfx2/objsh.hxx>
54 #include <sfx2/viewsh.hxx>
55 #include <sfx2/objface.hxx>
57 //===================================================================
59 void SfxApplication::Registrations_Impl()
62 SfxApplication::RegisterInterface();
63 SfxModule::RegisterInterface();
64 SfxViewFrame::RegisterInterface();
65 SfxTopViewFrame::RegisterInterface();
66 SfxObjectShell::RegisterInterface();
67 SfxViewShell::RegisterInterface();
70 SfxRecordingFloatWrapper_Impl::RegisterChildWindow();
71 SfxNavigatorWrapper::RegisterChildWindow( FALSE
, NULL
, SFX_CHILDWIN_NEVERHIDE
);
72 SfxPartChildWnd_Impl::RegisterChildWindow();
73 SfxTemplateDialogWrapper::RegisterChildWindow();
74 SfxDockingWrapper::RegisterChildWindow();
77 SfxToolBoxControl::RegisterControl(SID_REPEAT
);
78 SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL
);
79 SfxCancelToolBoxControl_Impl::RegisterControl(SID_BROWSE_STOP
);
80 SfxAppToolBoxControl_Impl::RegisterControl( SID_NEWDOCDIRECT
);
81 SfxAppToolBoxControl_Impl::RegisterControl( SID_AUTOPILOTMENU
);
84 //--------------------------------------------------------------------
86 void SfxApplication::RegisterToolBoxControl_Impl( SfxModule
*pMod
, SfxTbxCtrlFactory
*pFact
)
90 pMod
->RegisterToolBoxControl( pFact
);
95 for ( USHORT n
=0; n
<pAppData_Impl
->pTbxCtrlFac
->Count(); n
++ )
97 SfxTbxCtrlFactory
*pF
= (*pAppData_Impl
->pTbxCtrlFac
)[n
];
98 if ( pF
->nTypeId
&& pF
->nTypeId
== pFact
->nTypeId
&&
99 (pF
->nSlotId
== pFact
->nSlotId
|| pF
->nSlotId
== 0) )
101 DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
106 pAppData_Impl
->pTbxCtrlFac
->C40_INSERT( SfxTbxCtrlFactory
, pFact
, pAppData_Impl
->pTbxCtrlFac
->Count() );
109 //--------------------------------------------------------------------
111 void SfxApplication::RegisterStatusBarControl_Impl( SfxModule
*pMod
, SfxStbCtrlFactory
*pFact
)
115 pMod
->RegisterStatusBarControl( pFact
);
120 for ( USHORT n
=0; n
<pAppData_Impl
->pStbCtrlFac
->Count(); n
++ )
122 SfxStbCtrlFactory
*pF
= (*pAppData_Impl
->pStbCtrlFac
)[n
];
123 if ( pF
->nTypeId
&& pF
->nTypeId
== pFact
->nTypeId
&&
124 (pF
->nSlotId
== pFact
->nSlotId
|| pF
->nSlotId
== 0) )
126 DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
131 pAppData_Impl
->pStbCtrlFac
->C40_INSERT( SfxStbCtrlFactory
, pFact
, pAppData_Impl
->pStbCtrlFac
->Count() );
134 //--------------------------------------------------------------------
136 void SfxApplication::RegisterMenuControl_Impl( SfxModule
*pMod
, SfxMenuCtrlFactory
*pFact
)
140 pMod
->RegisterMenuControl( pFact
);
145 for ( USHORT n
=0; n
<pAppData_Impl
->pMenuCtrlFac
->Count(); n
++ )
147 SfxMenuCtrlFactory
*pF
= (*pAppData_Impl
->pMenuCtrlFac
)[n
];
148 if ( pF
->nTypeId
&& pF
->nTypeId
== pFact
->nTypeId
&&
149 (pF
->nSlotId
== pFact
->nSlotId
|| pF
->nSlotId
== 0) )
151 DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
156 pAppData_Impl
->pMenuCtrlFac
->C40_INSERT( SfxMenuCtrlFactory
, pFact
, pAppData_Impl
->pMenuCtrlFac
->Count() );