summaryrefslogtreecommitdiff
path: root/sfx2/inc
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-14 10:37:41 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-14 10:37:41 +0200
commitdf0f53a275c1494fb43819ee48ff19b3031ffb45 (patch)
treef4b8352dc02d5b7fcb74001221935f76b913ad24 /sfx2/inc
parent0585053da56f31b6b5f20a720d54aa1d33f8e5c9 (diff)
slidecopy: re-implemented the TaskPane's "View" menu in SFX, using the code formerly found in SD
Diffstat (limited to 'sfx2/inc')
-rw-r--r--sfx2/inc/sfx2/taskpane.hxx42
-rw-r--r--sfx2/inc/sfx2/titledockwin.hxx23
2 files changed, 62 insertions, 3 deletions
diff --git a/sfx2/inc/sfx2/taskpane.hxx b/sfx2/inc/sfx2/taskpane.hxx
index 3f5bc1ce873a..94a80ed28e06 100644
--- a/sfx2/inc/sfx2/taskpane.hxx
+++ b/sfx2/inc/sfx2/taskpane.hxx
@@ -95,6 +95,11 @@ namespace sfx2
static bool ModuleHasToolPanels( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& i_rDocumentFrame );
/** provides access to the Window aspect of the PanelDeck
+
+ Be careful with this method. For instance, you're not allowed to insert arbitrary IToolPanel implementations
+ into the deck, as the ModuleTaskPane has certain assumptions about the panel implementations. However,
+ you're allowed to remove and re-insert panels, which have originally been created by the ModuleTaskPane
+ itself.
*/
::svt::ToolPanelDeck& GetPanelDeck();
const ::svt::ToolPanelDeck& GetPanelDeck() const;
@@ -119,6 +124,39 @@ namespace sfx2
};
//==================================================================================================================
+ //= TaskPaneController
+ //==================================================================================================================
+ class TaskPaneController_Impl;
+ /** is a helper class for connecting a ModuleTaskPane and a TitledDockingWindow, for clients of the ModuleTaskPane
+ which do not use the TaskPaneDockingWindow
+
+ The controller will add a drop down menu to the docking window which contains one item for each panel in the
+ panel deck, and allows toggling their visibility.
+ */
+ class SFX2_DLLPUBLIC TaskPaneController
+ {
+ public:
+ TaskPaneController(
+ ModuleTaskPane& i_rTaskPane,
+ TitledDockingWindow& i_rDockingWindow
+ );
+ ~TaskPaneController();
+
+ /** sets the default title to be used for the TitledDockingWindow
+
+ When the controller switches the docking window to "tabbed" mode, then the title of the docking window
+ will contain the name of the currently active panel (since this name isn't to be seen elsewhere).
+ When the controller switches the docking window to "drawer" mode, then the title of the docking window
+ contains the default title as given here (since in this mode, the names of the panels are shown in
+ the drawers).
+ */
+ void SetDefaultTitle( const String& i_rTitle );
+
+ private:
+ ::boost::scoped_ptr< TaskPaneController_Impl > m_pImpl;
+ };
+
+ //==================================================================================================================
//= TaskPaneDockingWindow
//==================================================================================================================
class TaskPaneDockingWindow : public TitledDockingWindow
@@ -130,13 +168,13 @@ namespace sfx2
protected:
// Window overridables
virtual void GetFocus();
- virtual long Notify( NotifyEvent& i_rNotifyEvent );
// TitledDockingWindow overridables
virtual void onLayoutDone();
private:
- ModuleTaskPane m_aTaskPane;
+ ModuleTaskPane m_aTaskPane;
+ TaskPaneController m_aPaneController;
};
//......................................................................................................................
diff --git a/sfx2/inc/sfx2/titledockwin.hxx b/sfx2/inc/sfx2/titledockwin.hxx
index 2d26a2429e24..ebb4497a0ba2 100644
--- a/sfx2/inc/sfx2/titledockwin.hxx
+++ b/sfx2/inc/sfx2/titledockwin.hxx
@@ -58,6 +58,12 @@ namespace sfx2
/** sets a title to be displayed in the docking window
*/
void SetTitle( const String& i_rTitle );
+ /** returns the current title displayed in the docking window
+
+ Note that if you never called SetTitle before, then this method will not return an empty string,
+ but the window text (Window::GetText), since this is what is displayed as title then.
+ */
+ String GetTitle() const;
/** adds a drop down item to the toolbox. Usually, this is used to add some kind of menu to the toolbox.
@@ -75,6 +81,16 @@ namespace sfx2
return impl_addDropDownToolBoxItem( i_rItemText, i_nHelpId, i_rCallback );
}
+ void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { m_aEndDockingHdl = i_rEndDockingHdl; }
+ const Link& GetEndDockingHdl() const { return m_aEndDockingHdl; }
+
+ /** resets the toolbox. Upon return, the only item in the toolbox is the closer.
+ */
+ void ResetToolBox()
+ {
+ impl_resetToolBox();
+ }
+
/** returns the content window, which is to be used as parent window for any content to be displayed
in the docking window.
*/
@@ -92,11 +108,14 @@ namespace sfx2
virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent );
virtual void SetText( const String& i_rText );
+ // DockingWindow overridables
+ void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+
// own overridables
virtual void onLayoutDone();
protected:
- /** initializes the toolbox. Upon return, the only item in the toolbox is the closer.
+ /** internal version of ResetToolBox
*/
void impl_resetToolBox();
@@ -122,6 +141,8 @@ namespace sfx2
ToolBox m_aToolbox;
Window m_aContentWindow;
+ Link m_aEndDockingHdl;
+
/** The border that is painted arround the inner window. The bevel
shadow lines are part of the border, so where the border is 0 no
such line is painted.