1*5b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*5b190011SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*5b190011SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*5b190011SAndrew Rist * distributed with this work for additional information
6*5b190011SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*5b190011SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*5b190011SAndrew Rist * "License"); you may not use this file except in compliance
9*5b190011SAndrew Rist * with the License. You may obtain a copy of the License at
10*5b190011SAndrew Rist *
11*5b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*5b190011SAndrew Rist *
13*5b190011SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*5b190011SAndrew Rist * software distributed under the License is distributed on an
15*5b190011SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5b190011SAndrew Rist * KIND, either express or implied. See the License for the
17*5b190011SAndrew Rist * specific language governing permissions and limitations
18*5b190011SAndrew Rist * under the License.
19*5b190011SAndrew Rist *
20*5b190011SAndrew Rist *************************************************************/
21*5b190011SAndrew Rist
22*5b190011SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir #include "PaneChildWindows.hxx"
27cdf0e10cSrcweir #include "PaneDockingWindow.hrc"
28cdf0e10cSrcweir #include "PaneDockingWindow.hxx"
29cdf0e10cSrcweir #include "ViewShellBase.hxx"
30cdf0e10cSrcweir #include "framework/FrameworkHelper.hxx"
31cdf0e10cSrcweir #include "app.hrc"
32cdf0e10cSrcweir #include "strings.hrc"
33cdf0e10cSrcweir #include "sdresid.hxx"
34cdf0e10cSrcweir
35cdf0e10cSrcweir #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
36cdf0e10cSrcweir #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
37cdf0e10cSrcweir
38cdf0e10cSrcweir #include <sfx2/app.hxx>
39cdf0e10cSrcweir #include <sfx2/dockwin.hxx>
40cdf0e10cSrcweir #include <sfx2/bindings.hxx>
41cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
42cdf0e10cSrcweir #include <tools/diagnose_ex.h>
43cdf0e10cSrcweir
44cdf0e10cSrcweir namespace sd {
45cdf0e10cSrcweir
46cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
47cdf0e10cSrcweir using ::com::sun::star::drawing::framework::XResourceId;
48cdf0e10cSrcweir using ::com::sun::star::drawing::framework::XConfigurationController;
49cdf0e10cSrcweir using ::com::sun::star::drawing::framework::ResourceActivationMode_ADD;
50cdf0e10cSrcweir using ::com::sun::star::drawing::framework::ResourceActivationMode_REPLACE;
51cdf0e10cSrcweir
SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow,SID_LEFT_PANE_IMPRESS)52cdf0e10cSrcweir SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
53cdf0e10cSrcweir SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
54cdf0e10cSrcweir
55cdf0e10cSrcweir //===== PaneChildWindow =======================================================
56cdf0e10cSrcweir
57cdf0e10cSrcweir PaneChildWindow::PaneChildWindow (
58cdf0e10cSrcweir ::Window* pParentWindow,
59cdf0e10cSrcweir sal_uInt16 nId,
60cdf0e10cSrcweir SfxBindings* pBindings,
61cdf0e10cSrcweir SfxChildWinInfo* pInfo,
62cdf0e10cSrcweir const sal_uInt16 nDockWinTitleResId,
63cdf0e10cSrcweir const sal_uInt16 nTitleBarResId,
64cdf0e10cSrcweir SfxChildAlignment eAlignment)
65cdf0e10cSrcweir : SfxChildWindow (pParentWindow, nId)
66cdf0e10cSrcweir {
67cdf0e10cSrcweir pWindow = new PaneDockingWindow (
68cdf0e10cSrcweir pBindings,
69cdf0e10cSrcweir this,
70cdf0e10cSrcweir pParentWindow,
71cdf0e10cSrcweir SdResId( nDockWinTitleResId ),
72cdf0e10cSrcweir String( SdResId( nTitleBarResId ) ) );
73cdf0e10cSrcweir eChildAlignment = eAlignment;
74cdf0e10cSrcweir static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
75cdf0e10cSrcweir SetHideNotDelete(sal_True);
76cdf0e10cSrcweir
77cdf0e10cSrcweir ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
78cdf0e10cSrcweir if (pBase != NULL)
79cdf0e10cSrcweir {
80cdf0e10cSrcweir framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
81cdf0e10cSrcweir }
82cdf0e10cSrcweir }
83cdf0e10cSrcweir
84cdf0e10cSrcweir
85cdf0e10cSrcweir
86cdf0e10cSrcweir
~PaneChildWindow(void)87cdf0e10cSrcweir PaneChildWindow::~PaneChildWindow (void)
88cdf0e10cSrcweir {
89cdf0e10cSrcweir ViewShellBase* pBase = NULL;
90cdf0e10cSrcweir PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
91cdf0e10cSrcweir if (pDockingWindow != NULL)
92cdf0e10cSrcweir pBase = ViewShellBase::GetViewShellBase(
93cdf0e10cSrcweir pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
94cdf0e10cSrcweir if (pBase != NULL)
95cdf0e10cSrcweir framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
96cdf0e10cSrcweir }
97cdf0e10cSrcweir
98cdf0e10cSrcweir
99cdf0e10cSrcweir
100cdf0e10cSrcweir
101cdf0e10cSrcweir
102cdf0e10cSrcweir
103cdf0e10cSrcweir //===== LeftPaneImpressChildWindow ============================================
104cdf0e10cSrcweir
LeftPaneImpressChildWindow(::Window * pParentWindow,sal_uInt16 nId,SfxBindings * pBindings,SfxChildWinInfo * pInfo)105cdf0e10cSrcweir LeftPaneImpressChildWindow::LeftPaneImpressChildWindow (
106cdf0e10cSrcweir ::Window* pParentWindow,
107cdf0e10cSrcweir sal_uInt16 nId,
108cdf0e10cSrcweir SfxBindings* pBindings,
109cdf0e10cSrcweir SfxChildWinInfo* pInfo)
110cdf0e10cSrcweir : PaneChildWindow(
111cdf0e10cSrcweir pParentWindow,
112cdf0e10cSrcweir nId,
113cdf0e10cSrcweir pBindings,
114cdf0e10cSrcweir pInfo,
115cdf0e10cSrcweir FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW,
116cdf0e10cSrcweir STR_LEFT_PANE_IMPRESS_TITLE,
117cdf0e10cSrcweir SFX_ALIGN_LEFT)
118cdf0e10cSrcweir {
119cdf0e10cSrcweir }
120cdf0e10cSrcweir
121cdf0e10cSrcweir
122cdf0e10cSrcweir
123cdf0e10cSrcweir
124cdf0e10cSrcweir //===== LeftPaneDrawChildWindow ===============================================
125cdf0e10cSrcweir
LeftPaneDrawChildWindow(::Window * pParentWindow,sal_uInt16 nId,SfxBindings * pBindings,SfxChildWinInfo * pInfo)126cdf0e10cSrcweir LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
127cdf0e10cSrcweir ::Window* pParentWindow,
128cdf0e10cSrcweir sal_uInt16 nId,
129cdf0e10cSrcweir SfxBindings* pBindings,
130cdf0e10cSrcweir SfxChildWinInfo* pInfo)
131cdf0e10cSrcweir : PaneChildWindow(
132cdf0e10cSrcweir pParentWindow,
133cdf0e10cSrcweir nId,
134cdf0e10cSrcweir pBindings,
135cdf0e10cSrcweir pInfo,
136cdf0e10cSrcweir FLT_LEFT_PANE_DRAW_DOCKING_WINDOW,
137cdf0e10cSrcweir STR_LEFT_PANE_DRAW_TITLE,
138cdf0e10cSrcweir SFX_ALIGN_LEFT)
139cdf0e10cSrcweir {
140cdf0e10cSrcweir }
141cdf0e10cSrcweir
142cdf0e10cSrcweir
143cdf0e10cSrcweir } // end of namespace ::sd
144