/src/libreoffice/sc/source/ui/inc/ChildWindowWrapper.hxx
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 | | */ |
10 | | |
11 | | #pragma once |
12 | | |
13 | | #include <sfx2/dispatch.hxx> |
14 | | #include <sfx2/viewfrm.hxx> |
15 | | #include <sfx2/childwin.hxx> |
16 | | #include <osl/diagnose.h> |
17 | | |
18 | | #include "tabvwsh.hxx" |
19 | | |
20 | | template <sal_Int16 WindowID> |
21 | | class ChildControllerWrapper : public SfxChildWindow |
22 | | { |
23 | | public: |
24 | | ChildControllerWrapper(vcl::Window* pParentP, sal_uInt16 nId, |
25 | | SfxBindings* pBindings, SfxChildWinInfo* pInfo) |
26 | 0 | : SfxChildWindow(pParentP, nId) |
27 | 0 | { |
28 | 0 | ScTabViewShell* pViewShell = getTabViewShell( pBindings ); |
29 | 0 | if (!pViewShell) |
30 | 0 | pViewShell = dynamic_cast< ScTabViewShell *>( SfxViewShell::Current() ); |
31 | 0 | OSL_ENSURE(pViewShell, "Missing view shell!"); |
32 | |
|
33 | 0 | if (pViewShell) |
34 | 0 | SetController(pViewShell->CreateRefDialogController(pBindings, this, pInfo, pParentP->GetFrameWeld(), WindowID)); |
35 | |
|
36 | 0 | if (pViewShell && !GetController()) |
37 | 0 | pViewShell->GetViewFrame().SetChildWindow( nId, false ); |
38 | 0 | } Unexecuted instantiation: ChildControllerWrapper<(short)26170>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26171>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26172>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26173>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26174>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26175>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26176>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26177>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26178>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26179>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26180>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26181>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26182>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26188>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26189>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26190>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26192>::ChildControllerWrapper(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) |
39 | | |
40 | | static std::unique_ptr<SfxChildWindow> CreateImpl( |
41 | | vcl::Window *pParent, sal_uInt16 nId, |
42 | | SfxBindings *pBindings, SfxChildWinInfo* pInfo ) |
43 | 0 | { |
44 | 0 | return std::make_unique<ChildControllerWrapper>(pParent, nId, pBindings, pInfo); |
45 | 0 | } Unexecuted instantiation: ChildControllerWrapper<(short)26170>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26171>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26172>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26173>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26174>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26175>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26176>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26177>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26178>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26179>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26180>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26181>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26182>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26188>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26189>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26190>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) Unexecuted instantiation: ChildControllerWrapper<(short)26192>::CreateImpl(vcl::Window*, unsigned short, SfxBindings*, SfxChildWinInfo*) |
46 | | |
47 | | static void RegisterChildWindow ( |
48 | | bool bVisible = false, |
49 | | SfxModule* pModule = nullptr, |
50 | | SfxChildWindowFlags nFlags = SfxChildWindowFlags::NONE) |
51 | 187 | { |
52 | 187 | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); |
53 | 187 | aFactory.aInfo.nFlags |= nFlags; |
54 | 187 | aFactory.aInfo.bVisible = bVisible; |
55 | 187 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); |
56 | 187 | } ChildControllerWrapper<(short)26170>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26171>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26172>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26173>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26174>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26175>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26176>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26177>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26178>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26179>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26180>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26181>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26182>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26188>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26189>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26190>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
ChildControllerWrapper<(short)26192>::RegisterChildWindow(bool, SfxModule*, SfxChildWindowFlags) Line | Count | Source | 51 | 11 | { | 52 | | SfxChildWinFactory aFactory(ChildControllerWrapper::CreateImpl, WindowID, CHILDWIN_NOPOS ); | 53 | 11 | aFactory.aInfo.nFlags |= nFlags; | 54 | 11 | aFactory.aInfo.bVisible = bVisible; | 55 | 11 | SfxChildWindow::RegisterChildWindow(pModule, aFactory); | 56 | 11 | } |
|
57 | | |
58 | | static sal_uInt16 GetChildWindowId() |
59 | 187 | { |
60 | 187 | return WindowID; |
61 | 187 | } ChildControllerWrapper<(short)26170>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26171>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26172>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26173>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26174>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26175>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26176>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26177>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26178>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26179>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26180>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26181>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26182>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26188>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26189>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26190>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
ChildControllerWrapper<(short)26192>::GetChildWindowId() Line | Count | Source | 59 | 11 | { | 60 | 11 | return WindowID; | 61 | 11 | } |
|
62 | | |
63 | | private: |
64 | | static ScTabViewShell* getTabViewShell( const SfxBindings *pBindings ) |
65 | 0 | { |
66 | 0 | if( !pBindings ) |
67 | 0 | return nullptr; |
68 | 0 | SfxDispatcher* pDispacher = pBindings ->GetDispatcher(); |
69 | 0 | if( !pDispacher ) |
70 | 0 | return nullptr; |
71 | 0 | SfxViewFrame* pFrame = pDispacher->GetFrame(); |
72 | 0 | if( !pFrame ) |
73 | 0 | return nullptr; |
74 | 0 | SfxViewShell* pViewShell = pFrame->GetViewShell(); |
75 | 0 | if( !pViewShell ) |
76 | 0 | return nullptr; |
77 | 0 | return dynamic_cast<ScTabViewShell*>( pViewShell ); |
78 | 0 | } Unexecuted instantiation: ChildControllerWrapper<(short)26170>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26171>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26172>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26173>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26174>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26175>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26176>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26177>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26178>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26179>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26180>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26181>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26182>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26188>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26189>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26190>::getTabViewShell(SfxBindings const*) Unexecuted instantiation: ChildControllerWrapper<(short)26192>::getTabViewShell(SfxBindings const*) |
79 | | }; |
80 | | |
81 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |