Line data Source code
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 "PaneDockingWindow.hrc"
22 : #include "PaneDockingWindow.hxx"
23 : #include "ViewShellBase.hxx"
24 : #include "framework/FrameworkHelper.hxx"
25 : #include "taskpane/ToolPanelViewShell.hxx"
26 : #include "app.hrc"
27 : #include "strings.hrc"
28 : #include "sdresid.hxx"
29 :
30 : #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
31 : #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
32 :
33 : #include <sfx2/app.hxx>
34 : #include <sfx2/dockwin.hxx>
35 : #include <sfx2/bindings.hxx>
36 : #include <sfx2/dispatch.hxx>
37 : #include <tools/diagnose_ex.h>
38 :
39 : namespace sd {
40 :
41 : using ::com::sun::star::uno::Reference;
42 : using ::com::sun::star::drawing::framework::XResourceId;
43 : using ::com::sun::star::drawing::framework::XConfigurationController;
44 : using ::com::sun::star::drawing::framework::ResourceActivationMode_ADD;
45 : using ::com::sun::star::drawing::framework::ResourceActivationMode_REPLACE;
46 :
47 172 : SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
48 520 : SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
49 :
50 : //===== PaneChildWindow =======================================================
51 :
52 126 : PaneChildWindow::PaneChildWindow (
53 : vcl::Window* pParentWindow,
54 : sal_uInt16 nId,
55 : SfxBindings* pBindings,
56 : SfxChildWinInfo* pInfo,
57 : const sal_uInt16 nDockWinTitleResId,
58 : const sal_uInt16 nTitleBarResId,
59 : SfxChildAlignment eAlignment)
60 126 : : SfxChildWindow (pParentWindow, nId)
61 : {
62 : pWindow = new PaneDockingWindow (
63 : pBindings,
64 : this,
65 : pParentWindow,
66 : SdResId( nDockWinTitleResId ),
67 126 : SD_RESSTR( nTitleBarResId ) );
68 126 : eChildAlignment = eAlignment;
69 126 : static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
70 126 : SetHideNotDelete(true);
71 :
72 126 : ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
73 126 : if (pBase != NULL)
74 : {
75 126 : framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
76 : }
77 126 : }
78 :
79 252 : PaneChildWindow::~PaneChildWindow (void)
80 : {
81 126 : ViewShellBase* pBase = NULL;
82 126 : PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
83 126 : if (pDockingWindow != NULL)
84 : pBase = ViewShellBase::GetViewShellBase(
85 126 : pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
86 126 : if (pBase != NULL)
87 126 : framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
88 126 : }
89 :
90 : //===== LeftPaneImpressChildWindow ============================================
91 :
92 24 : LeftPaneImpressChildWindow::LeftPaneImpressChildWindow (
93 : vcl::Window* pParentWindow,
94 : sal_uInt16 nId,
95 : SfxBindings* pBindings,
96 : SfxChildWinInfo* pInfo)
97 : : PaneChildWindow(
98 : pParentWindow,
99 : nId,
100 : pBindings,
101 : pInfo,
102 : FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW,
103 : STR_LEFT_PANE_IMPRESS_TITLE,
104 24 : SFX_ALIGN_LEFT)
105 : {
106 24 : }
107 :
108 : //===== LeftPaneDrawChildWindow ===============================================
109 :
110 102 : LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
111 : vcl::Window* pParentWindow,
112 : sal_uInt16 nId,
113 : SfxBindings* pBindings,
114 : SfxChildWinInfo* pInfo)
115 : : PaneChildWindow(
116 : pParentWindow,
117 : nId,
118 : pBindings,
119 : pInfo,
120 : FLT_LEFT_PANE_DRAW_DOCKING_WINDOW,
121 : STR_LEFT_PANE_DRAW_TITLE,
122 102 : SFX_ALIGN_LEFT)
123 : {
124 102 : }
125 :
126 114 : } // end of namespace ::sd
127 :
128 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|