Update ooo320-m1
[ooovba.git] / sd / source / ui / dlg / PaneChildWindows.cxx
blob6076890a3b4ba611f6e441a8c03efc88e58ac152
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PaneChildWindows.cxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
33 #include "PaneChildWindows.hxx"
34 #include "PaneDockingWindow.hrc"
35 #include "app.hrc"
36 #include "strings.hrc"
37 #include "sdresid.hxx"
38 #include <sfx2/app.hxx>
39 #include <sfx2/dockwin.hxx>
40 #include <sfx2/bindings.hxx>
41 #include <sfx2/dispatch.hxx>
43 namespace sd
45 SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
46 SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
47 SFX_IMPL_DOCKINGWINDOW(RightPaneChildWindow, SID_RIGHT_PANE)
51 #include "PaneDockingWindow.hxx"
52 #include "ViewShellBase.hxx"
53 #include "framework/FrameworkHelper.hxx"
55 namespace sd {
57 //===== PaneChildWindow =======================================================
59 PaneChildWindow::PaneChildWindow (
60 ::Window* pParentWindow,
61 USHORT nId,
62 SfxBindings* pBindings,
63 SfxChildWinInfo* pInfo,
64 const ResId& rResId,
65 const ::rtl::OUString& rsTitle,
66 SfxChildAlignment eAlignment)
67 : SfxChildWindow (pParentWindow, nId)
69 pWindow = new PaneDockingWindow (
70 pBindings,
71 this,
72 pParentWindow,
73 rResId,
74 framework::FrameworkHelper::msLeftImpressPaneURL,
75 rsTitle);
76 eChildAlignment = eAlignment;
77 static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
78 SetHideNotDelete(TRUE);
80 ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
81 if (pBase != NULL)
83 framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
90 PaneChildWindow::~PaneChildWindow (void)
92 ViewShellBase* pBase = NULL;
93 PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
94 if (pDockingWindow != NULL)
95 pBase = ViewShellBase::GetViewShellBase(
96 pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
97 if (pBase != NULL)
98 framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
106 //===== LeftPaneImpressChildWindow ============================================
108 LeftPaneImpressChildWindow::LeftPaneImpressChildWindow (
109 ::Window* pParentWindow,
110 USHORT nId,
111 SfxBindings* pBindings,
112 SfxChildWinInfo* pInfo)
113 : PaneChildWindow(
114 pParentWindow,
115 nId,
116 pBindings,
117 pInfo,
118 SdResId(FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW),
119 String(SdResId(STR_LEFT_PANE_IMPRESS_TITLE)),
120 SFX_ALIGN_LEFT)
127 //===== LeftPaneDrawChildWindow ===============================================
129 LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
130 ::Window* pParentWindow,
131 USHORT nId,
132 SfxBindings* pBindings,
133 SfxChildWinInfo* pInfo)
134 : PaneChildWindow(
135 pParentWindow,
136 nId,
137 pBindings,
138 pInfo,
139 SdResId(FLT_LEFT_PANE_DRAW_DOCKING_WINDOW),
140 String(SdResId(STR_LEFT_PANE_DRAW_TITLE)),
141 SFX_ALIGN_LEFT)
148 //===== RightPaneChildWindow ==================================================
150 RightPaneChildWindow::RightPaneChildWindow (
151 ::Window* pParentWindow,
152 USHORT nId,
153 SfxBindings* pBindings,
154 SfxChildWinInfo* pInfo)
155 : PaneChildWindow(
156 pParentWindow,
157 nId,
158 pBindings,
159 pInfo,
160 SdResId(FLT_RIGHT_PANE_DOCKING_WINDOW),
161 String(SdResId(STR_RIGHT_PANE_TITLE)),
162 SFX_ALIGN_RIGHT)
167 } // end of namespace ::sd