ToolPanelViewShell.hxx (c45d927a) ToolPanelViewShell.hxx (3e459a30)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24#ifndef SD_TOOL_PANEL_VIEW_SHELL_HXX
25#define SD_TOOL_PANEL_VIEW_SHELL_HXX
26
27#include "ViewShell.hxx"

--- 6 unchanged lines hidden (view full) ---

34#include <sfx2/dockwin.hxx>
35
36#include <boost/shared_ptr.hpp>
37#include <boost/scoped_ptr.hpp>
38
39class PopupMenu;
40
41namespace com { namespace sun { namespace star { namespace ui {
20 *************************************************************/
21
22
23
24#ifndef SD_TOOL_PANEL_VIEW_SHELL_HXX
25#define SD_TOOL_PANEL_VIEW_SHELL_HXX
26
27#include "ViewShell.hxx"

--- 6 unchanged lines hidden (view full) ---

34#include <sfx2/dockwin.hxx>
35
36#include <boost/shared_ptr.hpp>
37#include <boost/scoped_ptr.hpp>
38
39class PopupMenu;
40
41namespace com { namespace sun { namespace star { namespace ui {
42 class XUIElement;
42 class XUIElement;
43} } } }
44
45namespace sd {
46class PaneDockingWindow;
47
48namespace toolpanel {
49class TaskPaneShellManager;
50class TitleToolBox;
51class TitleBar;
52class TitledControl;
53class ToolPanelViewShell_Impl;
54/** The tool panel is a view shell for some very specific reasons:
43} } } }
44
45namespace sd {
46class PaneDockingWindow;
47
48namespace toolpanel {
49class TaskPaneShellManager;
50class TitleToolBox;
51class TitleBar;
52class TitledControl;
53class ToolPanelViewShell_Impl;
54/** The tool panel is a view shell for some very specific reasons:
55 - It fits better into the concept of panes being docking windows whose
56 content, a view shell, can be exchanged on runtime.
57 - A control in the tool panel that wants to show a context menu has to
58 do that over the dispatcher of a shell. These shells, usually
59 implemented by the controls themselves, have to be managed by someone.
60 If interpreted as object bars this can be handled by the
61 ObjectBarManager of the ViewShell.
55 - It fits better into the concept of panes being docking windows whose
56 content, a view shell, can be exchanged on runtime.
57 - A control in the tool panel that wants to show a context menu has to
58 do that over the dispatcher of a shell. These shells, usually
59 implemented by the controls themselves, have to be managed by someone.
60 If interpreted as object bars this can be handled by the
61 ObjectBarManager of the ViewShell.
62*/
63class ToolPanelViewShell
62*/
63class ToolPanelViewShell
64 : public ViewShell
64 : public ViewShell
65{
66public:
65{
66public:
67 TYPEINFO();
68 SFX_DECL_INTERFACE(SD_IF_SDTOOLPANELSHELL)
67 TYPEINFO();
68 SFX_DECL_INTERFACE(SD_IF_SDTOOLPANELSHELL)
69
69
70 ToolPanelViewShell (
71 SfxViewFrame* pFrame,
72 ViewShellBase& rViewShellBase,
73 ::Window* pParentWindow,
74 FrameView* pFrameView);
75 virtual ~ToolPanelViewShell (void);
70 ToolPanelViewShell (
71 SfxViewFrame* pFrame,
72 ViewShellBase& rViewShellBase,
73 ::Window* pParentWindow,
74 FrameView* pFrameView);
75 virtual ~ToolPanelViewShell (void);
76
76
77 /** Register the SFX interfaces so that (some of) the controls can be
78 pushed as SFX shells on the shell stack and process slot calls and
79 so on.
80 */
81 static void RegisterControls (void);
77 /** Register the SFX interfaces so that (some of) the controls can be
78 pushed as SFX shells on the shell stack and process slot calls and
79 so on.
80 */
81 static void RegisterControls (void);
82
82
83 virtual void GetFocus (void);
84 virtual void LoseFocus (void);
85 virtual void KeyInput (const KeyEvent& rEvent);
83 virtual void GetFocus (void);
84 virtual void LoseFocus (void);
85 virtual void KeyInput (const KeyEvent& rEvent);
86 using sd::ViewShell::KeyInput;
87
88 virtual SdPage* GetActualPage (void);
89 virtual SdPage* getCurrentPage (void) const;
90
91 virtual void ArrangeGUIElements (void);
92
86 using sd::ViewShell::KeyInput;
87
88 virtual SdPage* GetActualPage (void);
89 virtual SdPage* getCurrentPage (void) const;
90
91 virtual void ArrangeGUIElements (void);
92
93 TaskPaneShellManager& GetSubShellManager (void) const;
93 TaskPaneShellManager& GetSubShellManager (void) const;
94
94
95 /** deactivates the given panel, bypassing the configuration controller. Only valid for tool panels which are
96 not under the drawing framework's control.
97 */
98 void ActivatePanel( const ::rtl::OUString& i_rPanelResourceURL );
95 /** deactivates the given panel, bypassing the configuration controller. Only valid for tool panels which are
96 not under the drawing framework's control.
97 */
98 void ActivatePanel( const ::rtl::OUString& i_rPanelResourceURL );
99
99
100 /** deactivates the given panel, bypassing the configuration controller
101 */
102 void DeactivatePanel( const ::rtl::OUString& i_rPanelResourceURL );
100 /** deactivates the given panel, bypassing the configuration controller
101 */
102 void DeactivatePanel( const ::rtl::OUString& i_rPanelResourceURL );
103
103
104 /** Return a pointer to the docking window that is the parent or a
105 predecessor of the content window.
106 @return
107 When the view shell is not placed in a docking window, e.g. when
108 shown in the center pane, then <NULL?> is returned.
109 */
110 DockingWindow* GetDockingWindow (void);
104 /** Return a pointer to the docking window that is the parent or a
105 predecessor of the content window.
106 @return
107 When the view shell is not placed in a docking window, e.g. when
108 shown in the center pane, then <NULL?> is returned.
109 */
110 DockingWindow* GetDockingWindow (void);
111
111
112 virtual ::com::sun::star::uno::Reference<
113 ::com::sun::star::accessibility::XAccessible>
114 CreateAccessibleDocumentView (::sd::Window* pWindow);
112 virtual ::com::sun::star::uno::Reference<
113 ::com::sun::star::accessibility::XAccessible>
114 CreateAccessibleDocumentView (::sd::Window* pWindow);
115
115
116 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
116 virtual css::uno::Reference<css::drawing::XDrawSubController> CreateSubController (void);
117
117
118 /** Relocate all toplevel controls to the given parent window.
119 */
120 virtual bool RelocateToParentWindow (::Window* pParentWindow);
118 /** Relocate all toplevel controls to the given parent window.
119 */
120 virtual bool RelocateToParentWindow (::Window* pParentWindow);
121
121
122 /// returns <TRUE/> if and only if the given window is the panel anchor window of our ToolPanelDeck
123 bool IsPanelAnchorWindow( const ::Window& i_rWindow ) const;
122 /// returns <TRUE/> if and only if the given window is the panel anchor window of our ToolPanelDeck
123 bool IsPanelAnchorWindow( const ::Window& i_rWindow ) const;
124
124
125 /** creates an XUIElement for the given standard panel
126 */
127 ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >
128 CreatePanelUIElement(
129 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocFrame,
130 const ::rtl::OUString& i_rPanelResourceURL
131 );
125 /** creates an XUIElement for the given standard panel
126 */
127 ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >
128 CreatePanelUIElement(
129 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocFrame,
130 const ::rtl::OUString& i_rPanelResourceURL
131 );
132
133private:
132
133private:
134 ::boost::scoped_ptr< ToolPanelViewShell_Impl > mpImpl;
134 ::boost::scoped_ptr< ToolPanelViewShell_Impl > mpImpl;
135
135
136 ::boost::shared_ptr<TaskPaneShellManager> mpSubShellManager;
136 ::boost::shared_ptr<TaskPaneShellManager> mpSubShellManager;
137
137
138 /** The id of the menu in the menu bar/tool box of the parent docking
139 window.
140 */
141 sal_uInt16 mnMenuId;
138 /** The id of the menu in the menu bar/tool box of the parent docking
139 window.
140 */
141 sal_uInt16 mnMenuId;
142
142
143 /** Create a popup menu. it contains two sections, one for
144 docking or un-docking the tool panel, one for toggling the
145 visibility state of the tool panel items.
146 @param bIsDocking
147 According to this flag one of the lock/unlock entries is
148 made disabled.
149 */
150 ::std::auto_ptr<PopupMenu> CreatePopupMenu (bool bIsDocking);
143 /** Create a popup menu. It contains two sections, one for
144 docking or un-docking the tool panel, one for toggling the
145 visibility state of the tool panel items.
146 @param bIsDocking
147 According to this flag one of the lock/unlock entries is
148 made disabled.
149 */
150 ::std::auto_ptr<PopupMenu> CreatePopupMenu (bool bIsDocking);
151
152
151
152
153 /** Initialize the task pane view shell if that has not yet been done
154 before. If mbIsInitialized is already set to <TRUE/> then this
155 method returns immediately.
156 */
157 void Initialize (void);
153 /** Initialize the task pane view shell if that has not yet been done
154 before. If mbIsInitialized is already set to <TRUE/> then this
155 method returns immediately.
156 */
157 void Initialize (void);
158};
159
160
161
162
163} } // end of namespace ::sd::toolpanel
164
165#endif
158};
159
160
161
162
163} } // end of namespace ::sd::toolpanel
164
165#endif