1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef SD_TOOL_PANEL_VIEW_SHELL_HXX
21 #define SD_TOOL_PANEL_VIEW_SHELL_HXX
23 #include "ViewShell.hxx"
25 #include "taskpane/PanelId.hxx"
26 #include "framework/FrameworkHelper.hxx"
27 #include <vcl/button.hxx>
28 #include <sfx2/shell.hxx>
29 #include <sfx2/viewfac.hxx>
30 #include <sfx2/dockwin.hxx>
32 #include <boost/shared_ptr.hpp>
33 #include <boost/scoped_ptr.hpp>
37 namespace com
{ namespace sun
{ namespace star
{ namespace ui
{
43 class TaskPaneShellManager
;
44 class ToolPanelViewShell_Impl
;
45 /** The tool panel is a view shell for some very specific reasons:
46 - It fits better into the concept of panes being docking windows whose
47 content, a view shell, can be exchanged on runtime.
48 - A control in the tool panel that wants to show a context menu has to
49 do that over the dispatcher of a shell. These shells, usually
50 implemented by the controls themselves, have to be managed by someone.
51 If interpreted as object bars this can be handled by the
52 ObjectBarManager of the ViewShell.
54 class ToolPanelViewShell
59 SFX_DECL_INTERFACE(SD_IF_SDTOOLPANELSHELL
)
63 ViewShellBase
& rViewShellBase
,
64 ::Window
* pParentWindow
,
65 FrameView
* pFrameView
);
66 virtual ~ToolPanelViewShell (void);
68 /** Register the SFX interfaces so that (some of) the controls can be
69 pushed as SFX shells on the shell stack and process slot calls and
72 static void RegisterControls (void);
74 virtual void GetFocus (void);
75 virtual void LoseFocus (void);
76 virtual void KeyInput (const KeyEvent
& rEvent
);
77 using sd::ViewShell::KeyInput
;
79 virtual SdPage
* GetActualPage (void);
80 virtual SdPage
* getCurrentPage (void) const;
82 virtual void ArrangeGUIElements (void);
84 TaskPaneShellManager
& GetSubShellManager (void) const;
86 /** deactivates the given panel, bypassing the configuration controller. Only valid for tool panels which are
87 not under the drawing framework's control.
89 void ActivatePanel( const OUString
& i_rPanelResourceURL
);
91 /** deactivates the given panel, bypassing the configuration controller
93 void DeactivatePanel( const OUString
& i_rPanelResourceURL
);
95 /** Return a pointer to the docking window that is the parent or a
96 predecessor of the content window.
98 When the view shell is not placed in a docking window, e.g. when
99 shown in the center pane, then <NULL?> is returned.
101 DockingWindow
* GetDockingWindow (void);
103 virtual ::com::sun::star::uno::Reference
<
104 ::com::sun::star::accessibility::XAccessible
>
105 CreateAccessibleDocumentView (::sd::Window
* pWindow
);
107 virtual css::uno::Reference
<css::drawing::XDrawSubController
> CreateSubController (void);
109 /** Relocate all toplevel controls to the given parent window.
111 virtual bool RelocateToParentWindow (::Window
* pParentWindow
);
113 /// returns <TRUE/> if and only if the given window is the panel anchor window of our ToolPanelDeck
114 bool IsPanelAnchorWindow( const ::Window
& i_rWindow
) const;
116 /** creates an XUIElement for the given standard panel
118 ::com::sun::star::uno::Reference
< ::com::sun::star::ui::XUIElement
>
119 CreatePanelUIElement(
120 const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& i_rDocFrame
,
121 const OUString
& i_rPanelResourceURL
125 ::boost::scoped_ptr
< ToolPanelViewShell_Impl
> mpImpl
;
127 ::boost::shared_ptr
<TaskPaneShellManager
> mpSubShellManager
;
129 /** The id of the menu in the menu bar/tool box of the parent docking
134 /** Create a popup menu. it contains two sections, one for
135 docking or un-docking the tool panel, one for toggling the
136 visibility state of the tool panel items.
138 According to this flag one of the lock/unlock entries is
141 ::std::auto_ptr
<PopupMenu
> CreatePopupMenu (bool bIsDocking
);
144 /** Initialize the task pane view shell if that has not yet been done
145 before. If mbIsInitialized is already set to <TRUE/> then this
146 method returns immediately.
148 void Initialize (void);
154 } } // end of namespace ::sd::toolpanel
158 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */