2004-07-13 07:49:38 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:33:27 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
2008-04-10 13:33:27 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
2008-04-10 13:33:27 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
2008-04-10 13:33:27 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
2008-04-10 13:33:27 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
2008-04-10 13:33:27 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2004-07-13 07:49:38 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 12:34:11 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
2004-07-13 07:49:38 -05:00
|
|
|
#include "PaneChildWindows.hxx"
|
|
|
|
#include "PaneDockingWindow.hrc"
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
#include "PaneDockingWindow.hxx"
|
|
|
|
#include "ViewShellBase.hxx"
|
|
|
|
#include "framework/FrameworkHelper.hxx"
|
2010-05-07 03:19:42 -05:00
|
|
|
#include "taskpane/ToolPanelViewShell.hxx"
|
2004-07-13 07:49:38 -05:00
|
|
|
#include "app.hrc"
|
2007-04-03 09:40:28 -05:00
|
|
|
#include "strings.hrc"
|
2004-07-13 07:49:38 -05:00
|
|
|
#include "sdresid.hxx"
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
|
2004-07-13 07:49:38 -05:00
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
#include <sfx2/dockwin.hxx>
|
2005-10-24 10:15:40 -05:00
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
2010-05-07 03:19:42 -05:00
|
|
|
#include <tools/diagnose_ex.h>
|
2004-07-13 07:49:38 -05:00
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
|
|
|
|
SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
|
2010-04-16 08:14:15 -05:00
|
|
|
SFX_IMPL_DOCKINGWINDOW( ToolPanelChildWindow, SID_TASKPANE)
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
|
2007-04-03 09:40:28 -05:00
|
|
|
//===== PaneChildWindow =======================================================
|
2004-07-13 07:49:38 -05:00
|
|
|
|
2007-04-03 09:40:28 -05:00
|
|
|
PaneChildWindow::PaneChildWindow (
|
2004-07-13 07:49:38 -05:00
|
|
|
::Window* pParentWindow,
|
|
|
|
USHORT nId,
|
|
|
|
SfxBindings* pBindings,
|
2007-04-03 09:40:28 -05:00
|
|
|
SfxChildWinInfo* pInfo,
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
const USHORT nDockWinTitleResId,
|
|
|
|
const USHORT nTitleBarResId,
|
2007-04-03 09:40:28 -05:00
|
|
|
SfxChildAlignment eAlignment)
|
2004-07-13 07:49:38 -05:00
|
|
|
: SfxChildWindow (pParentWindow, nId)
|
|
|
|
{
|
2007-04-03 09:40:28 -05:00
|
|
|
pWindow = new PaneDockingWindow (
|
|
|
|
pBindings,
|
|
|
|
this,
|
|
|
|
pParentWindow,
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
SdResId( nDockWinTitleResId ),
|
|
|
|
String( SdResId( nTitleBarResId ) ) );
|
2007-04-03 09:40:28 -05:00
|
|
|
eChildAlignment = eAlignment;
|
|
|
|
static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
|
|
|
|
SetHideNotDelete(TRUE);
|
|
|
|
|
2005-10-24 10:15:40 -05:00
|
|
|
ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
|
|
|
|
if (pBase != NULL)
|
|
|
|
{
|
2007-04-03 09:40:28 -05:00
|
|
|
framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
|
2005-10-24 10:15:40 -05:00
|
|
|
}
|
|
|
|
}
|
2004-07-13 07:49:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-03 09:40:28 -05:00
|
|
|
PaneChildWindow::~PaneChildWindow (void)
|
2005-10-24 10:15:40 -05:00
|
|
|
{
|
|
|
|
ViewShellBase* pBase = NULL;
|
|
|
|
PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
|
|
|
|
if (pDockingWindow != NULL)
|
|
|
|
pBase = ViewShellBase::GetViewShellBase(
|
|
|
|
pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
|
|
|
|
if (pBase != NULL)
|
2007-04-03 09:40:28 -05:00
|
|
|
framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
|
2005-10-24 10:15:40 -05:00
|
|
|
}
|
2004-07-13 07:49:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-03 09:40:28 -05:00
|
|
|
//===== LeftPaneImpressChildWindow ============================================
|
2004-07-13 07:49:38 -05:00
|
|
|
|
2007-04-03 09:40:28 -05:00
|
|
|
LeftPaneImpressChildWindow::LeftPaneImpressChildWindow (
|
2004-07-13 07:49:38 -05:00
|
|
|
::Window* pParentWindow,
|
|
|
|
USHORT nId,
|
|
|
|
SfxBindings* pBindings,
|
|
|
|
SfxChildWinInfo* pInfo)
|
2007-04-03 09:40:28 -05:00
|
|
|
: PaneChildWindow(
|
|
|
|
pParentWindow,
|
|
|
|
nId,
|
|
|
|
pBindings,
|
|
|
|
pInfo,
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW,
|
|
|
|
STR_LEFT_PANE_IMPRESS_TITLE,
|
2007-04-03 09:40:28 -05:00
|
|
|
SFX_ALIGN_LEFT)
|
2004-07-13 07:49:38 -05:00
|
|
|
{
|
2007-04-03 09:40:28 -05:00
|
|
|
}
|
2004-07-13 07:49:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-03 09:40:28 -05:00
|
|
|
//===== LeftPaneDrawChildWindow ===============================================
|
|
|
|
|
|
|
|
LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
|
|
|
|
::Window* pParentWindow,
|
|
|
|
USHORT nId,
|
|
|
|
SfxBindings* pBindings,
|
|
|
|
SfxChildWinInfo* pInfo)
|
|
|
|
: PaneChildWindow(
|
|
|
|
pParentWindow,
|
|
|
|
nId,
|
|
|
|
pBindings,
|
|
|
|
pInfo,
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
FLT_LEFT_PANE_DRAW_DOCKING_WINDOW,
|
|
|
|
STR_LEFT_PANE_DRAW_TITLE,
|
2007-04-03 09:40:28 -05:00
|
|
|
SFX_ALIGN_LEFT)
|
2005-10-24 10:15:40 -05:00
|
|
|
{
|
|
|
|
}
|
2004-07-13 07:49:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
slidecopy: initial version of a "Tool Panel"
At the moment, this implementation is parallel to the existing TaskPane implementation, but on the medium term, it is
intended to replace it. No change in functionality is planned for the moment, just the panel selection is done via
a tab bar, instead of the the "jumping drawers".
Pending tasks (as known so far):
- Accessibility. No implementation at all, yet.
- showing/hiding tool panels from the "View" drop down menu
- connection to the resource framework. At the moment, de/activating panels completely bypasses the resource
framework.
- alternative implementation of the PanelDeckLayouter which mimics the old design. To be activated by default, for
the moment.
- removal of the (old, by then) TaskPane implementation. Care needs to be taken that the framework API stays
unchanged, i.e., the current ToolPanel resource must be renamed back to RightPane when RightPane is not
occupied anymore by the old implementation. Same for other resource names.
2010-03-15 07:53:19 -05:00
|
|
|
//======================================================================================================================
|
|
|
|
//= ToolPanelChildWindow
|
|
|
|
//======================================================================================================================
|
|
|
|
//----------------------------------------------------------------------------------------------------------------------
|
|
|
|
ToolPanelChildWindow::ToolPanelChildWindow( ::Window* i_pParentWindow, USHORT i_nId, SfxBindings* i_pBindings,
|
|
|
|
SfxChildWinInfo* i_pChildWindowInfo )
|
|
|
|
:PaneChildWindow( i_pParentWindow, i_nId, i_pBindings, i_pChildWindowInfo,
|
2010-03-30 06:46:11 -05:00
|
|
|
FLT_TOOL_PANEL_DOCKING_WINDOW, STR_RIGHT_PANE_TITLE, SFX_ALIGN_RIGHT )
|
2007-04-03 09:40:28 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2010-05-07 03:19:42 -05:00
|
|
|
//----------------------------------------------------------------------------------------------------------------------
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-13 07:49:38 -05:00
|
|
|
} // end of namespace ::sd
|