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 0 : SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
48 0 : SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
49 :
50 : //===== PaneChildWindow =======================================================
51 :
52 0 : PaneChildWindow::PaneChildWindow (
53 : ::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 0 : : SfxChildWindow (pParentWindow, nId)
61 : {
62 : pWindow = new PaneDockingWindow (
63 : pBindings,
64 : this,
65 : pParentWindow,
66 : SdResId( nDockWinTitleResId ),
67 0 : SD_RESSTR( nTitleBarResId ) );
68 0 : eChildAlignment = eAlignment;
69 0 : static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
70 0 : SetHideNotDelete(true);
71 :
72 0 : ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
73 0 : if (pBase != NULL)
74 : {
75 0 : framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
76 : }
77 0 : }
78 :
79 :
80 :
81 :
82 0 : PaneChildWindow::~PaneChildWindow (void)
83 : {
84 0 : ViewShellBase* pBase = NULL;
85 0 : PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
86 0 : if (pDockingWindow != NULL)
87 : pBase = ViewShellBase::GetViewShellBase(
88 0 : pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
89 0 : if (pBase != NULL)
90 0 : framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
91 0 : }
92 :
93 :
94 :
95 :
96 :
97 :
98 : //===== LeftPaneImpressChildWindow ============================================
99 :
100 0 : LeftPaneImpressChildWindow::LeftPaneImpressChildWindow (
101 : ::Window* pParentWindow,
102 : sal_uInt16 nId,
103 : SfxBindings* pBindings,
104 : SfxChildWinInfo* pInfo)
105 : : PaneChildWindow(
106 : pParentWindow,
107 : nId,
108 : pBindings,
109 : pInfo,
110 : FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW,
111 : STR_LEFT_PANE_IMPRESS_TITLE,
112 0 : SFX_ALIGN_LEFT)
113 : {
114 0 : }
115 :
116 :
117 :
118 :
119 : //===== LeftPaneDrawChildWindow ===============================================
120 :
121 0 : LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
122 : ::Window* pParentWindow,
123 : sal_uInt16 nId,
124 : SfxBindings* pBindings,
125 : SfxChildWinInfo* pInfo)
126 : : PaneChildWindow(
127 : pParentWindow,
128 : nId,
129 : pBindings,
130 : pInfo,
131 : FLT_LEFT_PANE_DRAW_DOCKING_WINDOW,
132 : STR_LEFT_PANE_DRAW_TITLE,
133 0 : SFX_ALIGN_LEFT)
134 : {
135 0 : }
136 :
137 : } // end of namespace ::sd
138 :
139 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|