diff options
author | Matthias Huetsch [mhu] <matthias.huetsch@sun.com> | 2010-06-09 08:39:08 +0200 |
---|---|---|
committer | Matthias Huetsch [mhu] <matthias.huetsch@sun.com> | 2010-06-09 08:39:08 +0200 |
commit | e40e1248092748ac59f8ec76ddaf16c8b2417d6b (patch) | |
tree | 5872a5bca35cf222dcc2a1c0d492a28c79d86c7f /sd/source/ui/dlg/PaneChildWindows.cxx | |
parent | a2119be569202841c5aa6967cd917ba9a53ea79a (diff) | |
parent | 47b5ec4b0b48b7108715cb1e780ad3dca284cfa9 (diff) |
Update from master repository (DEV300_m81).
Diffstat (limited to 'sd/source/ui/dlg/PaneChildWindows.cxx')
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/dlg/PaneChildWindows.cxx | 86 |
1 files changed, 50 insertions, 36 deletions
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx index ca8ee8724037..6a6d515822f8 100644..100755 --- a/sd/source/ui/dlg/PaneChildWindows.cxx +++ b/sd/source/ui/dlg/PaneChildWindows.cxx @@ -29,28 +29,26 @@ #include "precompiled_sd.hxx" #include "PaneChildWindows.hxx" #include "PaneDockingWindow.hrc" +#include "PaneDockingWindow.hxx" +#include "ViewShellBase.hxx" +#include "framework/FrameworkHelper.hxx" +#include "taskpane/ToolPanelViewShell.hxx" #include "app.hrc" #include "strings.hrc" #include "sdresid.hxx" + #include <sfx2/app.hxx> #include <sfx2/dockwin.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> - -namespace sd -{ - SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS) - SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW) - SFX_IMPL_DOCKINGWINDOW(RightPaneChildWindow, SID_RIGHT_PANE) -} - - -#include "PaneDockingWindow.hxx" -#include "ViewShellBase.hxx" -#include "framework/FrameworkHelper.hxx" +#include <tools/diagnose_ex.h> namespace sd { +SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS) +SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW) +SFX_IMPL_DOCKINGWINDOW( ToolPanelChildWindow, SID_TASKPANE) + //===== PaneChildWindow ======================================================= PaneChildWindow::PaneChildWindow ( @@ -58,8 +56,8 @@ PaneChildWindow::PaneChildWindow ( USHORT nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo, - const ResId& rResId, - const ::rtl::OUString& rsTitle, + const USHORT nDockWinTitleResId, + const USHORT nTitleBarResId, SfxChildAlignment eAlignment) : SfxChildWindow (pParentWindow, nId) { @@ -67,9 +65,8 @@ PaneChildWindow::PaneChildWindow ( pBindings, this, pParentWindow, - rResId, - framework::FrameworkHelper::msLeftImpressPaneURL, - rsTitle); + SdResId( nDockWinTitleResId ), + String( SdResId( nTitleBarResId ) ) ); eChildAlignment = eAlignment; static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo); SetHideNotDelete(TRUE); @@ -112,8 +109,8 @@ LeftPaneImpressChildWindow::LeftPaneImpressChildWindow ( nId, pBindings, pInfo, - SdResId(FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW), - String(SdResId(STR_LEFT_PANE_IMPRESS_TITLE)), + FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW, + STR_LEFT_PANE_IMPRESS_TITLE, SFX_ALIGN_LEFT) { } @@ -133,8 +130,8 @@ LeftPaneDrawChildWindow::LeftPaneDrawChildWindow ( nId, pBindings, pInfo, - SdResId(FLT_LEFT_PANE_DRAW_DOCKING_WINDOW), - String(SdResId(STR_LEFT_PANE_DRAW_TITLE)), + FLT_LEFT_PANE_DRAW_DOCKING_WINDOW, + STR_LEFT_PANE_DRAW_TITLE, SFX_ALIGN_LEFT) { } @@ -142,23 +139,40 @@ LeftPaneDrawChildWindow::LeftPaneDrawChildWindow ( -//===== RightPaneChildWindow ================================================== - -RightPaneChildWindow::RightPaneChildWindow ( - ::Window* pParentWindow, - USHORT nId, - SfxBindings* pBindings, - SfxChildWinInfo* pInfo) - : PaneChildWindow( - pParentWindow, - nId, - pBindings, - pInfo, - SdResId(FLT_RIGHT_PANE_DOCKING_WINDOW), - String(SdResId(STR_RIGHT_PANE_TITLE)), - SFX_ALIGN_RIGHT) +//====================================================================================================================== +//= ToolPanelChildWindow +//====================================================================================================================== +//---------------------------------------------------------------------------------------------------------------------- +ToolPanelChildWindow::ToolPanelChildWindow( ::Window* i_pParentWindow, USHORT i_nId, SfxBindings* i_pBindings, + SfxChildWinInfo* i_pChildWindowInfo ) + :PaneChildWindow( i_pParentWindow, i_nId, i_pBindings, i_pChildWindowInfo, + FLT_TOOL_PANEL_DOCKING_WINDOW, STR_RIGHT_PANE_TITLE, SFX_ALIGN_RIGHT ) { } +//---------------------------------------------------------------------------------------------------------------------- +void ToolPanelChildWindow::ActivateToolPanel( const ::rtl::OUString& i_rPanelURL ) +{ + SfxDockingWindow* pDockingWindow = dynamic_cast< SfxDockingWindow* >( GetWindow() ); + ViewShellBase* pViewShellBase = ViewShellBase::GetViewShellBase( pDockingWindow->GetBindings().GetDispatcher()->GetFrame() ); + ENSURE_OR_RETURN_VOID( pViewShellBase != NULL, "ToolPanelChildWindow::ActivateToolPanel: no view shell access!" ); + + const ::boost::shared_ptr< framework::FrameworkHelper > pFrameworkHelper( framework::FrameworkHelper::Instance( *pViewShellBase ) ); + + if ( i_rPanelURL.indexOf( framework::FrameworkHelper::msTaskPanelURLPrefix ) == 0 ) + { + // it's one of our standard panels known to the drawing framework + pFrameworkHelper->RequestTaskPanel( i_rPanelURL ); + } + else + { + // TODO: it would be nice if the drawing framework were able to handle non-standard panels, installed by + // extensions, too. As long as this is not the case, we need to take the direct way ... + ::boost::shared_ptr< ViewShell > pViewShell = pFrameworkHelper->GetViewShell( framework::FrameworkHelper::msRightPaneURL ); + toolpanel::ToolPanelViewShell* pToolPanelViewShell = dynamic_cast< toolpanel::ToolPanelViewShell* >( pViewShell.get() ); + ENSURE_OR_RETURN_VOID( pToolPanelViewShell != NULL, "ToolPanelChildWindow::ActivateToolPanel: no tool panel view shell access!" ); + pToolPanelViewShell->ActivatePanel( i_rPanelURL ); + } +} } // end of namespace ::sd |