/src/libreoffice/sd/source/ui/dlg/PaneChildWindows.cxx
Line | Count | Source (jump to first uncovered line) |
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 | | #include <PaneChildWindows.hxx> |
21 | | #include <titledockwin.hxx> |
22 | | #include <ViewShellBase.hxx> |
23 | | #include <framework/FrameworkHelper.hxx> |
24 | | #include <app.hrc> |
25 | | #include <strings.hrc> |
26 | | #include <sdresid.hxx> |
27 | | |
28 | | #include <sfx2/bindings.hxx> |
29 | | #include <sfx2/dispatch.hxx> |
30 | | |
31 | | namespace sd { |
32 | | |
33 | | |
34 | | SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS) |
35 | | SFX_IMPL_DOCKINGWINDOW_WITHID(BottomPaneImpressChildWindow, SID_BOTTOM_PANE_IMPRESS) |
36 | | SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW) |
37 | | |
38 | | //===== PaneChildWindow ======================================================= |
39 | | PaneChildWindow::PaneChildWindow ( |
40 | | vcl::Window* pParentWindow, |
41 | | sal_uInt16 nId, |
42 | | SfxBindings* pBindings, |
43 | | SfxChildWinInfo* pInfo, |
44 | | TranslateId pTitleBarResId, |
45 | | SfxChildAlignment eAlignment) |
46 | 0 | : SfxChildWindow (pParentWindow, nId) |
47 | 0 | { |
48 | 0 | SetWindow( VclPtr<TitledDockingWindow>::Create( |
49 | 0 | pBindings, |
50 | 0 | this, |
51 | 0 | pParentWindow, |
52 | 0 | SdResId(pTitleBarResId))); |
53 | 0 | SetAlignment(eAlignment); |
54 | 0 | SfxDockingWindow* pDockingWindow = static_cast<SfxDockingWindow*>(GetWindow()); |
55 | 0 | pDockingWindow->EnableInput(); |
56 | 0 | pDockingWindow->Initialize(pInfo); |
57 | 0 | SetHideNotDelete(true); |
58 | |
|
59 | 0 | ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame()); |
60 | 0 | if (pBase != nullptr) |
61 | 0 | { |
62 | 0 | framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration(); |
63 | 0 | } |
64 | 0 | } |
65 | | |
66 | | PaneChildWindow::~PaneChildWindow() |
67 | 0 | { |
68 | 0 | ViewShellBase* pBase = nullptr; |
69 | 0 | TitledDockingWindow* pDockingWindow = dynamic_cast<TitledDockingWindow*>(GetWindow()); |
70 | 0 | if (pDockingWindow != nullptr) |
71 | 0 | pBase = ViewShellBase::GetViewShellBase( |
72 | 0 | pDockingWindow->GetBindings().GetDispatcher()->GetFrame()); |
73 | 0 | if (pBase != nullptr) |
74 | 0 | framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration(); |
75 | 0 | } |
76 | | |
77 | | //===== LeftPaneImpressChildWindow ============================================ |
78 | | LeftPaneImpressChildWindow::LeftPaneImpressChildWindow ( |
79 | | vcl::Window* pParentWindow, |
80 | | sal_uInt16 nId, |
81 | | SfxBindings* pBindings, |
82 | | SfxChildWinInfo* pInfo) |
83 | 0 | : PaneChildWindow( |
84 | 0 | pParentWindow, |
85 | 0 | nId, |
86 | 0 | pBindings, |
87 | 0 | pInfo, |
88 | 0 | STR_LEFT_PANE_IMPRESS_TITLE, |
89 | 0 | SfxChildAlignment::LEFT) |
90 | 0 | { |
91 | 0 | } |
92 | | |
93 | | //===== BottomPaneImpressChildWindow ============================================ |
94 | | BottomPaneImpressChildWindow::BottomPaneImpressChildWindow ( |
95 | | vcl::Window* pParentWindow, |
96 | | sal_uInt16 nId, |
97 | | SfxBindings* pBindings, |
98 | | SfxChildWinInfo* pInfo) |
99 | 0 | : PaneChildWindow( |
100 | 0 | pParentWindow, |
101 | 0 | nId, |
102 | 0 | pBindings, |
103 | 0 | pInfo, |
104 | 0 | STR_NOTES_MODE, // TODO this isn't a specific translatable string for this view. |
105 | 0 | SfxChildAlignment::BOTTOM) |
106 | 0 | { |
107 | 0 | } |
108 | | |
109 | | //===== LeftPaneDrawChildWindow =============================================== |
110 | | LeftPaneDrawChildWindow::LeftPaneDrawChildWindow ( |
111 | | vcl::Window* pParentWindow, |
112 | | sal_uInt16 nId, |
113 | | SfxBindings* pBindings, |
114 | | SfxChildWinInfo* pInfo) |
115 | 0 | : PaneChildWindow( |
116 | 0 | pParentWindow, |
117 | 0 | nId, |
118 | 0 | pBindings, |
119 | 0 | pInfo, |
120 | 0 | STR_LEFT_PANE_DRAW_TITLE, |
121 | 0 | SfxChildAlignment::LEFT) |
122 | 0 | { |
123 | 0 | } |
124 | | |
125 | | } // end of namespace ::sd |
126 | | |
127 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |