/src/libreoffice/sfx2/source/appl/appreg.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | |
21 | | #include <sal/log.hxx> |
22 | | |
23 | | #include <sfx2/app.hxx> |
24 | | #include <appdata.hxx> |
25 | | #include <inettbc.hxx> |
26 | | #include <sfx2/stbitem.hxx> |
27 | | #include <sfx2/infobar.hxx> |
28 | | #include <sfx2/module.hxx> |
29 | | #include <sfx2/viewfrm.hxx> |
30 | | #include <partwnd.hxx> |
31 | | #include <sfx2/sfxsids.hrc> |
32 | | #include <recfloat.hxx> |
33 | | #include <sfx2/objsh.hxx> |
34 | | #include <sfx2/viewsh.hxx> |
35 | | |
36 | | |
37 | | void SfxApplication::Registrations_Impl() |
38 | 27 | { |
39 | | // Interfaces |
40 | 27 | SfxApplication::RegisterInterface(); |
41 | 27 | SfxModule::RegisterInterface(); |
42 | 27 | SfxViewFrame::RegisterInterface(); |
43 | 27 | SfxObjectShell::RegisterInterface(); |
44 | 27 | SfxViewShell::RegisterInterface(); |
45 | | |
46 | | // ChildWindows |
47 | 27 | SfxRecordingFloatWrapper_Impl::RegisterChildWindow(); |
48 | 27 | SfxPartChildWnd_Impl::RegisterChildWindow(); |
49 | 27 | SfxDockingWrapper::RegisterChildWindow(); |
50 | 27 | SfxInfoBarContainerChild::RegisterChildWindow( true, nullptr, SfxChildWindowFlags::NEVERHIDE ); |
51 | | |
52 | | // Controller |
53 | 27 | SfxToolBoxControl::RegisterControl(SID_REPEAT); |
54 | 27 | SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL); |
55 | 27 | } |
56 | | |
57 | | |
58 | | void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, const SfxTbxCtrlFactory& rFact ) |
59 | 728 | { |
60 | 728 | if ( pMod ) |
61 | 518 | { |
62 | 518 | pMod->RegisterToolBoxControl( rFact ); |
63 | 518 | return; |
64 | 518 | } |
65 | | |
66 | | #ifdef DBG_UTIL |
67 | | for ( size_t n=0; n<pImpl->maTbxCtrlFactories.size(); n++ ) |
68 | | { |
69 | | SfxTbxCtrlFactory *pF = &pImpl->maTbxCtrlFactories[n]; |
70 | | if ( pF->nTypeId == rFact.nTypeId && |
71 | | (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) ) |
72 | | { |
73 | | SAL_INFO("sfx", "TbxController registration is not clearly defined!"); |
74 | | } |
75 | | } |
76 | | #endif |
77 | | |
78 | 210 | pImpl->maTbxCtrlFactories.push_back( rFact ); |
79 | 210 | } |
80 | | |
81 | | |
82 | | void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, const SfxStbCtrlFactory& rFact ) |
83 | 249 | { |
84 | 249 | if ( pMod ) |
85 | 249 | { |
86 | 249 | pMod->RegisterStatusBarControl( rFact ); |
87 | 249 | return; |
88 | 249 | } |
89 | | |
90 | | #ifdef DBG_UTIL |
91 | | for ( size_t n=0; n<pImpl->maStbCtrlFactories.size(); n++ ) |
92 | | { |
93 | | SfxStbCtrlFactory *pF = &pImpl->maStbCtrlFactories[n]; |
94 | | if ( pF->nTypeId == rFact.nTypeId && |
95 | | (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) ) |
96 | | { |
97 | | SAL_INFO("sfx", "StbController registration is not clearly defined!"); |
98 | | } |
99 | | } |
100 | | #endif |
101 | | |
102 | 0 | pImpl->maStbCtrlFactories.push_back( rFact ); |
103 | 0 | } |
104 | | |
105 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |