summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-09 09:37:17 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-09 09:37:17 +0200
commit9c32c9129e18505a6ecc78c6880d96136d101129 (patch)
treee0156f7148a3f1837dc75d49219f5e4bafe88603
parente725e315399f527e63f919a9a6861066b1f41512 (diff)
parent17d7bf8f871c2b2e04a14c3d9cca27e7e6c84cac (diff)
slidecopy: merge CWS wth MWS-m76
-rw-r--r--sd/inc/glob.hrc3
-rw-r--r--sd/inc/glob.hxx2
-rwxr-xr-xsd/prj/build.lst1
-rw-r--r--sd/sdi/ToolPanelViewShell.sdi (renamed from sd/sdi/TaskPaneViewShell.sdi)5
-rw-r--r--sd/sdi/makefile.mk4
-rw-r--r--sd/sdi/sdslots.sdi2
-rw-r--r--sd/source/ui/accessibility/AccessibleTaskPane.cxx94
-rwxr-xr-xsd/source/ui/accessibility/makefile.mk1
-rw-r--r--sd/source/ui/app/menuids2_tmpl.src35
-rw-r--r--sd/source/ui/app/sddll1.cxx12
-rw-r--r--sd/source/ui/app/sddll2.cxx2
-rw-r--r--sd/source/ui/app/sdmod1.cxx1
-rw-r--r--sd/source/ui/app/strings.src8
-rwxr-xr-x[-rw-r--r--]sd/source/ui/dlg/PaneChildWindows.cxx61
-rw-r--r--sd/source/ui/dlg/PaneDockingWindow.cxx12
-rw-r--r--sd/source/ui/dlg/PaneDockingWindow.src16
-rw-r--r--sd/source/ui/dlg/PaneShells.cxx26
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx3
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx7
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx7
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationTracer.cxx8
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationUpdater.cxx34
-rw-r--r--sd/source/ui/framework/factories/BasicPaneFactory.cxx7
-rw-r--r--sd/source/ui/framework/factories/BasicPaneFactory.hxx2
-rw-r--r--sd/source/ui/framework/factories/BasicToolBarFactory.cxx3
-rw-r--r--sd/source/ui/framework/factories/BasicToolBarFactory.hxx2
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx9
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.hxx2
-rw-r--r--sd/source/ui/framework/factories/PresentationFactory.cxx8
-rw-r--r--sd/source/ui/framework/factories/TaskPanelFactory.cxx132
-rw-r--r--sd/source/ui/framework/factories/TaskPanelFactory.hxx2
-rw-r--r--sd/source/ui/framework/factories/ViewShellWrapper.cxx100
-rw-r--r--sd/source/ui/framework/module/ImpressModule.cxx4
-rw-r--r--sd/source/ui/framework/module/ModuleController.cxx4
-rw-r--r--sd/source/ui/framework/module/PresentationModule.cxx1
-rw-r--r--sd/source/ui/framework/module/ToolPanelModule.cxx (renamed from sd/source/ui/framework/module/TaskPaneModule.cxx)13
-rw-r--r--sd/source/ui/framework/module/ToolPanelModule.hxx (renamed from sd/source/ui/framework/module/TaskPaneModule.hxx)9
-rw-r--r--sd/source/ui/framework/module/makefile.mk2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx94
-rw-r--r--sd/source/ui/inc/AccessibleTaskPane.hxx70
-rw-r--r--sd/source/ui/inc/PaneChildWindows.hxx20
-rw-r--r--sd/source/ui/inc/PaneDockingWindow.hrc7
-rw-r--r--sd/source/ui/inc/PaneDockingWindow.hxx12
-rw-r--r--sd/source/ui/inc/PaneShells.hxx9
-rw-r--r--sd/source/ui/inc/ToolPanelChildWindow.hrc30
-rw-r--r--sd/source/ui/inc/ToolPanelChildWindow.hxx55
-rw-r--r--sd/source/ui/inc/framework/PresentationFactory.hxx2
-rw-r--r--sd/source/ui/inc/framework/ViewShellWrapper.hxx63
-rwxr-xr-x[-rw-r--r--]sd/source/ui/inc/taskpane/ControlContainer.hxx1
-rw-r--r--sd/source/ui/inc/taskpane/ILayoutableWindow.hxx2
-rw-r--r--sd/source/ui/inc/taskpane/PanelId.hxx58
-rw-r--r--sd/source/ui/inc/taskpane/ScrollPanel.hxx8
-rw-r--r--sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx2
-rw-r--r--sd/source/ui/inc/taskpane/SubToolPanel.hxx3
-rw-r--r--sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx25
-rw-r--r--sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx16
-rw-r--r--sd/source/ui/inc/taskpane/TitleBar.hxx14
-rw-r--r--sd/source/ui/inc/taskpane/TitledControl.hxx13
-rw-r--r--sd/source/ui/inc/taskpane/ToolPanel.hxx125
-rw-r--r--sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx (renamed from sd/source/ui/inc/TaskPaneViewShell.hxx)130
-rw-r--r--sd/source/ui/slideshow/PaneHider.cxx4
-rw-r--r--sd/source/ui/slidesorter/controller/SlsListener.cxx15
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx1
-rw-r--r--sd/source/ui/slidesorter/model/SlideSorterModel.cxx10
-rw-r--r--sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx3
-rw-r--r--sd/source/ui/toolpanel/CustomToolPanel.cxx290
-rw-r--r--sd/source/ui/toolpanel/CustomToolPanel.hxx113
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.cxx61
-rw-r--r--sd/source/ui/toolpanel/LayoutMenu.hxx33
-rw-r--r--sd/source/ui/toolpanel/LayoutableWindow.hxx79
-rw-r--r--sd/source/ui/toolpanel/ScrollPanel.cxx26
-rw-r--r--sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx41
-rw-r--r--sd/source/ui/toolpanel/StandardToolPanel.cxx163
-rw-r--r--sd/source/ui/toolpanel/StandardToolPanel.hxx84
-rw-r--r--sd/source/ui/toolpanel/SubToolPanel.cxx29
-rw-r--r--sd/source/ui/toolpanel/TaskPaneControlFactory.cxx9
-rw-r--r--sd/source/ui/toolpanel/TaskPaneShellManager.cxx17
-rw-r--r--sd/source/ui/toolpanel/TaskPaneShellManager.hxx7
-rw-r--r--sd/source/ui/toolpanel/TaskPaneToolPanel.cxx101
-rw-r--r--sd/source/ui/toolpanel/TaskPaneToolPanel.hxx97
-rw-r--r--sd/source/ui/toolpanel/TaskPaneTreeNode.cxx11
-rw-r--r--sd/source/ui/toolpanel/TaskPaneViewShell.cxx889
-rw-r--r--sd/source/ui/toolpanel/TestMenu.cxx12
-rw-r--r--sd/source/ui/toolpanel/TestMenu.hxx2
-rw-r--r--sd/source/ui/toolpanel/TestPanel.cxx8
-rw-r--r--sd/source/ui/toolpanel/TestPanel.hxx2
-rw-r--r--sd/source/ui/toolpanel/TitleBar.cxx58
-rw-r--r--sd/source/ui/toolpanel/TitledControl.cxx88
-rw-r--r--sd/source/ui/toolpanel/ToolPanel.cxx289
-rw-r--r--sd/source/ui/toolpanel/ToolPanelChildWindow.cxx68
-rw-r--r--sd/source/ui/toolpanel/ToolPanelChildWindow.src52
-rwxr-xr-xsd/source/ui/toolpanel/ToolPanelDeck.cxx160
-rw-r--r--sd/source/ui/toolpanel/ToolPanelDeck.hxx97
-rwxr-xr-xsd/source/ui/toolpanel/ToolPanelDrawer.cxx282
-rwxr-xr-xsd/source/ui/toolpanel/ToolPanelDrawer.hxx101
-rwxr-xr-xsd/source/ui/toolpanel/ToolPanelViewShell.cxx1271
-rw-r--r--sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx21
-rw-r--r--sd/source/ui/toolpanel/controls/CustomAnimationPanel.hxx12
-rw-r--r--sd/source/ui/toolpanel/controls/DocumentHelper.cxx6
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx3
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPagesPanel.cxx32
-rw-r--r--sd/source/ui/toolpanel/controls/MasterPagesPanel.hxx16
-rw-r--r--sd/source/ui/toolpanel/controls/SlideTransitionPanel.cxx23
-rw-r--r--sd/source/ui/toolpanel/controls/SlideTransitionPanel.hxx12
-rw-r--r--sd/source/ui/toolpanel/controls/TableDesignPanel.cxx21
-rw-r--r--sd/source/ui/toolpanel/controls/TableDesignPanel.hxx12
-rw-r--r--sd/source/ui/toolpanel/makefile.mk8
-rw-r--r--sd/source/ui/tools/ConfigurationAccess.cxx7
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx7
-rw-r--r--sd/source/ui/view/Outliner.cxx4
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx17
-rw-r--r--sd/source/ui/view/ViewShellImplementation.cxx4
-rw-r--r--sd/source/ui/view/ViewTabBar.cxx3
-rw-r--r--sd/source/ui/view/drviews3.cxx3
-rw-r--r--sd/source/ui/view/drviews6.cxx1
-rwxr-xr-x[-rw-r--r--]sd/source/ui/view/sdwindow.cxx1
-rw-r--r--sd/source/ui/view/viewshe3.cxx4
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml2
-rw-r--r--sd/workben/custompanel/Impress.xcu34
-rw-r--r--sd/workben/custompanel/colorpanel.map8
-rw-r--r--sd/workben/custompanel/ctp_factory.cxx195
-rw-r--r--sd/workben/custompanel/ctp_factory.hxx114
-rw-r--r--sd/workben/custompanel/ctp_panel.cxx239
-rw-r--r--sd/workben/custompanel/ctp_panel.hxx98
-rw-r--r--sd/workben/custompanel/ctp_services.cxx92
-rw-r--r--sd/workben/custompanel/delzip0
-rw-r--r--sd/workben/custompanel/description.xml16
-rw-r--r--sd/workben/custompanel/makefile.mk93
-rw-r--r--sd/workben/custompanel/manifest.xml8
129 files changed, 4560 insertions, 2532 deletions
diff --git a/sd/inc/glob.hrc b/sd/inc/glob.hrc
index 7e77d56e4dbb..73189f135e62 100644
--- a/sd/inc/glob.hrc
+++ b/sd/inc/glob.hrc
@@ -138,6 +138,7 @@
#define STR_LEFT_IMPRESS_PANE_SHELL RID_GLOB_START+113
#define STR_LEFT_DRAW_PANE_SHELL RID_GLOB_START+114
#define STR_RIGHT_PANE_SHELL RID_GLOB_START+115
+#define STR_TOOL_PANEL_SHELL RID_GLOB_START+116
#define RID_CUSTOMANIMATION_START RID_GLOB_START+120
#define RID_CUSTOMANIMATION_END RID_GLOB_START+199
@@ -150,6 +151,8 @@
#define DLG_TABLEDESIGNPANE RID_GLOB_START+224
#define STR_TABLEOBJECTBARSHELL RID_GLOB_START+225
#define RID_TABPAGE_PARA_NUMBERING RID_GLOB_START+226
+#define STR_CUSTOMANIMATIONPANE RID_GLOB_START+227
+#define STR_SLIDE_TRANSITION_PANE RID_GLOB_START+228
diff --git a/sd/inc/glob.hxx b/sd/inc/glob.hxx
index 12b63c74b310..278aef490fdb 100644
--- a/sd/inc/glob.hxx
+++ b/sd/inc/glob.hxx
@@ -66,6 +66,8 @@
#define SD_IF_SDRIGHTPANESHELL SFX_INTERFACE_SD_START + 26
#define SD_IF_SDDRAWTABLEOBJECTBAR SFX_INTERFACE_SD_START + 27
#define SD_IF_SDANNOTATIONSHELL SFX_INTERFACE_SD_START + 28
+#define SD_IF_SDTOOLPANELPANESHELL SFX_INTERFACE_SD_START + 29
+#define SD_IF_SDTOOLPANELSHELL SFX_INTERFACE_SD_START + 30
// Inventor-Id fuer StarDraw UserData
const UINT32 SdUDInventor=UINT32('S')*0x00000001+
diff --git a/sd/prj/build.lst b/sd/prj/build.lst
index bc8bf923f7e5..1b565ac71fb0 100755
--- a/sd/prj/build.lst
+++ b/sd/prj/build.lst
@@ -44,3 +44,4 @@ sd sd\source\ui\framework\factories nmake - all sd_framework_factories sd
sd sd\source\ui\framework\tools nmake - all sd_framework_tools sd_inc NULL
sd sd\source\ui\annotations nmake - all sd_uiannotations sd_inc NULL
sd sd\util nmake - all sd_util sd_app sd_cgm sd_core sd_dlg sd_docsh sd_eppt sd_filt sd_func sd_grf sd_unid sd_view sd_xml sd_html sd_ppt sd_accessibility sd_animations sd_toolpanel sd_toolpanel_controls sd_tools sd_slsshell sd_slsmodel sd_slsview sd_slscontroller sd_slscache sd_notes sd_table sd_slideshow sd_presenter sd_undo sd_helper sd_framework_configuration sd_framework_module sd_framework_tools sd_framework_factories sd_text sd_annotations sd_uiannotations NULL
+sd sd\workben\custompanel nmake - all sd_workben_panel sd_inc NULL
diff --git a/sd/sdi/TaskPaneViewShell.sdi b/sd/sdi/ToolPanelViewShell.sdi
index 22f0fba21265..a72342c52da5 100644
--- a/sd/sdi/TaskPaneViewShell.sdi
+++ b/sd/sdi/ToolPanelViewShell.sdi
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -23,7 +22,7 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
- ************************************************************************/
+************************************************************************/
SfxVoidItem TaskPaneApplyToAllSlides SID_TP_APPLY_TO_ALL_SLIDES
[
@@ -302,7 +301,7 @@ shell LayoutMenu
import TaskPaneLayoutMenuInterface[Automation];
}
-shell TaskPaneViewShell
+shell ToolPanelViewShell
{
}
diff --git a/sd/sdi/makefile.mk b/sd/sdi/makefile.mk
index ab128c378afc..a950aad5d7a5 100644
--- a/sd/sdi/makefile.mk
+++ b/sd/sdi/makefile.mk
@@ -66,7 +66,7 @@ SVSDI1DEPEND= \
outlnvsh.sdi \
SlideSorterController.sdi \
ViewShellBase.sdi \
- TaskPaneViewShell.sdi \
+ ToolPanelViewShell.sdi \
sdslots.hrc \
$(PRJ)$/inc$/app.hrc
@@ -88,7 +88,7 @@ SVSDI2DEPEND= \
mediaob.sdi \
outlnvsh.sdi \
ViewShellBase.sdi \
- TaskPaneViewShell.sdi \
+ ToolPanelViewShell.sdi \
sdslots.hrc \
$(PRJ)$/inc$/app.hrc
diff --git a/sd/sdi/sdslots.sdi b/sd/sdi/sdslots.sdi
index 21e60e6a1a79..fbfc8da1903b 100644
--- a/sd/sdi/sdslots.sdi
+++ b/sd/sdi/sdslots.sdi
@@ -104,5 +104,5 @@ ModulePrefix( "Sd" )
include "ViewShellBase.sdi"
include "mediaob.sdi"
include "tables.sdi"
- include "TaskPaneViewShell.sdi"
+ include "ToolPanelViewShell.sdi"
}
diff --git a/sd/source/ui/accessibility/AccessibleTaskPane.cxx b/sd/source/ui/accessibility/AccessibleTaskPane.cxx
deleted file mode 100644
index c2a2dafef296..000000000000
--- a/sd/source/ui/accessibility/AccessibleTaskPane.cxx
+++ /dev/null
@@ -1,94 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sd.hxx"
-
-#include "AccessibleTaskPane.hxx"
-
-#include "AccessibleTreeNode.hxx"
-
-#include "taskpane/ToolPanel.hxx"
-#include "taskpane/ControlContainer.hxx"
-#include "taskpane/TitledControl.hxx"
-#include <com/sun/star/accessibility/AccessibleRole.hpp>
-
-#include <vos/mutex.hxx>
-#include <vcl/svapp.hxx>
-
-using namespace ::rtl;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::uno;
-
-namespace accessibility {
-
-AccessibleTaskPane::AccessibleTaskPane (
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible> & rxParent,
- const OUString& rsName,
- const OUString& rsDescription,
- ::sd::toolpanel::ToolPanel& rTaskPane)
- : AccessibleTreeNode(
- rxParent,
- rTaskPane,
- rsName,
- rsDescription,
- AccessibleRole::PANEL)
-{
-}
-
-
-
-
-AccessibleTaskPane::~AccessibleTaskPane (void)
-{
-}
-
-
-
-
-//===== XServiceInfo ========================================================
-
-OUString SAL_CALL
- AccessibleTaskPane::getImplementationName (void)
- throw (RuntimeException)
-{
- return OUString(RTL_CONSTASCII_USTRINGPARAM("AccessibleTaskPane"));
-}
-
-
-
-
-void AccessibleTaskPane::UpdateStateSet (void)
-{
- // The task pane itself can not be focused.
- UpdateState(AccessibleStateType::FOCUSED, false);
-}
-
-
-} // end of namespace accessibility
diff --git a/sd/source/ui/accessibility/makefile.mk b/sd/source/ui/accessibility/makefile.mk
index d5eb47b06149..25d79aa7f8da 100755
--- a/sd/source/ui/accessibility/makefile.mk
+++ b/sd/source/ui/accessibility/makefile.mk
@@ -56,7 +56,6 @@ SLOFILES = \
$(SLO)$/AccessibleScrollPanel.obj \
$(SLO)$/AccessibleSlideSorterView.obj \
$(SLO)$/AccessibleSlideSorterObject.obj \
- $(SLO)$/AccessibleTaskPane.obj \
$(SLO)$/AccessibleTreeNode.obj \
$(SLO)$/SdShapeTypes.obj
diff --git a/sd/source/ui/app/menuids2_tmpl.src b/sd/source/ui/app/menuids2_tmpl.src
index 54b9ed6ba44c..21d906bfedf0 100644
--- a/sd/source/ui/app/menuids2_tmpl.src
+++ b/sd/source/ui/app/menuids2_tmpl.src
@@ -983,40 +983,5 @@
Text [ en-US ] = "Pre~view Mode" ; \
};
-#define MN_MULTI_PANE_GUI \
- MenuItem\
- {\
- Identifier = SID_MULTI_PANE_GUI ; \
- HelpID = SID_MULTI_PANE_GUI ; \
- Text = "Multi Pane GUI" ; \
- SubMenu = Menu \
- {\
- ItemList =\
- {\
- MenuItem\
- {\
- Identifier = SID_TOOLPANEL ; \
- HelpID = SID_TOOLPANEL ; \
- Check = TRUE ; \
- Text = "Tool Panel" ; \
- };\
- MenuItem\
- {\
- Identifier = SID_SLIDE_BROWSER ; \
- HelpID = SID_SLIDE_BROWSER ; \
- Check = TRUE ; \
- Text = "Slide Browser" ; \
- };\
- MenuItem\
- {\
- Identifier = SID_NOTES_WINDOW ; \
- HelpID = SID_NOTES_WINDOW ; \
- Check = TRUE ; \
- Text = "Notes Window" ; \
- };\
- };\
- };\
- };
-
#endif // _MENUIDS2_SRC
diff --git a/sd/source/ui/app/sddll1.cxx b/sd/source/ui/app/sddll1.cxx
index 30aea6cba7b1..53a2b4e9b1e9 100644
--- a/sd/source/ui/app/sddll1.cxx
+++ b/sd/source/ui/app/sddll1.cxx
@@ -48,12 +48,8 @@
#include "GraphicViewShellBase.hxx"
#include "DrawDocShell.hxx"
#include "GraphicDocShell.hxx"
-#ifndef SD_SLIDEBROWSER_SLIDE_SORTER_VIEW_SHELL_HXX
#include "SlideSorterViewShell.hxx"
-#endif
-#ifndef SD_SLIDEBROWSER_TASK_PANE_VIEW_SHELL_HXX
-#include "TaskPaneViewShell.hxx"
-#endif
+#include "taskpane/ToolPanelViewShell.hxx"
#include "FactoryIds.hxx"
#include "sdmod.hxx"
#include "app.hrc"
@@ -131,8 +127,8 @@ void SdDLL::RegisterInterfaces()
// View shells for the side panes.
::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);
- ::sd::toolpanel::TaskPaneViewShell::RegisterInterface(pMod);
- // Tell the task pane view shell to register the interfaces of its
+ ::sd::toolpanel::ToolPanelViewShell::RegisterInterface(pMod);
+ // Tell the tool panel view shell to register the interfaces of its
// controls.
- ::sd::toolpanel::TaskPaneViewShell::RegisterControls();
+ ::sd::toolpanel::ToolPanelViewShell::RegisterControls();
}
diff --git a/sd/source/ui/app/sddll2.cxx b/sd/source/ui/app/sddll2.cxx
index 50143367944a..8ce387f5aee4 100644
--- a/sd/source/ui/app/sddll2.cxx
+++ b/sd/source/ui/app/sddll2.cxx
@@ -155,7 +155,7 @@ void SdDLL::RegisterControllers()
::avmedia::MediaPlayer::RegisterChildWindow(0, pMod);
::sd::LeftPaneImpressChildWindow::RegisterChildWindow(0, pMod);
::sd::LeftPaneDrawChildWindow::RegisterChildWindow(0, pMod);
- ::sd::RightPaneChildWindow::RegisterChildWindow(0, pMod);
+ ::sd::ToolPanelChildWindow::RegisterChildWindow(0, pMod);
SvxFillToolBoxControl::RegisterControl(0, pMod);
SvxLineStyleToolBoxControl::RegisterControl(0, pMod);
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 743b7a35610d..3c1abc0c7d22 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -68,7 +68,6 @@
#include "sdresid.hxx"
#include "OutlineViewShell.hxx"
#include "ViewShellBase.hxx"
-#include "TaskPaneViewShell.hxx"
#ifndef SD_FRAMW_VIEW_HXX
#include "FrameView.hxx"
#endif
diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index 3066355ef95e..075cbbef37e1 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -1250,6 +1250,14 @@ String DLG_TABLEDESIGNPANE
{
Text [ en-US ] = "Table Designs";
};
+String STR_CUSTOMANIMATIONPANE
+{
+ Text [ en-US ] = "Custom Animation";
+};
+String STR_SLIDE_TRANSITION_PANE
+{
+ Text [ en-US ] = "Slide Transition";
+};
String STR_NAVIGATOR_SHOW_NAMED_SHAPES
{
Text [ en-US ] = "Named shapes";
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx
index ca8ee8724037..ac2cc083b4fb 100644..100755
--- a/sd/source/ui/dlg/PaneChildWindows.cxx
+++ b/sd/source/ui/dlg/PaneChildWindows.cxx
@@ -29,28 +29,24 @@
#include "precompiled_sd.hxx"
#include "PaneChildWindows.hxx"
#include "PaneDockingWindow.hrc"
+#include "PaneDockingWindow.hxx"
+#include "ViewShellBase.hxx"
+#include "framework/FrameworkHelper.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"
-
namespace sd {
+SFX_IMPL_DOCKINGWINDOW(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
+SFX_IMPL_DOCKINGWINDOW(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
+SFX_IMPL_DOCKINGWINDOW( ToolPanelChildWindow, SID_RIGHT_PANE)
+
//===== PaneChildWindow =======================================================
PaneChildWindow::PaneChildWindow (
@@ -58,8 +54,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 +63,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 +107,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 +128,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 +137,15 @@ 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 )
{
}
-
} // end of namespace ::sd
diff --git a/sd/source/ui/dlg/PaneDockingWindow.cxx b/sd/source/ui/dlg/PaneDockingWindow.cxx
index c0dcd76f0fae..439e864e13c0 100644
--- a/sd/source/ui/dlg/PaneDockingWindow.cxx
+++ b/sd/source/ui/dlg/PaneDockingWindow.cxx
@@ -49,7 +49,6 @@ PaneDockingWindow::PaneDockingWindow (
SfxChildWindow *pChildWindow,
::Window* pParent,
const ResId& rResId,
- const ::rtl::OUString& rsPaneURL,
const ::rtl::OUString& rsTitle)
: SfxDockingWindow (
_pBindings,
@@ -57,7 +56,6 @@ PaneDockingWindow::PaneDockingWindow (
pParent,
rResId
),
- msPaneURL(rsPaneURL),
msTitle(rsTitle),
mpTitleToolBox(),
maBorder (3,1,3,3),
@@ -394,6 +392,16 @@ void PaneDockingWindow::DataChanged (const DataChangedEvent& rEvent)
+void PaneDockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+{
+ SfxDockingWindow::EndDocking( rRect, bFloatMode );
+
+ if ( maEndDockingHdl.IsSet() )
+ maEndDockingHdl.Call( this );
+}
+
+
+
::Window* PaneDockingWindow::GetContentWindow (void)
{
return mpContentWindow.get();
diff --git a/sd/source/ui/dlg/PaneDockingWindow.src b/sd/source/ui/dlg/PaneDockingWindow.src
index 0359f9f18182..1fb9dc0a2bf8 100644
--- a/sd/source/ui/dlg/PaneDockingWindow.src
+++ b/sd/source/ui/dlg/PaneDockingWindow.src
@@ -74,3 +74,19 @@ DockingWindow FLT_RIGHT_PANE_DOCKING_WINDOW
Size = MAP_APPFONT (100,200) ;
Text [ en-US ] = "Task Pane" ;
};
+
+DockingWindow FLT_TOOL_PANEL_DOCKING_WINDOW
+{
+ // HelpID = SID_EFFECT_WIN ;
+ Border = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Sizeable = TRUE ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ Zoomable = TRUE ;
+ Dockable = TRUE ;
+ EnableResizing = TRUE ;
+ Size = MAP_APPFONT (100,200) ;
+ Text [ en-US ] = "Task Pane" ;
+};
diff --git a/sd/source/ui/dlg/PaneShells.cxx b/sd/source/ui/dlg/PaneShells.cxx
index 2e8032926846..bb1023482ea0 100644
--- a/sd/source/ui/dlg/PaneShells.cxx
+++ b/sd/source/ui/dlg/PaneShells.cxx
@@ -109,36 +109,30 @@ LeftDrawPaneShell::~LeftDrawPaneShell (void)
-//===== RightPaneShell ========================================================
+//===== ToolPanelPaneShell ========================================================
#undef ShellClass
-#define ShellClass RightPaneShell
+#define ShellClass ToolPanelPaneShell
-SFX_SLOTMAP(RightPaneShell)
+SFX_SLOTMAP( ToolPanelPaneShell )
{
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
-SFX_IMPL_INTERFACE(RightPaneShell, SfxShell, SdResId(STR_RIGHT_PANE_SHELL))
+SFX_IMPL_INTERFACE( ToolPanelPaneShell, SfxShell, SdResId( STR_TOOL_PANEL_SHELL ) )
{
- SFX_CHILDWINDOW_REGISTRATION(
- ::sd::RightPaneChildWindow::GetChildWindowId());
+ SFX_CHILDWINDOW_REGISTRATION( ::sd::ToolPanelChildWindow::GetChildWindowId() );
}
-TYPEINIT1(RightPaneShell, SfxShell);
-
+TYPEINIT1( ToolPanelPaneShell, SfxShell );
-
-RightPaneShell::RightPaneShell (void)
- : SfxShell()
+ToolPanelPaneShell::ToolPanelPaneShell()
+ :SfxShell()
{
- SetName(rtl::OUString::createFromAscii("RightPane"));
+ SetName( ::rtl::OUString::createFromAscii( "ToolPanel" ) );
}
-
-
-
-RightPaneShell::~RightPaneShell (void)
+ToolPanelPaneShell::~ToolPanelPaneShell(void)
{
}
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 9dbf8e22629c..e6fa5df0de04 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -56,6 +56,7 @@
#include <com/sun/star/embed/XEmbedPersist.hpp>
#include <svtools/embedtransfer.hxx>
+#include <tools/diagnose_ex.h>
#include <ViewShell.hxx>
using namespace com::sun::star;
@@ -1268,7 +1269,7 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
}
catch (com::sun::star::uno::Exception&)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
if (nRet == DND_ACTION_NONE)
diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx
index e708909ee928..ff167f07520a 100644
--- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <tools/debug.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -123,8 +124,7 @@ void ConfigurationControllerBroadcaster::NotifyListeners (
}
catch(RuntimeException&)
{
- DBG_ASSERT(false,
- "ConfigurationController: caught exception while notifying listeners");
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
@@ -212,8 +212,7 @@ void ConfigurationControllerBroadcaster::DisposeAndClear (void)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false,
- "ConfigurationController: caught exception while notifying dispose");
+ DBG_UNHANDLED_EXCEPTION();
}
}
else
diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
index bb5aab8a05d3..93ff7ee54e00 100644
--- a/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
@@ -32,6 +32,7 @@
#include "ResourceFactoryManager.hxx"
#include "framework/FrameworkHelper.hxx"
#include <com/sun/star/lang/DisposedException.hpp>
+#include <tools/diagnose_ex.h>
#include <algorithm>
#include <boost/bind.hpp>
@@ -168,7 +169,7 @@ void ConfigurationControllerResourceManager::ActivateResource (
}
catch(Exception&)
{
- OSL_ENSURE(false, "caught exception while activating resource");
+ DBG_UNHANDLED_EXCEPTION();
}
if (xResource.is())
@@ -197,7 +198,7 @@ void ConfigurationControllerResourceManager::ActivateResource (
}
catch (RuntimeException&)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -257,7 +258,7 @@ void ConfigurationControllerResourceManager::DeactivateResource (
}
catch (RuntimeException&)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
#if defined VERBOSE && VERBOSE>=1
diff --git a/sd/source/ui/framework/configuration/ConfigurationTracer.cxx b/sd/source/ui/framework/configuration/ConfigurationTracer.cxx
index 63e45f8bb110..498f0670542e 100644
--- a/sd/source/ui/framework/configuration/ConfigurationTracer.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationTracer.cxx
@@ -41,16 +41,16 @@ void ConfigurationTracer::TraceConfiguration (
const char* pMessage)
{
#ifdef DEBUG
- OSL_TRACE("%s at %p {\n", pMessage, rxConfiguration.get());
+ OSL_TRACE("%s at %p {", pMessage, rxConfiguration.get());
if (rxConfiguration.is())
{
TraceBoundResources(rxConfiguration, NULL, 0);
}
else
{
- OSL_TRACE(" empty\n");
+ OSL_TRACE(" empty");
}
- OSL_TRACE("}\n");
+ OSL_TRACE("}");
#else
(void)rxConfiguration;
(void)pMessage;
@@ -74,7 +74,7 @@ void ConfigurationTracer::TraceBoundResources (
::rtl::OUString sLine (aResourceList[nIndex]->getResourceURL());
for (int i=0; i<nIndentation; ++i)
sLine = sIndentation + sLine;
- OSL_TRACE("%s\n", OUStringToOString(sLine, RTL_TEXTENCODING_UTF8).getStr());
+ OSL_TRACE("%s", OUStringToOString(sLine, RTL_TEXTENCODING_UTF8).getStr());
TraceBoundResources(rxConfiguration, aResourceList[nIndex], nIndentation+1);
}
#else
diff --git a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
index 5db5cb436739..c6133a75a6de 100644
--- a/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationUpdater.cxx
@@ -35,6 +35,7 @@
#include "framework/FrameworkHelper.hxx"
#include <comphelper/scopeguard.hxx>
+#include <tools/diagnose_ex.h>
#include <boost/bind.hpp>
@@ -128,7 +129,7 @@ void ConfigurationUpdater::RequestUpdate (
if (IsUpdatePossible())
{
#if defined VERBOSE && VERBOSE>=1
- OSL_TRACE("UpdateConfiguration start\n");
+ OSL_TRACE("UpdateConfiguration start");
#endif
// Call UpdateConfiguration while that is possible and while someone
@@ -146,7 +147,7 @@ void ConfigurationUpdater::RequestUpdate (
{
mbUpdatePending = true;
#if defined VERBOSE && VERBOSE>=1
- OSL_TRACE("scheduling update for later\n");
+ OSL_TRACE("scheduling update for later");
#endif
}
}
@@ -185,7 +186,7 @@ bool ConfigurationUpdater::IsUpdatePossible (void)
void ConfigurationUpdater::UpdateConfiguration (void)
{
#if defined VERBOSE && VERBOSE>=1
- OSL_TRACE("UpdateConfiguration update\n");
+ OSL_TRACE("UpdateConfiguration update");
#endif
SetUpdateBeingProcessed(true);
comphelper::ScopeGuard aScopeGuard (
@@ -200,7 +201,7 @@ void ConfigurationUpdater::UpdateConfiguration (void)
if (aClassifier.Partition())
{
#if defined VERBOSE && VERBOSE>=2
- OSL_TRACE("ConfigurationUpdater::UpdateConfiguration(\n");
+ OSL_TRACE("ConfigurationUpdater::UpdateConfiguration(");
ConfigurationTracer::TraceConfiguration(
mxRequestedConfiguration, "requested configuration");
ConfigurationTracer::TraceConfiguration(
@@ -232,7 +233,7 @@ void ConfigurationUpdater::UpdateConfiguration (void)
else
{
#if defined VERBOSE && VERBOSE>0
- OSL_TRACE("nothing to do\n");
+ OSL_TRACE("nothing to do");
#if defined VERBOSE && VERBOSE>=2
ConfigurationTracer::TraceConfiguration(
mxRequestedConfiguration, "requested configuration");
@@ -244,8 +245,7 @@ void ConfigurationUpdater::UpdateConfiguration (void)
}
catch (RuntimeException e)
{
- OSL_TRACE("caught exception while updating the current configuration");
- DBG_ASSERT(false, "caught exception while updating the current configuration");
+ DBG_UNHANDLED_EXCEPTION();
}
#if defined VERBOSE && VERBOSE>0
@@ -310,11 +310,11 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie
{
#if defined VERBOSE && VERBOSE>=2
rClassifier.TraceResourceIdVector(
- "requested but not current resources:\n", rClassifier.GetC1minusC2());
+ "requested but not current resources:", rClassifier.GetC1minusC2());
rClassifier.TraceResourceIdVector(
- "current but not requested resources:\n", rClassifier.GetC2minusC1());
+ "current but not requested resources:", rClassifier.GetC2minusC1());
rClassifier.TraceResourceIdVector(
- "requested and current resources:\n", rClassifier.GetC1andC2());
+ "requested and current resources:", rClassifier.GetC1andC2());
#endif
// Updating of the sub controllers is done in two steps. In the
@@ -325,11 +325,11 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie
mpResourceManager->ActivateResources(rClassifier.GetC1minusC2(), mxCurrentConfiguration);
#if defined VERBOSE && VERBOSE>=2
- OSL_TRACE("ConfigurationController::UpdateConfiguration)\n");
+ OSL_TRACE("ConfigurationController::UpdateConfiguration)");
ConfigurationTracer::TraceConfiguration(
- mxRequestedConfiguration, "requested configuration\n");
+ mxRequestedConfiguration, "requested configuration");
ConfigurationTracer::TraceConfiguration(
- mxCurrentConfiguration, "current configuration\n");
+ mxCurrentConfiguration, "current configuration");
#endif
// Deactivate pure anchors that have no child.
@@ -340,7 +340,7 @@ void ConfigurationUpdater::UpdateCore (const ConfigurationClassifier& rClassifie
}
catch(RuntimeException)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -401,7 +401,7 @@ void ConfigurationUpdater::CheckPureAnchors (
if (bDeactiveCurrentResource)
{
#if defined VERBOSE && VERBOSE>=2
- OSL_TRACE("deactiving pure anchor %s because it has no children\n",
+ OSL_TRACE("deactiving pure anchor %s because it has no children",
OUStringToOString(
FrameworkHelper::ResourceIdToString(xResourceId),
RTL_TEXTENCODING_UTF8).getStr());
@@ -458,14 +458,14 @@ void ConfigurationUpdater::SetUpdateBeingProcessed (bool bValue)
IMPL_LINK(ConfigurationUpdater, TimeoutHandler, Timer*, EMPTYARG)
{
- OSL_TRACE("configuration update timer\n");
+ OSL_TRACE("configuration update timer");
if ( ! mbUpdateBeingProcessed
&& mxCurrentConfiguration.is()
&& mxRequestedConfiguration.is())
{
if ( ! AreConfigurationsEquivalent(mxCurrentConfiguration, mxRequestedConfiguration))
{
- OSL_TRACE("configurations differ, requesting update\n");
+ OSL_TRACE("configurations differ, requesting update");
RequestUpdate(mxRequestedConfiguration);
}
}
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 969844f7650d..d6f60506c62f 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -44,6 +44,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString;
@@ -270,7 +271,7 @@ void SAL_CALL BasicPaneFactory::initialize (const Sequence<Any>& aArguments)
Reference<XResource> SAL_CALL BasicPaneFactory::createResource (
const Reference<XResourceId>& rxPaneId)
- throw (RuntimeException)
+ throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
{
ThrowIfDisposed();
@@ -528,8 +529,8 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane (
break;
case RightPaneId:
- pShell.reset(new RightPaneShell());
- nChildWindowId = ::sd::RightPaneChildWindow::GetChildWindowId();
+ pShell.reset(new ToolPanelPaneShell());
+ nChildWindowId = ::sd::ToolPanelChildWindow::GetChildWindowId();
break;
default:
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.hxx b/sd/source/ui/framework/factories/BasicPaneFactory.hxx
index 1f442656d1d9..bceeae60003a 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.hxx
@@ -99,7 +99,7 @@ public:
virtual css::uno::Reference<css::drawing::framework::XResource>
SAL_CALL createResource (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxPaneId)
- throw (css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException);
virtual void SAL_CALL
releaseResource (
diff --git a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx
index 4645b0462399..d353cfc58c1f 100644
--- a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx
@@ -38,6 +38,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::drawing::framework;
namespace sd { namespace framework {
@@ -191,7 +192,7 @@ void SAL_CALL BasicToolBarFactory::disposing (
Reference<XResource> SAL_CALL BasicToolBarFactory::createResource (
const Reference<XResourceId>& rxToolBarId)
- throw (RuntimeException)
+ throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
{
ThrowIfDisposed();
diff --git a/sd/source/ui/framework/factories/BasicToolBarFactory.hxx b/sd/source/ui/framework/factories/BasicToolBarFactory.hxx
index c305c334bf0f..686de897c179 100644
--- a/sd/source/ui/framework/factories/BasicToolBarFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicToolBarFactory.hxx
@@ -80,7 +80,7 @@ public:
createResource (
const css::uno::Reference<
css::drawing::framework::XResourceId>& rxToolBarId)
- throw (css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException);
virtual void SAL_CALL
releaseResource (
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 4f0137ea6530..1320df5c827b 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -42,7 +42,7 @@
#include "DrawViewShell.hxx"
#include "GraphicViewShell.hxx"
#include "OutlineViewShell.hxx"
-#include "TaskPaneViewShell.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "PresentationViewShell.hxx"
#include "SlideSorterViewShell.hxx"
#include "FrameView.hxx"
@@ -55,6 +55,7 @@
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString;
@@ -189,7 +190,7 @@ void SAL_CALL BasicViewFactory::disposing (void)
Reference<XResource> SAL_CALL BasicViewFactory::createResource (
const Reference<XResourceId>& rxViewId)
- throw(RuntimeException)
+ throw(RuntimeException, IllegalArgumentException, WrappedTargetException)
{
Reference<XResource> xView;
const bool bIsCenterPane (
@@ -372,7 +373,7 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
pDescriptor->mpViewShell,
rxViewId,
rxPane->getWindow());
- pDescriptor->mxView = Reference<XResource>(pDescriptor->mpWrapper);
+ pDescriptor->mxView.set( pDescriptor->mpWrapper->queryInterface( XResource::static_type() ), UNO_QUERY_THROW );
}
return pDescriptor;
@@ -449,7 +450,7 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
else if (rsViewURL.equals(FrameworkHelper::msTaskPaneURL))
{
pViewShell.reset(
- new ::sd::toolpanel::TaskPaneViewShell (
+ new ::sd::toolpanel::ToolPanelViewShell(
&rFrame,
*mpBase,
&rWindow,
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.hxx b/sd/source/ui/framework/factories/BasicViewFactory.hxx
index cc9218af26cc..e5bb43551a24 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.hxx
@@ -96,7 +96,7 @@ public:
virtual css::uno::Reference<css::drawing::framework::XResource>
SAL_CALL createResource (
const css::uno::Reference<css::drawing::framework::XResourceId>& rxViewId)
- throw(css::uno::RuntimeException);
+ throw(css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException);
virtual void SAL_CALL releaseResource (
const css::uno::Reference<css::drawing::framework::XResource>& xView)
diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx b/sd/source/ui/framework/factories/PresentationFactory.cxx
index 6ede6e439e02..6f22f1484627 100644
--- a/sd/source/ui/framework/factories/PresentationFactory.cxx
+++ b/sd/source/ui/framework/factories/PresentationFactory.cxx
@@ -34,10 +34,12 @@
#include "ViewShellBase.hxx"
#include <com/sun/star/drawing/framework/XControllerManager.hpp>
#include <cppuhelper/compbase1.hxx>
+#include <tools/diagnose_ex.h>
#include "slideshow.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString;
@@ -154,7 +156,7 @@ PresentationFactory::PresentationFactory (
}
catch (RuntimeException&)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -180,7 +182,7 @@ void SAL_CALL PresentationFactory::disposing (void)
Reference<XResource> SAL_CALL PresentationFactory::createResource (
const Reference<XResourceId>& rxViewId)
- throw (RuntimeException)
+ throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
{
ThrowIfDisposed();
@@ -308,7 +310,7 @@ void SAL_CALL PresentationFactoryProvider::initialize(
}
catch (RuntimeException&)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
diff --git a/sd/source/ui/framework/factories/TaskPanelFactory.cxx b/sd/source/ui/framework/factories/TaskPanelFactory.cxx
index 8942833d2483..574d1c6fec27 100644
--- a/sd/source/ui/framework/factories/TaskPanelFactory.cxx
+++ b/sd/source/ui/framework/factories/TaskPanelFactory.cxx
@@ -27,18 +27,19 @@
#include "precompiled_sd.hxx"
#include "TaskPanelFactory.hxx"
-#include "TaskPaneViewShell.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "DrawController.hxx"
#include "framework/FrameworkHelper.hxx"
#include <cppuhelper/compbase1.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::drawing::framework;
using ::rtl::OUString;
using ::sd::framework::FrameworkHelper;
-using ::sd::toolpanel::TaskPaneViewShell;
namespace sd { namespace framework {
@@ -85,14 +86,11 @@ class TaskPanelResource
{
public:
TaskPanelResource (
- const Reference<XResourceId>& rxResourceId,
- const TaskPaneViewShell::PanelId ePaneId);
+ const Reference<XResourceId>& rxResourceId );
virtual ~TaskPanelResource ();
virtual void SAL_CALL disposing ();
- TaskPaneViewShell::PanelId GetPaneId () const;
-
// XResource
virtual Reference<XResourceId> SAL_CALL getResourceId (void)
@@ -103,7 +101,6 @@ public:
private:
const Reference<XResourceId> mxResourceId;
- const TaskPaneViewShell::PanelId mePaneId;
};
} // end of anonymous namespace.
@@ -185,9 +182,27 @@ void SAL_CALL TaskPanelFactory::initialize(
//===== XResourceController ===================================================
+namespace
+{
+ void lcl_collectResourceURLs( const Reference< XResourceId >& i_rResourceId, ::std::vector< ::rtl::OUString >& o_rResourceURLs )
+ {
+ ENSURE_OR_RETURN_VOID( i_rResourceId.is(), "illegal resource ID" );
+ o_rResourceURLs.resize(0);
+
+ Reference< XResourceId > xResourceId( i_rResourceId );
+ ::rtl::OUString sResourceURL = xResourceId->getResourceURL();
+ while ( sResourceURL.getLength() > 0 )
+ {
+ o_rResourceURLs.push_back( sResourceURL );
+ xResourceId = xResourceId->getAnchor();
+ sResourceURL = xResourceId->getResourceURL();
+ }
+ }
+}
+
Reference<XResource> SAL_CALL TaskPanelFactory::createResource (
const Reference<XResourceId>& rxResourceId)
- throw (RuntimeException)
+ throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
{
Reference<XResource> xResource;
@@ -196,45 +211,26 @@ Reference<XResource> SAL_CALL TaskPanelFactory::createResource (
OUString sResourceURL (rxResourceId->getResourceURL());
- if (sResourceURL.match(FrameworkHelper::msTaskPanelURLPrefix))
+ if ( sResourceURL.match( FrameworkHelper::msTaskPanelURLPrefix ) )
{
- TaskPaneViewShell::PanelId ePaneId (TaskPaneViewShell::PID_UNKNOWN);
+ toolpanel::PanelId ePanelId( toolpanel::GetStandardPanelId( sResourceURL ) );
- if (sResourceURL.equals(FrameworkHelper::msMasterPagesTaskPanelURL))
+ if ( ( ePanelId != toolpanel::PID_UNKNOWN ) && ( mpViewShellBase != NULL ) )
{
- ePaneId = TaskPaneViewShell::PID_MASTER_PAGES;
- }
- else if (sResourceURL.equals(FrameworkHelper::msLayoutTaskPanelURL))
- {
- ePaneId = TaskPaneViewShell::PID_LAYOUT;
- }
- else if (sResourceURL.equals(FrameworkHelper::msTableDesignPanelURL))
- {
- ePaneId = TaskPaneViewShell::PID_TABLE_DESIGN;
- }
- else if (sResourceURL.equals(FrameworkHelper::msCustomAnimationTaskPanelURL))
- {
- ePaneId = TaskPaneViewShell::PID_CUSTOM_ANIMATION;
- }
- else if (sResourceURL.equals(FrameworkHelper::msSlideTransitionTaskPanelURL))
- {
- ePaneId = TaskPaneViewShell::PID_SLIDE_TRANSITION;
- }
+ ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( *mpViewShellBase ) );
- if (ePaneId!=TaskPaneViewShell::PID_UNKNOWN && mpViewShellBase!=NULL)
- {
- toolpanel::TaskPaneViewShell* pTaskPane
- = dynamic_cast<toolpanel::TaskPaneViewShell*>(
- FrameworkHelper::Instance(*mpViewShellBase)
- ->GetViewShell(FrameworkHelper::msRightPaneURL).get());
- if (pTaskPane != NULL)
- {
- xResource = new TaskPanelResource(
- rxResourceId,
- ePaneId);
- pTaskPane->ShowPanel(ePaneId);
- pTaskPane->ExpandPanel(ePaneId);
- }
+ // assume that the top-level anchor is the URL of the pane
+ ::std::vector< ::rtl::OUString > aResourceURLs;
+ lcl_collectResourceURLs( rxResourceId, aResourceURLs );
+
+ const ::rtl::OUString sPaneURL = aResourceURLs[ aResourceURLs.size() - 1 ];
+ const ::boost::shared_ptr< ViewShell > pPaneViewShell( pFrameworkHelper->GetViewShell( sPaneURL ) );
+
+ toolpanel::ToolPanelViewShell* pToolPanel = dynamic_cast< toolpanel::ToolPanelViewShell* >( pPaneViewShell.get() );
+ if ( pToolPanel != NULL )
+ xResource = new TaskPanelResource( rxResourceId );
+
+ OSL_POSTCOND( xResource.is(), "TaskPanelFactory::createResource: did not find the given resource!" );
}
}
@@ -248,16 +244,36 @@ void SAL_CALL TaskPanelFactory::releaseResource (
const Reference<XResource>& rxResource)
throw (RuntimeException)
{
- toolpanel::TaskPaneViewShell* pTaskPane
- = dynamic_cast<toolpanel::TaskPaneViewShell*>(
- FrameworkHelper::Instance(*mpViewShellBase)
- ->GetViewShell(FrameworkHelper::msRightPaneURL).get());
+ ENSURE_OR_RETURN_VOID( rxResource.is(), "illegal resource" );
+ const Reference< XResourceId > xResourceId( rxResource->getResourceId(), UNO_SET_THROW );
+
+ // assume that the top-level anchor is the URL of the pane
+ ::std::vector< ::rtl::OUString > aResourceURLs;
+ lcl_collectResourceURLs( xResourceId, aResourceURLs );
- rtl::Reference<TaskPanelResource> pResource = dynamic_cast<TaskPanelResource*>(
- rxResource.get());
+ OSL_ENSURE( !aResourceURLs.empty(), "TaskPanelFactory::releaseResource: illegal resource/URL!" );
+ if ( !aResourceURLs.empty() )
+ {
+ const ::rtl::OUString sPaneURL = aResourceURLs[ aResourceURLs.size() - 1 ];
+ ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( *mpViewShellBase ) );
+ const ::boost::shared_ptr< ViewShell > pPaneViewShell( pFrameworkHelper->GetViewShell( sPaneURL ) );
+ if ( pPaneViewShell != NULL )
+ {
+ toolpanel::PanelId ePanelId( toolpanel::GetStandardPanelId( xResourceId->getResourceURL() ) );
+ toolpanel::ToolPanelViewShell* pToolPanel = dynamic_cast< toolpanel::ToolPanelViewShell* >( pPaneViewShell.get() );
- if (pTaskPane != NULL && pResource.is())
- pTaskPane->CollapsePanel(pResource->GetPaneId());
+ if ( ( ePanelId != toolpanel::PID_UNKNOWN )
+ && ( pToolPanel != NULL )
+ )
+ {
+ pToolPanel->DeactivatePanel( ePanelId );
+ }
+ else
+ {
+ OSL_ENSURE( false, "TaskPanelFactory::releaseResource: don't know what to do with this resource!" );
+ }
+ }
+ }
Reference<XComponent> xComponent (rxResource, UNO_QUERY);
if (xComponent.is())
@@ -289,11 +305,9 @@ void TaskPanelFactory::ThrowIfDisposed (void) const
namespace {
TaskPanelResource::TaskPanelResource (
- const Reference<XResourceId>& rxResourceId,
- const TaskPaneViewShell::PanelId ePaneId)
+ const Reference<XResourceId>& rxResourceId)
: TaskPanelResourceInterfaceBase(m_aMutex),
- mxResourceId(rxResourceId),
- mePaneId(ePaneId)
+ mxResourceId(rxResourceId)
{
}
@@ -314,14 +328,6 @@ void SAL_CALL TaskPanelResource::disposing ()
-TaskPaneViewShell::PanelId TaskPanelResource::GetPaneId () const
-{
- return mePaneId;
-}
-
-
-
-
Reference<XResourceId> SAL_CALL TaskPanelResource::getResourceId ()
throw (css::uno::RuntimeException)
{
diff --git a/sd/source/ui/framework/factories/TaskPanelFactory.hxx b/sd/source/ui/framework/factories/TaskPanelFactory.hxx
index 1130a106a56c..1ab2fa783a4a 100644
--- a/sd/source/ui/framework/factories/TaskPanelFactory.hxx
+++ b/sd/source/ui/framework/factories/TaskPanelFactory.hxx
@@ -80,7 +80,7 @@ public:
SAL_CALL createResource (
const css::uno::Reference<
css::drawing::framework::XResourceId>& rxResourcesId)
- throw (css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException);
virtual void SAL_CALL releaseResource (
const css::uno::Reference<
diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
index 0a3aeccade7c..575f8537de1c 100644
--- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx
+++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
@@ -29,22 +29,32 @@
#include "framework/ViewShellWrapper.hxx"
#include "framework/Pane.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "ViewShell.hxx"
#include "Window.hxx"
#include <com/sun/star/drawing/framework/XPane.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <rtl/uuid.h>
#include <toolkit/helper/vclunohelper.hxx>
+#include <comphelper/sequence.hxx>
+#include <cppuhelper/typeprovider.hxx>
#include <vcl/svapp.hxx>
#include <vos/mutex.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
+using ::com::sun::star::awt::XWindow;
+using ::com::sun::star::rendering::XCanvas;
+using ::com::sun::star::lang::DisposedException;
+
using ::rtl::OUString;
+using ::sd::toolpanel::ToolPanelViewShell;
namespace sd { namespace framework {
@@ -55,7 +65,8 @@ ViewShellWrapper::ViewShellWrapper (
: ViewShellWrapperInterfaceBase(MutexOwner::maMutex),
mpViewShell(pViewShell),
mxViewId(rxViewId),
- mxWindow(rxWindow)
+ mxWindow(rxWindow),
+ mbIsPane( pViewShell == NULL ? false : ( pViewShell->GetShellType() == ViewShell::ST_TASK_PANE ) )
{
if (rxWindow.is())
{
@@ -79,6 +90,8 @@ ViewShellWrapper::~ViewShellWrapper (void)
void SAL_CALL ViewShellWrapper::disposing (void)
{
+ ::osl::MutexGuard aGuard( maMutex );
+
OSL_TRACE("disposing ViewShellWrapper %x", this);
Reference<awt::XWindow> xWindow (mxWindow);
if (xWindow.is())
@@ -101,13 +114,92 @@ void SAL_CALL ViewShellWrapper::disposing (void)
-bool ViewShellWrapper::IsUnique (void)
+//----- XInterface ------------------------------------------------------------
+
+Any SAL_CALL ViewShellWrapper::queryInterface( const Type& i_rType ) throw (RuntimeException)
{
- return m_refCount==1;
+ Any aInterface( ViewShellWrapperInterfaceBase::queryInterface( i_rType ) );
+ if ( !aInterface.hasValue() )
+ {
+ if ( mbIsPane )
+ aInterface = ViewShellWrapper_PaneBase::queryInterface( i_rType );
+ else
+ aInterface = ViewShellWrapper_ViewBase::queryInterface( i_rType );
+ }
+ return aInterface;
}
+void SAL_CALL ViewShellWrapper::acquire() throw ()
+{
+ ViewShellWrapperInterfaceBase::acquire();
+}
+void SAL_CALL ViewShellWrapper::release() throw ()
+{
+ ViewShellWrapperInterfaceBase::release();
+}
+//----- XTypeProvider ---------------------------------------------------------
+
+Sequence< Type > SAL_CALL ViewShellWrapper::getTypes( ) throw (RuntimeException)
+{
+ const Sequence< Type > aCommonTypes( ViewShellWrapperInterfaceBase::getTypes() );
+ const Sequence< Type > aSpecialTypes(
+ mbIsPane
+ ? ViewShellWrapper_PaneBase::getTypes()
+ : ViewShellWrapper_ViewBase::getTypes()
+ );
+ return ::comphelper::concatSequences( aCommonTypes, aSpecialTypes );
+}
+
+Sequence< ::sal_Int8 > SAL_CALL ViewShellWrapper::getImplementationId( ) throw (RuntimeException)
+{
+ static ::cppu::OImplementationId* pViewId = NULL;
+ static ::cppu::OImplementationId* pPaneId = NULL;
+ if ( !pViewId )
+ {
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( !pViewId )
+ {
+ static ::cppu::OImplementationId aViewId;
+ static ::cppu::OImplementationId aPaneId;
+ pViewId = &aViewId;
+ pPaneId = &aPaneId;
+ }
+ }
+
+ return ( mbIsPane ? pPaneId : pViewId )->getImplementationId();
+}
+
+//----- XPane -----------------------------------------------------------------
+
+Reference< XInterface > ViewShellWrapper::impl_getPaneWindowOrCanvas( const bool i_bWindow )
+{
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::MutexGuard aGuard( maMutex );
+ if ( !mpViewShell.get() )
+ throw DisposedException( ::rtl::OUString(), *this );
+
+ ToolPanelViewShell* pToolPanelShell = dynamic_cast< ToolPanelViewShell* >( mpViewShell.get() );
+ ENSURE_OR_RETURN( pToolPanelShell != NULL, "XPane should be accessible for a ToolPanelViewShell only", NULL );
+
+ ::Window* pPaneWindow = pToolPanelShell->GetToolPanelParentWindow();
+ ENSURE_OR_RETURN( pPaneWindow, "shell is not able to provide a panel parent", NULL );
+
+ if ( i_bWindow )
+ return VCLUnoHelper::GetInterface( pPaneWindow );
+ return pPaneWindow->GetCanvas();
+}
+
+Reference< XWindow > SAL_CALL ViewShellWrapper::getWindow() throw (RuntimeException)
+{
+ return Reference< XWindow >( impl_getPaneWindowOrCanvas( true ), UNO_QUERY );
+}
+
+Reference< XCanvas > SAL_CALL ViewShellWrapper::getCanvas() throw (RuntimeException)
+{
+ return Reference< XCanvas >( impl_getPaneWindowOrCanvas( false ), UNO_QUERY );
+}
//----- XResource -------------------------------------------------------------
@@ -177,7 +269,7 @@ const Sequence<sal_Int8>& ViewShellWrapper::getUnoTunnelId (void)
static Sequence<sal_Int8>* pSequence = NULL;
if (pSequence == NULL)
{
- const ::vos::OGuard aSolarGuard (Application::GetSolarMutex());
+ const ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if (pSequence == NULL)
{
static ::com::sun::star::uno::Sequence<sal_Int8> aSequence (16);
diff --git a/sd/source/ui/framework/module/ImpressModule.cxx b/sd/source/ui/framework/module/ImpressModule.cxx
index 050429b3f289..a5856bc3ebc9 100644
--- a/sd/source/ui/framework/module/ImpressModule.cxx
+++ b/sd/source/ui/framework/module/ImpressModule.cxx
@@ -33,7 +33,7 @@
#include "ViewTabBarModule.hxx"
#include "CenterViewFocusModule.hxx"
#include "SlideSorterModule.hxx"
-#include "TaskPaneModule.hxx"
+#include "ToolPanelModule.hxx"
#include "ToolBarModule.hxx"
#include "ShellStackGuard.hxx"
@@ -54,7 +54,7 @@ void ImpressModule::Initialize (Reference<frame::XController>& rxController)
new SlideSorterModule(
rxController,
FrameworkHelper::msLeftImpressPaneURL);
- TaskPaneModule::Initialize(rxController);
+ ToolPanelModule::Initialize(rxController);
new ToolBarModule(rxController);
new ShellStackGuard(rxController);
}
diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx
index b90ebe851f0e..e910a8df7496 100644
--- a/sd/source/ui/framework/module/ModuleController.cxx
+++ b/sd/source/ui/framework/module/ModuleController.cxx
@@ -35,6 +35,8 @@
#include <boost/bind.hpp>
#include <hash_map>
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
@@ -168,7 +170,7 @@ void ModuleController::LoadFactories (const Reference<XComponentContext>& rxCont
}
catch (Exception&)
{
- OSL_TRACE("ERROR in ModuleController::LoadFactories");
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/sd/source/ui/framework/module/PresentationModule.cxx b/sd/source/ui/framework/module/PresentationModule.cxx
index e28432a25d93..6a5ba5dc5e7f 100644
--- a/sd/source/ui/framework/module/PresentationModule.cxx
+++ b/sd/source/ui/framework/module/PresentationModule.cxx
@@ -31,7 +31,6 @@
#include "CenterViewFocusModule.hxx"
#include "SlideSorterModule.hxx"
-#include "TaskPaneModule.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/sd/source/ui/framework/module/TaskPaneModule.cxx b/sd/source/ui/framework/module/ToolPanelModule.cxx
index 03e2277bdcd3..888fa68ad708 100644
--- a/sd/source/ui/framework/module/TaskPaneModule.cxx
+++ b/sd/source/ui/framework/module/ToolPanelModule.cxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: ToolPanelModule.cxx,v $
+ * $Revision: 1.4 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -27,7 +30,7 @@
#include "precompiled_sd.hxx"
-#include "TaskPaneModule.hxx"
+#include "ToolPanelModule.hxx"
#include "ReadOnlyModeObserver.hxx"
#include "framework/FrameworkHelper.hxx"
@@ -54,7 +57,7 @@ typedef ::cppu::WeakComponentImplHelper1 <
> LocalReadOnlyModeObserverInterfaceBase;
/** This local class enables or disables the ResourceManager of a
- TaskPaneModule. It connects to a ReadOnlyModeObserver and is called
+ ToolPanelModule. It connects to a ReadOnlyModeObserver and is called
when the state of the .uno:EditDoc command changes. When either the
ResourceManager or the ReadOnlyModeObserver are disposed then the
LocalReadOnlyModeObserver disposes itself. The link
@@ -138,9 +141,9 @@ private:
-//===== TaskPaneModule ====================================================
+//===== ToolPanelModule ====================================================
-void TaskPaneModule::Initialize (const Reference<frame::XController>& rxController)
+void ToolPanelModule::Initialize (const Reference<frame::XController>& rxController)
{
::rtl::Reference<ResourceManager> pResourceManager (
new ResourceManager(
diff --git a/sd/source/ui/framework/module/TaskPaneModule.hxx b/sd/source/ui/framework/module/ToolPanelModule.hxx
index 3495e4c93a73..7d728e60e93d 100644
--- a/sd/source/ui/framework/module/TaskPaneModule.hxx
+++ b/sd/source/ui/framework/module/ToolPanelModule.hxx
@@ -1,5 +1,4 @@
/*************************************************************************
- *
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
@@ -23,10 +22,10 @@
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
- ************************************************************************/
+************************************************************************/
-#ifndef SD_FRAMEWORK_TASK_PANE_MODULE_HXX
-#define SD_FRAMEWORK_TASK_PANE_MODULE_HXX
+#ifndef SD_FRAMEWORK_TOOL_PANEL_MODULE_HXX
+#define SD_FRAMEWORK_TOOL_PANEL_MODULE_HXX
#include "ResourceManager.hxx"
@@ -38,7 +37,7 @@ class ReadOnlyModeObserver;
/** This module is responsible for showing the task pane.
*/
-class TaskPaneModule
+class ToolPanelModule
{
public:
static void Initialize (
diff --git a/sd/source/ui/framework/module/makefile.mk b/sd/source/ui/framework/module/makefile.mk
index 56c864a7df53..bec9b1a04075 100644
--- a/sd/source/ui/framework/module/makefile.mk
+++ b/sd/source/ui/framework/module/makefile.mk
@@ -52,7 +52,7 @@ SLOFILES = \
$(SLO)$/ResourceManager.obj \
$(SLO)$/ShellStackGuard.obj \
$(SLO)$/SlideSorterModule.obj \
- $(SLO)$/TaskPaneModule.obj \
+ $(SLO)$/ToolPanelModule.obj \
$(SLO)$/ToolBarModule.obj \
$(SLO)$/ViewTabBarModule.obj
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 25790e736473..1ac2718e1bc6 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -52,6 +52,7 @@
#include "vcl/svapp.hxx"
#include <osl/doublecheckedlocking.h>
#include <osl/getglobalmutex.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -218,7 +219,7 @@ const OUString FrameworkHelper::msViewTabBarURL(
// Task panel URLs.
const ::rtl::OUString FrameworkHelper::msTaskPanelURLPrefix(
- OUString::createFromAscii("private:resource/taskpanel/"));
+ OUString::createFromAscii("private:resource/toolpanel/"));
const ::rtl::OUString FrameworkHelper::msMasterPagesTaskPanelURL(
msTaskPanelURLPrefix + OUString::createFromAscii("MasterPages"));
const ::rtl::OUString FrameworkHelper::msLayoutTaskPanelURL(
@@ -252,6 +253,46 @@ const OUString FrameworkHelper::msModuleControllerService(
const OUString FrameworkHelper::msConfigurationControllerService(
OUString::createFromAscii("com.sun.star.drawing.framework.ConfigurationController"));
+//----- helper ----------------------------------------------------------------
+namespace
+{
+ static ::boost::shared_ptr< ViewShell > lcl_getViewShell( const Reference< XResource >& i_rViewShellWrapper )
+ {
+ ::boost::shared_ptr< ViewShell > pViewShell;
+ if ( !i_rViewShellWrapper.is() )
+ return pViewShell;
+
+ try
+ {
+ Reference<lang::XUnoTunnel> xViewTunnel( i_rViewShellWrapper, UNO_QUERY_THROW );
+ pViewShell = reinterpret_cast< ViewShellWrapper* >(
+ xViewTunnel->getSomething( ViewShellWrapper::getUnoTunnelId() ) )->GetViewShell();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return pViewShell;
+ }
+ Reference< XResource > lcl_getFirstViewInPane( const Reference< XConfigurationController >& i_rConfigController,
+ const Reference< XResourceId >& i_rPaneId )
+ {
+ try
+ {
+ Reference< XConfiguration > xConfiguration( i_rConfigController->getRequestedConfiguration(), UNO_SET_THROW );
+ Sequence< Reference< XResourceId > > aViewIds( xConfiguration->getResources(
+ i_rPaneId, FrameworkHelper::msViewURLPrefix, AnchorBindingMode_DIRECT ) );
+ if ( aViewIds.getLength() > 0 )
+ return i_rConfigController->getResource( aViewIds[0] );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return NULL;
+ }
+}
+
//----- FrameworkHelper::ViewURLMap -------------------------------------------
@@ -438,8 +479,11 @@ bool FrameworkHelper::IsValid (void)
::boost::shared_ptr<ViewShell> FrameworkHelper::GetViewShell (const OUString& rsPaneURL)
{
- Reference<XResourceId> xPaneId (CreateResourceId(rsPaneURL));
- return GetViewShell(GetView(xPaneId));
+ if ( !mxConfigurationController.is() )
+ return ::boost::shared_ptr<ViewShell>();
+
+ Reference<XResourceId> xPaneId( CreateResourceId( rsPaneURL ) );
+ return lcl_getViewShell( lcl_getFirstViewInPane( mxConfigurationController, xPaneId ) );
}
@@ -447,22 +491,7 @@ bool FrameworkHelper::IsValid (void)
::boost::shared_ptr<ViewShell> FrameworkHelper::GetViewShell (const Reference<XView>& rxView)
{
- ::boost::shared_ptr<ViewShell> pViewShell;
-
- try
- {
- Reference<lang::XUnoTunnel> xViewTunnel (rxView, UNO_QUERY);
- if (xViewTunnel.is())
- {
- pViewShell = reinterpret_cast<ViewShellWrapper*>(xViewTunnel->getSomething(
- ViewShellWrapper::getUnoTunnelId()))->GetViewShell();
- }
- }
- catch (RuntimeException&)
- {
- }
-
- return pViewShell;
+ return lcl_getViewShell( rxView.get() );
}
@@ -479,21 +508,11 @@ Reference<XView> FrameworkHelper::GetView (const Reference<XResourceId>& rxPaneO
{
if (rxPaneOrViewId->getResourceURL().match(msViewURLPrefix))
{
- xView = Reference<XView>(
- mxConfigurationController->getResource(rxPaneOrViewId), UNO_QUERY);
+ xView.set( mxConfigurationController->getResource( rxPaneOrViewId ), UNO_QUERY );
}
else
{
- Reference<XConfiguration> xConfiguration (
- mxConfigurationController->getRequestedConfiguration());
- if (xConfiguration.is())
- {
- Sequence<Reference<XResourceId> > aViewIds (xConfiguration->getResources(
- rxPaneOrViewId, msViewURLPrefix, AnchorBindingMode_DIRECT));
- if (aViewIds.getLength() >= 1)
- xView = Reference<XView>(
- mxConfigurationController->getResource(aViewIds[0]), UNO_QUERY);
- }
+ xView.set( lcl_getFirstViewInPane( mxConfigurationController, rxPaneOrViewId ), UNO_QUERY );
}
}
catch (lang::DisposedException&)
@@ -501,7 +520,8 @@ Reference<XView> FrameworkHelper::GetView (const Reference<XResourceId>& rxPaneO
Dispose();
}
catch (RuntimeException&)
- {}
+ {
+ }
return xView;
}
@@ -717,7 +737,7 @@ void FrameworkHelper::HandleModeChangeSlot (
}
catch (RuntimeException&)
{
- OSL_TRACE("HandleModeChangeSlot: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -800,7 +820,7 @@ void FrameworkHelper::WaitForEvent (const OUString& rsEventType) const
if( (osl_getGlobalTimer() - nStartTime) > 60000 )
{
- DBG_ERROR("FrameworkHelper::WaitForEvent(), no event since a minute? giving up!");
+ DBG_ERROR("FrameworkHelper::WaitForEvent(), no event for a minute? giving up!");
break;
}
}
@@ -852,7 +872,7 @@ void FrameworkHelper::UpdateConfiguration (void)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false, "FrameworkHelper::UpdateConfiguration: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
@@ -1053,7 +1073,7 @@ CallbackCaller::CallbackCaller (
}
catch (RuntimeException&)
{
- DBG_ASSERT(false,"ConfigurationUpdateGuard: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1080,7 +1100,7 @@ void CallbackCaller::disposing (void)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false,"~ConfigurationUpdateGuard: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/sd/source/ui/inc/AccessibleTaskPane.hxx b/sd/source/ui/inc/AccessibleTaskPane.hxx
deleted file mode 100644
index 913609ecec87..000000000000
--- a/sd/source/ui/inc/AccessibleTaskPane.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-#ifndef SD_ACCESSIBILITY_ACCESSIBLE_TASK_PANE_HXX
-#define SD_ACCESSIBILITY_ACCESSIBLE_TASK_PANE_HXX
-
-#include "AccessibleTreeNode.hxx"
-
-namespace sd { namespace toolpanel {
-class ToolPanel;
-} }
-
-
-namespace accessibility {
-
-/** Make the task pane as implemented by sd::toolpanel::ToolPanel
- accessible.
- This derived class exists in order to disable the FOCUSED state.
-*/
-class AccessibleTaskPane
- : public AccessibleTreeNode
-{
-public:
- AccessibleTaskPane (
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible> & rxParent,
- const ::rtl::OUString& rsName,
- const ::rtl::OUString& rsDescription,
- ::sd::toolpanel::ToolPanel& rTaskPane);
- ~AccessibleTaskPane (void);
-
- //===== XServiceInfo ====================================================
-
- /** Returns an identifier for the implementation of this object.
- */
- virtual ::rtl::OUString SAL_CALL
- getImplementationName (void)
- throw (::com::sun::star::uno::RuntimeException);
-
-protected:
- virtual void UpdateStateSet (void);
-};
-
-} // end of namespace accessibility
-
-#endif
diff --git a/sd/source/ui/inc/PaneChildWindows.hxx b/sd/source/ui/inc/PaneChildWindows.hxx
index 9995ed4b00c8..c43cd371eb24 100644
--- a/sd/source/ui/inc/PaneChildWindows.hxx
+++ b/sd/source/ui/inc/PaneChildWindows.hxx
@@ -41,8 +41,8 @@ public:
USHORT nId,
SfxBindings* pBindings,
SfxChildWinInfo* pInfo,
- const ResId& rResId,
- const ::rtl::OUString& rsTitle,
+ const USHORT nDockWinTitleResId,
+ const USHORT nTitleBarResId,
SfxChildAlignment eAlignment);
virtual ~PaneChildWindow (void);
};
@@ -74,18 +74,22 @@ public:
-class RightPaneChildWindow
- : public PaneChildWindow
+//======================================================================================================================
+//= ToolPanelChildWindow
+//======================================================================================================================
+class ToolPanelChildWindow : public PaneChildWindow
{
public:
- RightPaneChildWindow (::Window*, USHORT, SfxBindings*, SfxChildWinInfo*);
+ ToolPanelChildWindow(
+ ::Window* i_pParentWindow,
+ USHORT i_nId,
+ SfxBindings* i_pBindings,
+ SfxChildWinInfo* i_pChildWindowInfo );
- SFX_DECL_CHILDWINDOW(RightPaneChildWindow);
+ SFX_DECL_CHILDWINDOW( ToolPanelChildWindow );
};
-
-
} // end of namespace ::sd
#endif
diff --git a/sd/source/ui/inc/PaneDockingWindow.hrc b/sd/source/ui/inc/PaneDockingWindow.hrc
index e8e4a1fba597..47f2ea241097 100644
--- a/sd/source/ui/inc/PaneDockingWindow.hrc
+++ b/sd/source/ui/inc/PaneDockingWindow.hrc
@@ -25,6 +25,7 @@
*
************************************************************************/
-#define FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW 792
-#define FLT_LEFT_PANE_DRAW_DOCKING_WINDOW 793
-#define FLT_RIGHT_PANE_DOCKING_WINDOW 794
+#define FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW 792
+#define FLT_LEFT_PANE_DRAW_DOCKING_WINDOW 793
+#define FLT_RIGHT_PANE_DOCKING_WINDOW 794
+#define FLT_TOOL_PANEL_DOCKING_WINDOW 795
diff --git a/sd/source/ui/inc/PaneDockingWindow.hxx b/sd/source/ui/inc/PaneDockingWindow.hxx
index 03e6cf96c0f0..f40b910e16c8 100644
--- a/sd/source/ui/inc/PaneDockingWindow.hxx
+++ b/sd/source/ui/inc/PaneDockingWindow.hxx
@@ -65,7 +65,6 @@ public:
SfxChildWindow *pChildWindow,
::Window* pParent,
const ResId& rResId,
- const ::rtl::OUString& rsPaneURL,
const ::rtl::OUString& rsTitle);
virtual ~PaneDockingWindow (void);
@@ -77,6 +76,8 @@ public:
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+
/** Initializing the title tool box either creates a new title tool box
or clears all items from an existing one. A closer is added as only
item.
@@ -93,6 +94,9 @@ public:
*/
USHORT AddMenu (const String& rsMenuName, ULONG nHelpId, const Link& rCallback);
+ void SetEndDockingHdl( const Link& i_rEndDockingHdl ) { maEndDockingHdl = i_rEndDockingHdl; }
+ const Link& GetEndDockingHdl() const { return maEndDockingHdl; }
+
/** Set the title of the docking window to the given string. Use this
method when the title is not yet known at the time of construction
or can not be passed to the constructor.
@@ -104,10 +108,6 @@ public:
::boost::shared_ptr<ToolBox> GetTitleToolBox (void) const;
private:
- /** The pane which is represented by the docking window.
- */
- ::rtl::OUString msPaneURL;
-
/** Title that is shown at the top of the docking window.
*/
::rtl::OUString msTitle;
@@ -127,6 +127,8 @@ private:
::boost::scoped_ptr< ::Window> mpContentWindow;
+ Link maEndDockingHdl;
+
/** Remember that a layout is pending, i.e. Resize() has been called
since the last Paint().
*/
diff --git a/sd/source/ui/inc/PaneShells.hxx b/sd/source/ui/inc/PaneShells.hxx
index c34d2ba632d8..de410c2565bf 100644
--- a/sd/source/ui/inc/PaneShells.hxx
+++ b/sd/source/ui/inc/PaneShells.hxx
@@ -75,15 +75,14 @@ public:
/** Shell that displays the right pane for both Impress and Draw. The shell
does not do anything else and has especially no slots.
*/
-class RightPaneShell
- : public SfxShell
+class ToolPanelPaneShell : public SfxShell
{
public:
TYPEINFO();
- SFX_DECL_INTERFACE(SD_IF_SDRIGHTPANESHELL)
+ SFX_DECL_INTERFACE( SD_IF_SDTOOLPANELPANESHELL )
- RightPaneShell (void);
- virtual ~RightPaneShell (void);
+ ToolPanelPaneShell();
+ virtual ~ToolPanelPaneShell();
};
} // end of namespace sd
diff --git a/sd/source/ui/inc/ToolPanelChildWindow.hrc b/sd/source/ui/inc/ToolPanelChildWindow.hrc
deleted file mode 100644
index 61dca11d21cc..000000000000
--- a/sd/source/ui/inc/ToolPanelChildWindow.hrc
+++ /dev/null
@@ -1,30 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-#define FLT_WIN_TOOLPANEL 788
-
-#define TOOLPANEL 1
diff --git a/sd/source/ui/inc/ToolPanelChildWindow.hxx b/sd/source/ui/inc/ToolPanelChildWindow.hxx
deleted file mode 100644
index 721c9baee3ac..000000000000
--- a/sd/source/ui/inc/ToolPanelChildWindow.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-#ifndef SD_TOOL_PANEL_CHILD_WINDOW_HXX
-#define SD_TOOL_PANEL_CHILD_WINDOW_HXX
-
-#include <sfx2/childwin.hxx>
-
-#define TOOLPANEL_CHILD_WINDOW() ( \
- static_cast< ::sd::toolpanel::ToolPanelChildWindow*>( \
- SfxViewFrame::Current()->GetChildWindow( \
- ::sd::toolpanel::ToolPanelChildWindow::GetChildWindowId() \
- )->GetWindow()))
-
-
-namespace sd { namespace toolpanel {
-
-class ToolPanelChildWindow
- : public SfxChildWindow
-{
-public:
- ToolPanelChildWindow (::Window*, USHORT, SfxBindings*, SfxChildWinInfo*);
- virtual ~ToolPanelChildWindow (void);
-
- SFX_DECL_CHILDWINDOW (ToolPanelChildWindow);
-};
-
-
-} } // end of namespaces ::sd::toolpanel
-
-#endif
diff --git a/sd/source/ui/inc/framework/PresentationFactory.hxx b/sd/source/ui/inc/framework/PresentationFactory.hxx
index 4f35813a7205..a607542f2df0 100644
--- a/sd/source/ui/inc/framework/PresentationFactory.hxx
+++ b/sd/source/ui/inc/framework/PresentationFactory.hxx
@@ -82,7 +82,7 @@ public:
SAL_CALL createResource (
const css::uno::Reference<
css::drawing::framework::XResourceId>& rxViewId)
- throw(css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException);
virtual void SAL_CALL releaseResource (
const css::uno::Reference<css::drawing::framework::XResource>& xView)
diff --git a/sd/source/ui/inc/framework/ViewShellWrapper.hxx b/sd/source/ui/inc/framework/ViewShellWrapper.hxx
index 96846e5c08d7..c942d4ec9e18 100644
--- a/sd/source/ui/inc/framework/ViewShellWrapper.hxx
+++ b/sd/source/ui/inc/framework/ViewShellWrapper.hxx
@@ -30,22 +30,26 @@
#include "MutexOwner.hxx"
#include <com/sun/star/drawing/framework/XView.hpp>
+#include <com/sun/star/drawing/framework/XPane.hpp>
#include <com/sun/star/drawing/framework/XRelocatableResource.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <osl/mutex.hxx>
-#include <cppuhelper/compbase4.hxx>
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/implbase1.hxx>
#include <boost/shared_ptr.hpp>
namespace {
-typedef ::cppu::WeakComponentImplHelper4 <
- ::com::sun::star::drawing::framework::XView,
- ::com::sun::star::lang::XUnoTunnel,
- ::com::sun::star::awt::XWindowListener,
- ::com::sun::star::drawing::framework::XRelocatableResource
- > ViewShellWrapperInterfaceBase;
+typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::lang::XUnoTunnel
+ , ::com::sun::star::awt::XWindowListener
+ , ::com::sun::star::drawing::framework::XRelocatableResource
+ > ViewShellWrapperInterfaceBase;
+typedef ::cppu::ImplHelper1 < ::com::sun::star::drawing::framework::XView
+ > ViewShellWrapper_ViewBase;
+typedef ::cppu::ImplHelper1 < ::com::sun::star::drawing::framework::XPane
+ > ViewShellWrapper_PaneBase;
} // end of anonymous namespace.
@@ -57,9 +61,10 @@ namespace sd { namespace framework {
Most importantly it provides a tunnel to the ViewShell implementation.
Then it forwards size changes of the pane window to the view shell.
*/
-class ViewShellWrapper
- : private sd::MutexOwner,
- public ViewShellWrapperInterfaceBase
+class ViewShellWrapper :private sd::MutexOwner
+ ,public ViewShellWrapperInterfaceBase
+ ,public ViewShellWrapper_ViewBase
+ ,public ViewShellWrapper_PaneBase
{
public:
/** Create a new ViewShellWrapper object that wraps the given ViewShell
@@ -90,22 +95,26 @@ public:
*/
::boost::shared_ptr<ViewShell> GetViewShell (void);
- /** Returns whether there is exactly one reference to the called
- ViewShellWrapper object (the number of references to the wrapped
- ViewShell object is not taken into account). This method is
- typically used by the owner of a ViewShellWrapper object to verify
- that, at the end of the ViewShellWrapper object's lifetime, the
- owner holds the last reference and by releasing it will destroy the
- object.
- */
- bool IsUnique (void);
-
-
// XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething (const com::sun::star::uno::Sequence<sal_Int8>& rId)
throw (com::sun::star::uno::RuntimeException);
+ // XInterface
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire( ) throw ();
+ virtual void SAL_CALL release( ) throw ();
+
+ // XTypeProvider
+
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XPane
+
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > SAL_CALL getCanvas( ) throw (::com::sun::star::uno::RuntimeException);
// XResource
@@ -151,10 +160,14 @@ public:
throw (com::sun::star::uno::RuntimeException);
private:
- ::boost::shared_ptr<ViewShell> mpViewShell;
- const ::com::sun::star::uno::Reference<
- com::sun::star::drawing::framework::XResourceId> mxViewId;
- ::com::sun::star::uno::Reference<com::sun::star::awt::XWindow> mxWindow;
+ ::boost::shared_ptr< ViewShell > mpViewShell;
+ const ::com::sun::star::uno::Reference< com::sun::star::drawing::framework::XResourceId > mxViewId;
+ ::com::sun::star::uno::Reference<com::sun::star::awt::XWindow > mxWindow;
+ const bool mbIsPane;
+
+private:
+ // only to be called when mbIsPane is <TRUE/>
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > impl_getPaneWindowOrCanvas( const bool i_bWindow );
};
} } // end of namespace sd::framework
diff --git a/sd/source/ui/inc/taskpane/ControlContainer.hxx b/sd/source/ui/inc/taskpane/ControlContainer.hxx
index b4087da5b51b..9c1652f05887 100644..100755
--- a/sd/source/ui/inc/taskpane/ControlContainer.hxx
+++ b/sd/source/ui/inc/taskpane/ControlContainer.hxx
@@ -28,7 +28,6 @@
#ifndef SD_TOOLPANEL_CONTROL_CONTAINER_HXX
#define SD_TOOLPANEL_CONTROL_CONTAINER_HXX
-#include "TitleBar.hxx"
#include <osl/mutex.hxx>
#include <vector>
diff --git a/sd/source/ui/inc/taskpane/ILayoutableWindow.hxx b/sd/source/ui/inc/taskpane/ILayoutableWindow.hxx
index 7a85120e1ad6..5aad9fa29f78 100644
--- a/sd/source/ui/inc/taskpane/ILayoutableWindow.hxx
+++ b/sd/source/ui/inc/taskpane/ILayoutableWindow.hxx
@@ -48,7 +48,7 @@ public:
/** This interface has to be implemented by windows that want to be
- layouted by a ToolPanel, SubToolPanel, or ScrollablePanel object.
+ layouted by a SubToolPanel or ScrollablePanel object.
*/
class ILayoutableWindow
{
diff --git a/sd/source/ui/inc/taskpane/PanelId.hxx b/sd/source/ui/inc/taskpane/PanelId.hxx
new file mode 100644
index 000000000000..7e26c4e66e68
--- /dev/null
+++ b/sd/source/ui/inc/taskpane/PanelId.hxx
@@ -0,0 +1,58 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_UI_TASKPANE_PANELID_HXX
+#define SD_UI_TASKPANE_PANELID_HXX
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= PanelId
+ //==================================================================================================================
+ /** List of top level panels that can be shown in the task pane.
+ */
+ enum PanelId
+ {
+ PID_UNKNOWN = 0,
+ PID_MASTER_PAGES = 1,
+ PID_LAYOUT = 2,
+ PID_TABLE_DESIGN = 3,
+ PID_CUSTOM_ANIMATION = 4,
+ PID_SLIDE_TRANSITION = 5,
+
+ PID_FIRST_CUSTOM_PANEL = 6
+ };
+
+ PanelId GetStandardPanelId( const ::rtl::OUString& i_rTaskPanelResourceURL );
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
+
+#endif // SD_UI_TASKPANE_PANELID_HXX
diff --git a/sd/source/ui/inc/taskpane/ScrollPanel.hxx b/sd/source/ui/inc/taskpane/ScrollPanel.hxx
index 019e06d9dd44..b3620255f913 100644
--- a/sd/source/ui/inc/taskpane/ScrollPanel.hxx
+++ b/sd/source/ui/inc/taskpane/ScrollPanel.hxx
@@ -60,6 +60,10 @@ public:
parent. This will usually be a child window.
*/
ScrollPanel (TreeNode* pParent);
+ /** Create a new scroll panel which itself is the root of a TreeNode hierarchy
+ parent. This will usually be a child window.
+ */
+ ScrollPanel (::Window& i_rParentWindow);
virtual ~ScrollPanel (void);
/** Add a control to the sub panel. An title bar is added above the
@@ -171,6 +175,10 @@ private:
*/
sal_Int32 LayoutChildren (void);
+ /** ctor-impl
+ */
+ void Construct();
+
Size SetupScrollBars (const Size& rRequiresSize);
sal_Int32 SetupVerticalScrollBar (bool bShow, sal_Int32 nRange);
sal_Int32 SetupHorizontalScrollBar (bool bShow, sal_Int32 nRange);
diff --git a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
index 7d5c4c996bc1..0dadaaced01c 100644
--- a/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
+++ b/sd/source/ui/inc/taskpane/SlideSorterCacheDisplay.hxx
@@ -71,8 +71,6 @@ public:
virtual void Paint (const Rectangle& rBoundingBox);
virtual void Resize (void);
- static std::auto_ptr<ControlFactory> CreateControlFactory (const SdDrawDocument* pDocument);
-
static SlideSorterCacheDisplay* Instance (const SdDrawDocument* pDocument);
void SetPageCount (sal_Int32 nPageCount);
diff --git a/sd/source/ui/inc/taskpane/SubToolPanel.hxx b/sd/source/ui/inc/taskpane/SubToolPanel.hxx
index 9524cdddf748..94a73bc70996 100644
--- a/sd/source/ui/inc/taskpane/SubToolPanel.hxx
+++ b/sd/source/ui/inc/taskpane/SubToolPanel.hxx
@@ -40,8 +40,6 @@ class Window;
namespace sd { namespace toolpanel {
-class ToolPanel;
-
/** The sub tool panel is in function similar to the tool panel. It
differes in two points. First, it is a control that can be used
as element in a tool panel and thus is actually a nested tool
@@ -67,6 +65,7 @@ public:
parent. This will usually be a child window.
*/
SubToolPanel (TreeNode* pParent);
+ SubToolPanel (Window& i_rParentWindow);
virtual ~SubToolPanel (void);
/** Add a control to the sub panel.
diff --git a/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx b/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx
index 483488b665ac..c86c496a770d 100644
--- a/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx
+++ b/sd/source/ui/inc/taskpane/TaskPaneControlFactory.hxx
@@ -58,37 +58,34 @@ public:
ControlFactory (void);
virtual ~ControlFactory (void);
- /** Derived classes should overload InternalCreateControl(), not this
- method.
+ /** creates a tree node which acts as root of an own tree
+
+ Derived classes should overload InternalCreateControl.
*/
- ::std::auto_ptr<TreeNode> CreateControl (TreeNode* pTreeNode);
+ ::std::auto_ptr<TreeNode> CreateControl( ::Window& i_rParent );
protected:
- /** This is the internal hook for derived classes to overload in order
- to provide a new control instance.
- */
- virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode) = 0;
+ virtual TreeNode* InternalCreateControl( ::Window& i_rParent ) = 0;
};
-/** A simple helper class that realizes a ControlFactory that provides its
- newly created controls with one additional argument (additional to the
- parent TreeNode).
+/** A simple helper class that realizes a ControlFactory that is able to create root controls, providing
+ the to-be-created control with an additional parameter.
*/
template<class ControlType, class ArgumentType>
-class ControlFactoryWithArgs1
+class RootControlFactoryWithArg
: public ControlFactory
{
public:
- ControlFactoryWithArgs1 (ArgumentType& rArgument)
+ RootControlFactoryWithArg (ArgumentType& rArgument)
: mrArgument(rArgument)
{}
protected:
- virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode)
+ virtual TreeNode* InternalCreateControl( ::Window& i_rParent )
{
- return new ControlType(pTreeNode, mrArgument);
+ return new ControlType( i_rParent, mrArgument );
}
private:
diff --git a/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx b/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx
index 250e73124854..0dbec3b292c3 100644
--- a/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx
+++ b/sd/source/ui/inc/taskpane/TaskPaneTreeNode.hxx
@@ -53,9 +53,9 @@ enum TreeNodeStateChangeEventId {
/** Base class for all members of the object hierarchy that makes up the
- tool panel. There are usually at least three levels. At the top level
- is the ToolPanel with one instance: the root of the tree. At the
- middle level there are SubToolPanels and Window/Control objects. At the
+ tool panel. In the task pane, there are multiple hierarchies of such nodes,
+ with every panel having an own tree. The pane node is the root of the tree, below
+ that there are SubToolPanels and Window/Control objects. At the
lowest level there are only Window or Control objects.
This class provides the means of communication between objects on
@@ -94,14 +94,6 @@ public:
*/
virtual sal_Int32 GetMinimumWidth (void);
- /** Give each node access to the object bar manager of the tool panel.
-
- At least the root node has to overwrite this method since the
- default implementation simply returns the object bar manager of the
- parent.
- */
- virtual ObjectBarManager* GetObjectBarManager (void);
-
/** The default implementaion always returns <FALSE/>
*/
virtual bool IsResizable (void);
@@ -151,7 +143,7 @@ public:
ControlContainer& GetControlContainer (void);
/** Give each node access to a shell manage. This usually is the shell
- manager of the TaskPaneViewShell.
+ manager of the ToolPanelViewShell.
At least the root node has to overwrite this method since the
default implementation simply returns the shell manager of its
diff --git a/sd/source/ui/inc/taskpane/TitleBar.hxx b/sd/source/ui/inc/taskpane/TitleBar.hxx
index b10adcef07e0..d5b0b7b9a0cd 100644
--- a/sd/source/ui/inc/taskpane/TitleBar.hxx
+++ b/sd/source/ui/inc/taskpane/TitleBar.hxx
@@ -47,16 +47,12 @@ namespace sd { namespace toolpanel {
TBT_SUB_CONTROL_HEADLINE both show a expansion indicator in front of
the title string that shows whether the associated control is
visible (expanded) or not.
- A title bar with TBT_WINDOW_TITLE is typically used only once as the
- title bar of the whole task pane.
- <p>The title bar shows three kinds of indicators: 1) Expansion is
+ <p>The title bar shows two kinds of indicators: 1) Expansion is
displayed by two sets of two bitmaps, a triangle pointing to the right
resp. a minus in a square indicates that the control is collapsed, a
triangle pointing down resp. a plus in a square stands for an expanded
- control. 2) Keyboard focus is indicated by a dotted rectangle. 3) An
- underlined title string is a mouse over indicator for a
- selectable/expandable control.</p>
+ control. 2) Keyboard focus is indicated by a dotted rectangle.
*/
class TitleBar
: public ::Window,
@@ -64,7 +60,6 @@ class TitleBar
{
public:
enum TitleBarType {
- TBT_WINDOW_TITLE,
TBT_CONTROL_TITLE,
TBT_SUB_CONTROL_HEADLINE
};
@@ -90,8 +85,8 @@ public:
virtual bool Expand (bool bFlag = true);
virtual bool IsExpanded (void) const;
virtual void SetEnabledState(bool bFlag);
-
- void SetFocus (bool bFlag);
+ virtual void GetFocus (void);
+ virtual void LoseFocus (void);
virtual void MouseMove(const MouseEvent& rEvent);
/** Empty implementation prevents forwarding to docking window.
@@ -159,7 +154,6 @@ private:
const Rectangle& rTextBox,
int nTitleBarWidth);
- void PaintWindowTitleBar (void);
void PaintPanelControlTitle (void);
void PaintSubPanelHeadLineBar (void);
diff --git a/sd/source/ui/inc/taskpane/TitledControl.hxx b/sd/source/ui/inc/taskpane/TitledControl.hxx
index a5a319ca5219..c5c61594e8d6 100644
--- a/sd/source/ui/inc/taskpane/TitledControl.hxx
+++ b/sd/source/ui/inc/taskpane/TitledControl.hxx
@@ -80,13 +80,6 @@ public:
const ClickHandler& rClickHandler,
TitleBar::TitleBarType eType);
- TitledControl (
- TreeNode* pParent,
- ::std::auto_ptr<ControlFactory> pControlFactory,
- const String& rTitle,
- const ClickHandler& rClickHandler,
- TitleBar::TitleBarType eType);
-
virtual ~TitledControl (void);
@@ -98,7 +91,6 @@ public:
virtual void Resize (void);
virtual void GetFocus (void);
- virtual void LoseFocus (void);
virtual void KeyInput (const KeyEvent& rEvent);
// void Select (bool bExpansionState);
@@ -108,8 +100,8 @@ public:
the control has not yet been created and the given flag is <TRUE/>
then the control is created.
*/
- TreeNode* GetControl (bool bCreate=true);
- const TreeNode* GetConstControl (bool bCreate=true) const;
+ TreeNode* GetControl (void);
+ const TreeNode* GetConstControl () const;
const String& GetTitle (void) const;
@@ -156,7 +148,6 @@ private:
String msTitle;
bool mbVisible;
void* mpUserData;
- ::std::auto_ptr<ControlFactory> mpControlFactory;
::std::auto_ptr<ClickHandler> mpClickHandler;
/** Remember whether to toggle (true) the expansion state when the title
diff --git a/sd/source/ui/inc/taskpane/ToolPanel.hxx b/sd/source/ui/inc/taskpane/ToolPanel.hxx
deleted file mode 100644
index f2c573a21c06..000000000000
--- a/sd/source/ui/inc/taskpane/ToolPanel.hxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-#ifndef SD_TOOL_PANEL_HXX
-#define SD_TOOL_PANEL_HXX
-
-#include "taskpane/TaskPaneTreeNode.hxx"
-#include "taskpane/TitledControl.hxx"
-#include <vcl/ctrl.hxx>
-
-#include <vector>
-#include <memory>
-
-class Window;
-
-namespace sd { namespace toolpanel {
-
-class TaskPaneViewShell;
-class ControlFactory;
-
-/** This control is basically a layout manager for the vertical
- stacking of controls. At any one time there is exactly one of
- them visible. For the others only their title bar is shown.
-
- <p>Each control is independant of both other controls and the tool
- panel itself. To be usable by the tool panel they only have to be
- derived from the vcl Window class.</p>
-*/
-class ToolPanel
- : public Control,
- public TreeNode
-{
-public:
- /** Create a new tool panel with the given window as its parent.
- This will usually be a child window.
- */
- ToolPanel (
- ::Window* pParentWindow,
- TaskPaneViewShell& rViewShell);
-
- virtual ~ToolPanel (void);
-
- /** Append the given control to the end of the list of controls that are
- managed by the tool panel.
- @param pControlFactory
- Factory that provides the control on demand, typically when it
- is expanded the first time.
- @param rTitle
- The string that is displayed in the title bar above the control.
- @param nHelpId
- The help id is set at the title bar not the actual control.
- @param rClickHandler
- The click handler typically expands a control when the user has
- clicked on its title.
- */
- sal_uInt32 AddControl (
- ::std::auto_ptr<ControlFactory> pControlFactory,
- const String& rTitle,
- ULONG nHelpId,
- const TitledControl::ClickHandler& rClickHandler);
-
- virtual void Resize (void);
-
- virtual Size GetPreferredSize (void);
- virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeight);
- virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
- virtual bool IsResizable (void);
- virtual ::Window* GetWindow (void);
-
- virtual void RequestResize (void);
-
- virtual TaskPaneShellManager* GetShellManager (void);
-
- virtual ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible> CreateAccessibleObject (
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible>& rxParent);
-
- using Window::GetWindow;
-
-protected:
- /** Initiate a rearrangement of the controls.
- */
- void ListHasChanged (void);
-
-private:
- TaskPaneViewShell& mrViewShell;
-
- /// Guard against recursive calls or Rearrange().
- bool mbRearrangeActive;
-
- /** Calculate position, size, and visibility of the controls.
- Call this method after the list of controls has changed.
- */
- void Rearrange (void);
-};
-
-
-
-} } // end of namespace ::sd::toolpanel
-
-#endif
diff --git a/sd/source/ui/inc/TaskPaneViewShell.hxx b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx
index d9f432029dc2..a82908ec56e3 100644
--- a/sd/source/ui/inc/TaskPaneViewShell.hxx
+++ b/sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: ToolPanelViewShell.hxx,v $
+ * $Revision: 1.12 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -25,30 +28,33 @@
*
************************************************************************/
-#ifndef SD_TOOLPANEL_TASK_PANE_VIEW_SHELL_HXX
-#define SD_TOOLPANEL_TASK_PANE_VIEW_SHELL_HXX
+#ifndef SD_TOOL_PANEL_VIEW_SHELL_HXX
+#define SD_TOOL_PANEL_VIEW_SHELL_HXX
#include "ViewShell.hxx"
#include "glob.hxx"
+#include "taskpane/PanelId.hxx"
#include "framework/FrameworkHelper.hxx"
#include <vcl/button.hxx>
#include <sfx2/shell.hxx>
#include <sfx2/viewfac.hxx>
#include <sfx2/dockwin.hxx>
-#include <memory>
#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
class PopupMenu;
-namespace sd { namespace toolpanel {
+namespace sd {
+class PaneDockingWindow;
+namespace toolpanel {
class TaskPaneShellManager;
class TitleToolBox;
class TitleBar;
class TitledControl;
-class ToolPanel;
-
+class ToolPanelDeck;
+class ToolPanelViewShell_Impl;
/** The tool panel is a view shell for some very specific reasons:
- It fits better into the concept of panes being docking windows whose
content, a view shell, can be exchanged on runtime.
@@ -58,34 +64,19 @@ class ToolPanel;
If interpreted as object bars this can be handled by the
ObjectBarManager of the ViewShell.
*/
-class TaskPaneViewShell
+class ToolPanelViewShell
: public ViewShell
{
public:
TYPEINFO();
- SFX_DECL_INTERFACE(SD_IF_SDTASKPANEVIEWSHELL)
+ SFX_DECL_INTERFACE(SD_IF_SDTOOLPANELSHELL)
- /** List of top level panels that can be shown in the task pane.
- */
- enum PanelId
- {
- PID__START = 0,
- PID_UNKNOWN = PID__START,
- PID_MASTER_PAGES,
- PID_LAYOUT,
- PID_TABLE_DESIGN,
- PID_ANIMATION_SCHEMES,
- PID_CUSTOM_ANIMATION,
- PID_SLIDE_TRANSITION,
- PID__END = PID_SLIDE_TRANSITION
- };
-
- TaskPaneViewShell (
+ ToolPanelViewShell (
SfxViewFrame* pFrame,
ViewShellBase& rViewShellBase,
::Window* pParentWindow,
FrameView* pFrameView);
- virtual ~TaskPaneViewShell (void);
+ virtual ~ToolPanelViewShell (void);
/** Register the SFX interfaces so that (some of) the controls can be
pushed as SFX shells on the shell stack and process slot calls and
@@ -108,37 +99,33 @@ public:
TaskPaneShellManager& GetSubShellManager (void) const;
- /** Called when a mouse button has been pressed but not yet
- released, this handler is used to show the popup menu of the
- title bar.
+ /** returns the window which should be used as parent for tool panel windows
*/
- DECL_LINK(ToolboxClickHandler, ToolBox*);
- DECL_LINK(MenuSelectHandler, Menu*);
+ ::Window* GetToolPanelParentWindow();
- /** Make the specified panel visible and expand it.
- @param nId
- The id of the panel that is to be made visible.
+ /** activates the given panel, bypassing the configuration controller, deactivates the previously active one.
*/
- void ShowPanel (const PanelId nId);
+ void ActivatePanel( const PanelId i_ePanelId );
- /** Hide and collapse the specified panel.
- @param nId
- The id of the panel that is to hide.
+ /** deactivates the given panel, bypassing the configuration controller
*/
- void HidePanel (const PanelId nId);
+ void DeactivatePanel( const PanelId i_ePanelId );
- /** Expand the specified panel. Its visibility state is not modified.
- @param nId
- The id of the panel that is to expand.
+ /** Return a pointer to the docking window that is the parent or a
+ predecessor of the content window.
+ @return
+ When the view shell is not placed in a docking window, e.g. when
+ shown in the center pane, then <NULL?> is returned.
*/
- void ExpandPanel (const PanelId nId);
+ DockingWindow* GetDockingWindow (void);
- /** Collapse the specified panel. Its visibility state is not
- modified.
- @param nId
- The id of the panel that is to collapse.
+ /** Called when a mouse button has been pressed but not yet
+ released, this handler is used to show the popup menu of the
+ title bar.
*/
- void CollapsePanel (const PanelId nId);
+ DECL_LINK(ToolboxClickHandler, ToolBox*);
+ DECL_LINK(MenuSelectHandler, Menu*);
+ DECL_LINK(DockingChanged, PaneDockingWindow*);
virtual ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible>
@@ -151,12 +138,7 @@ public:
virtual bool RelocateToParentWindow (::Window* pParentWindow);
private:
- class Implementation;
- ::std::auto_ptr<Implementation> mpImpl;
-
- ::std::auto_ptr<ToolPanel> mpTaskPane;
-
- bool mbIsInitialized;
+ ::boost::scoped_ptr< ToolPanelViewShell_Impl > mpImpl;
::boost::shared_ptr<TaskPaneShellManager> mpSubShellManager;
@@ -165,10 +147,9 @@ private:
*/
USHORT mnMenuId;
- /** Create a popup menu. it contains three sections, one for
+ /** Create a popup menu. it contains two sections, one for
docking or un-docking the tool panel, one for toggling the
- visibility state of the tool panel items, and one for bringing
- up a customization dialog.
+ visibility state of the tool panel items.
@param bIsDocking
According to this flag one of the lock/unlock entries is
made disabled.
@@ -176,21 +157,9 @@ private:
::std::auto_ptr<PopupMenu> CreatePopupMenu (bool bIsDocking);
- /** Make sure that as long as there is at least one visible
- control there is exactly one expanded control.
- If the currently expanded control is being hidden then try to
- expand the control after the hidden one or if that does not
- exist expand the one before.
- */
- void EnsureExpandedControl (TitledControl* pHiddenControl);
-
- /** Return a pointer to the docking window that is the parent or a
- predecessor of the content window.
- @return
- When the view shell is not placed in a docking window, e.g. when
- shown in the center pane, then <NULL?> is returned.
+ /** connects to a (new) (Pane)DockingWindow
*/
- DockingWindow* GetDockingWindow (void);
+ void ConnectToDockingWindow();
/** Initialize the task pane view shell if that has not yet been done
before. If mbIsInitialized is already set to <TRUE/> then this
@@ -202,25 +171,6 @@ private:
-/** This functor makes visible a panel in the task pane. It can be used
- with the FrameworkHelper to make a panel visible after an asynchonous
- update of the configuration, e.g. after switching to another view.
-*/
-class PanelActivation
-{
-public:
- /** Create a new object that, when its operator() method is called, will
- make the specified panel visible in the task pane that belongs to
- the application window specified by the given ViewShellBase.
- */
- PanelActivation (ViewShellBase& rBase, TaskPaneViewShell::PanelId nPanelId);
- void operator() (bool);
-private:
- ViewShellBase& mrBase;
- TaskPaneViewShell::PanelId mnPanelId;
-};
-
-
} } // end of namespace ::sd::toolpanel
#endif
diff --git a/sd/source/ui/slideshow/PaneHider.cxx b/sd/source/ui/slideshow/PaneHider.cxx
index f0032b27d1a0..2841891f31ce 100644
--- a/sd/source/ui/slideshow/PaneHider.cxx
+++ b/sd/source/ui/slideshow/PaneHider.cxx
@@ -42,6 +42,8 @@
#include <com/sun/star/drawing/framework/XConfiguration.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing::framework;
using ::sd::framework::FrameworkHelper;
@@ -88,7 +90,7 @@ PaneHider::PaneHider (const ViewShell& rViewShell, SlideshowImpl* pSlideShow)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false, "caught exception in PaneHider constructor");
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index 04a1821cd6d8..94b3b4afe717 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/frame/FrameActionEvent.hpp>
#include <com/sun/star/frame/FrameAction.hpp>
#include <sfx2/viewfrm.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star::accessibility;
@@ -228,8 +229,7 @@ void Listener::ConnectToController (void)
}
catch (beans::UnknownPropertyException aEvent)
{
- OSL_TRACE ("caught exception in SlideSorterController::SetupListeners: %s",
- ::rtl::OUStringToOString(aEvent.Message, RTL_TEXTENCODING_UTF8).getStr());
+ DBG_UNHANDLED_EXCEPTION();
}
try
{
@@ -237,8 +237,7 @@ void Listener::ConnectToController (void)
}
catch (beans::UnknownPropertyException aEvent)
{
- OSL_TRACE ("caught exception in SlideSorterController::SetupListeners: %s",
- ::rtl::OUStringToOString(aEvent.Message, RTL_TEXTENCODING_UTF8).getStr());
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -286,9 +285,7 @@ void Listener::DisconnectFromController (void)
}
catch (beans::UnknownPropertyException aEvent)
{
- OSL_TRACE ("caught exception in destructor of SlideSorterController: %s",
- ::rtl::OUStringToOString(aEvent.Message,
- RTL_TEXTENCODING_UTF8).getStr());
+ DBG_UNHANDLED_EXCEPTION();
}
mbListeningToController = false;
@@ -488,9 +485,7 @@ void SAL_CALL Listener::propertyChange (
}
catch (beans::UnknownPropertyException aEvent)
{
- OSL_TRACE ("caught exception while accessing the page number of a slide: %s",
- ::rtl::OUStringToOString(aEvent.Message,
- RTL_TEXTENCODING_UTF8).getStr());
+ DBG_UNHANDLED_EXCEPTION();
}
catch (lang::DisposedException&)
{
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 126a599c21d3..0249b8ec0524 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -65,7 +65,6 @@
#include "ViewShellBase.hxx"
#include "ViewShellImplementation.hxx"
#include "sdattr.hxx"
-#include "TaskPaneViewShell.hxx"
#include "FrameView.hxx"
#include "zoomlist.hxx"
#include "sdpage.hxx"
diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
index be298856c066..b149320cf0f2 100644
--- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
+++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
@@ -50,6 +50,8 @@
#include "sdpage.hxx"
#include "FrameView.hxx"
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -225,13 +227,9 @@ sal_Int32 SlideSorterModel::GetIndex (const Reference<drawing::XDrawPage>& rxSli
return nNumber;
}
}
- catch (beans::UnknownPropertyException&)
- {
- OSL_ASSERT(false);
- }
- catch (lang::DisposedException&)
+ catch (uno::Exception&)
{
- OSL_ASSERT(false);
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
index 8f259e2a8c0f..32098abb523f 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectViewObjectContact.cxx
@@ -61,6 +61,7 @@
#include <boost/shared_ptr.hpp>
#include <com/sun/star/uno/Exception.hpp>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::sdr::contact;
using namespace ::sd::slidesorter::model;
@@ -1166,7 +1167,7 @@ BitmapEx PageObjectViewObjectContact::GetPreview (
}
catch (const ::com::sun::star::uno::Exception&)
{
- OSL_TRACE("PageObjectViewObjectContact::GetPreview: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
return aBitmap;
diff --git a/sd/source/ui/toolpanel/CustomToolPanel.cxx b/sd/source/ui/toolpanel/CustomToolPanel.cxx
new file mode 100644
index 000000000000..1515bf09104f
--- /dev/null
+++ b/sd/source/ui/toolpanel/CustomToolPanel.cxx
@@ -0,0 +1,290 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "CustomToolPanel.hxx"
+#include "framework/FrameworkHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/ResourceId.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/drawing/framework/XPane2.hpp>
+/** === end UNO includes === **/
+
+#include <comphelper/processfactory.hxx>
+#include <unotools/confignode.hxx>
+#include <tools/diagnose_ex.h>
+
+#if OSL_DEBUG_LEVEL > 0
+#include <rtl/strbuf.hxx>
+#endif
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::drawing::framework::XConfigurationController;
+ using ::com::sun::star::drawing::framework::XResourceId;
+ using ::com::sun::star::drawing::framework::ResourceId;
+ using ::com::sun::star::drawing::framework::XResource;
+ using ::com::sun::star::awt::XWindow;
+ using ::com::sun::star::accessibility::XAccessible;
+ using ::com::sun::star::drawing::framework::XPane2;
+ /** === end UNO using === **/
+ namespace PosSize = ::com::sun::star::awt::PosSize;
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ ::rtl::OUString lcl_getPanelConfig( const ::utl::OConfigurationNode& i_rPanelConfig, const sal_Char* i_pAsciiPropName )
+ {
+ ::rtl::OUString sConfigValue;
+ OSL_VERIFY( i_rPanelConfig.getNodeValue( i_pAsciiPropName ) >>= sConfigValue );
+ if ( sConfigValue.getLength() == 0 )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ ::rtl::OStringBuffer aMessage;
+ aMessage.append( "lcl_getPanelConfig: invalid config value (" );
+ aMessage.append( i_pAsciiPropName );
+ aMessage.append( ") for panel config '" );
+ aMessage.append( ::rtl::OUStringToOString( i_rPanelConfig.getLocalName(), RTL_TEXTENCODING_UTF8 ) );
+ aMessage.append( "'" );
+ OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() );
+#endif
+ }
+ return sConfigValue;
+ }
+ }
+
+ //==================================================================================================================
+ //= CustomToolPanel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ CustomToolPanel::CustomToolPanel( ToolPanelDeck& i_rPanelDeck, const ::utl::OConfigurationNode& i_rPanelConfig,
+ const Reference< XResourceId >& i_rPaneResourceId, const ::boost::shared_ptr< framework::FrameworkHelper >& i_pFrameworkHelper )
+ :TaskPaneToolPanel( i_rPanelDeck, lcl_getPanelConfig( i_rPanelConfig, "DisplayTitle" ), Image() /* TODO */, SmartId() /* TODO */ )
+ ,m_pFrameworkHelper( i_pFrameworkHelper )
+ ,m_xPanelResourceId()
+ ,m_xResource()
+ ,m_xToolPanel()
+ ,m_bAttemptedPanelCreation( false )
+ ,m_nResourceAccessLock( 0 )
+ {
+ ENSURE_OR_THROW( m_pFrameworkHelper.get() != NULL, "invalid framework helper" );
+ ENSURE_OR_THROW( i_rPaneResourceId.is(), "invalid pane resource id" );
+ try
+ {
+ ::rtl::OUString sPanelResourceURL( lcl_getPanelConfig( i_rPanelConfig, "ResourceURL" ) );
+ m_xPanelResourceId.set(
+ ResourceId::createWithAnchor(
+ ::comphelper::getProcessComponentContext(),
+ sPanelResourceURL,
+ i_rPaneResourceId ),
+ UNO_SET_THROW
+ );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ CustomToolPanel::~CustomToolPanel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::Activate( ::Window& i_rParentWindow )
+ {
+ OSL_ENSURE( &getPanelWindowAnchor() == &i_rParentWindow,
+ "CustomToolPanel::Activate: invalid new parent window" );
+ // getPanelWindowAnchor() is what is returned in the TaskPane's XPane::getWindow method. So,
+ // any custom panel which is loaded into the TaskPane will use this window as parent window.
+ // Consequently, this is the window which shall be passed here, since this method is intended to
+ // re-create the panel with the given parent.
+
+ // we do not need to do anything here. The XResourceFactory::createResource method of the custom
+ // tool panel already created and showed the window.
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::Deactivate()
+ {
+ // When a certain tool panel is activated, this is routed through the drawing framework, which ensures
+ // that the resource associated with the previously active panel is deactivated, which calls the
+ // XResourceFactory::destroyResource at our custom panel's factory.
+
+ // So, we do not have to do anything here - except forgetting the XResource, at it might (or might not,
+ // if cached by the factory) be re-created next time.
+ m_xResource.clear();
+ m_xToolPanel.clear();
+ m_bAttemptedPanelCreation = false;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::SetSizePixel( const Size& i_rPanelWindowSize )
+ {
+ impl_ensurePanel();
+ if ( !m_xToolPanel.is() )
+ // if the custom panel does not support XPanel, this just means it is its own responsibility
+ // to resize/layout everything within the pane window.
+ return;
+
+ try
+ {
+ Reference< XWindow > xPanelWindow( m_xToolPanel->getWindow(), UNO_SET_THROW );
+ xPanelWindow->setPosSize( 0, 0, i_rPanelWindowSize.Width(), i_rPanelWindowSize.Height(),
+ PosSize::POSSIZE );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::GrabFocus()
+ {
+ impl_ensurePanel();
+ if ( !m_xToolPanel.is() )
+ // if the custom panel does not support XPanel, this just means it is its own responsibility
+ // to care for focus handling
+ return;
+
+ try
+ {
+ Reference< XWindow > xPanelWindow( m_xToolPanel->getWindow(), UNO_SET_THROW );
+ xPanelWindow->setFocus();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::Dispose()
+ {
+ // nothing to do here. Lifetime handling of the XResource which this panel represents is done by
+ // the drawing framework, we ourself do not have resources to release.
+ TaskPaneToolPanel::Dispose();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > CustomToolPanel::CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible )
+ {
+ ENSURE_OR_RETURN( !isDisposed(), "CustomToolPanel::CreatePanelAccessible: already disposed!", NULL );
+ (void)i_rParentAccessible;
+
+ // an XResource might also be an XPane2, which can provide an XAccessible. Check this first.
+ const Reference< XPane2 > xPane( m_xResource, UNO_QUERY );
+ if ( xPane.is() )
+ {
+ const Reference< XAccessible > xPaneAccessible( xPane->getAccessible() );
+ if ( xPaneAccessible.is() )
+ return xPaneAccessible;
+ }
+
+ // if we have an XToolPanel, ask it for its XWindow, and query it
+ impl_ensurePanel();
+ if ( !m_xToolPanel.is() )
+ return NULL;
+
+ const Reference< XAccessible > xPanelWindowAccessible( m_xToolPanel->getWindow(), UNO_QUERY );
+ if ( xPanelWindowAccessible.is() )
+ return xPanelWindowAccessible;
+
+ // maybe the XToolPanel itself can provide an XAccessible?
+ const Reference< XAccessible > xPanelAccessible( m_xToolPanel, UNO_QUERY );
+ if ( xPanelAccessible.is() )
+ return xPanelAccessible;
+
+ OSL_ENSURE( false, "CustomToolPanel::CreatePanelAccessible: no XAccessible for the custom panel!" );
+ return NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::LockResourceAccess()
+ {
+ ++m_nResourceAccessLock;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::UnlockResourceAccess()
+ {
+ OSL_ENSURE( m_nResourceAccessLock > 0, "CustomToolPanel::UnlockResourceAccess: not locked!" );
+ --m_nResourceAccessLock;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const Reference< XResourceId >& CustomToolPanel::getResourceId() const
+ {
+ return m_xPanelResourceId;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void CustomToolPanel::impl_ensurePanel()
+ {
+ ENSURE_OR_RETURN_VOID( !isDisposed(), "already disposed" );
+
+ if ( ( m_nResourceAccessLock == 0 ) && !m_bAttemptedPanelCreation )
+ {
+ m_bAttemptedPanelCreation = true;
+
+ try
+ {
+ Reference< XConfigurationController > xConfigController( m_pFrameworkHelper->GetConfigurationController(), UNO_QUERY_THROW );
+ m_xResource.set( xConfigController->getResource( m_xPanelResourceId ), UNO_QUERY_THROW );
+ m_xToolPanel.set( m_xResource, UNO_QUERY );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+ }
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
+
diff --git a/sd/source/ui/toolpanel/CustomToolPanel.hxx b/sd/source/ui/toolpanel/CustomToolPanel.hxx
new file mode 100644
index 000000000000..ee10c6748bbd
--- /dev/null
+++ b/sd/source/ui/toolpanel/CustomToolPanel.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_TOOLPANEL_CUSTOMTOOLPANEL_HXX
+#define SD_TOOLPANEL_CUSTOMTOOLPANEL_HXX
+
+#include "TaskPaneToolPanel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/XPane.hpp>
+#include <com/sun/star/drawing/framework/XResourceId.hpp>
+#include <com/sun/star/drawing/framework/XResource.hpp>
+#include <com/sun/star/view/XToolPanel.hpp>
+/** === end UNO includes === **/
+
+#include <boost/shared_ptr.hpp>
+
+namespace utl
+{
+ class OConfigurationNode;
+}
+
+namespace sd { namespace framework
+{
+ class FrameworkHelper;
+} }
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ class ToolPanelDeck;
+
+ //==================================================================================================================
+ //= CustomToolPanel
+ //==================================================================================================================
+ /** is a ::svt::IToolPanel implementation for custom tool panels, i.e. those defined in the configuration, and
+ implemented by external components.
+ */
+ class CustomToolPanel : public TaskPaneToolPanel
+ {
+ public:
+ CustomToolPanel(
+ ToolPanelDeck& i_rPanelDeck,
+ const ::utl::OConfigurationNode& i_rPanelConfig,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& i_rPaneResourceId,
+ const ::boost::shared_ptr< framework::FrameworkHelper >& i_pFrameworkHelper
+ );
+ ~CustomToolPanel();
+
+ // IToolPanel overridables
+ virtual void Activate( ::Window& i_rParentWindow );
+ virtual void Deactivate();
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize );
+ virtual void GrabFocus();
+ virtual void Dispose();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreatePanelAccessible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ /** locks (aka prevents) the access to the associated XResource object
+ */
+ void LockResourceAccess();
+ /** unlocks (aka allows) the access to the associated XResource object
+ */
+ void UnlockResourceAccess();
+
+ protected:
+ // TaskPaneToolPanel overridables
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& getResourceId() const;
+
+ private:
+ void impl_ensurePanel();
+
+ private:
+ ::boost::shared_ptr< framework::FrameworkHelper > m_pFrameworkHelper;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId > m_xPanelResourceId;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResource > m_xResource;
+ ::com::sun::star::uno::Reference< ::com::sun::star::view::XToolPanel > m_xToolPanel;
+ bool m_bAttemptedPanelCreation;
+ sal_uInt32 m_nResourceAccessLock;
+ };
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
+
+#endif // SD_TOOLPANEL_CUSTOMTOOLPANEL_HXX
diff --git a/sd/source/ui/toolpanel/LayoutMenu.cxx b/sd/source/ui/toolpanel/LayoutMenu.cxx
index a2bb1d0cbbac..67efc0e59d50 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.cxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.cxx
@@ -47,6 +47,7 @@
#include "controller/SlideSorterController.hxx"
#include "controller/SlsPageSelector.hxx"
#include "taskpane/TaskPaneControlFactory.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "taskpane/ScrollPanel.hxx"
#include "tools/SlotStateListener.hxx"
#include "EventMultiplexer.hxx"
@@ -84,40 +85,32 @@ using ::sd::framework::FrameworkHelper;
namespace sd { namespace toolpanel {
-/** This factory class stores references to ViewShellBase and DrawDocShell
- and passes them to new LayoutMenu objects.
-*/
-class LayoutMenuFactory
+class LayoutMenuRootFactory
: public ControlFactory
{
public:
- LayoutMenuFactory (ViewShellBase& rBase, DrawDocShell& rDocShell)
- : mrBase(rBase),
- mrDocShell(rDocShell)
- {}
+ LayoutMenuRootFactory (ToolPanelViewShell& i_rPanelViewShell)
+ :mrPanelViewShell(i_rPanelViewShell)
+ {
+ }
protected:
- virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode)
+ virtual TreeNode* InternalCreateControl( ::Window& i_rParent )
{
- ScrollPanel* pScrollPanel = new ScrollPanel (pTreeNode);
+ ScrollPanel* pScrollPanel = new ScrollPanel (i_rParent);
::std::auto_ptr<TreeNode> pMenu (
new LayoutMenu (
pScrollPanel,
- mrDocShell,
- mrBase,
- false));
+ mrPanelViewShell));
pScrollPanel->AddControl(pMenu);
return pScrollPanel;
}
private:
- ViewShellBase& mrBase;
- DrawDocShell& mrDocShell;
+ ToolPanelViewShell& mrPanelViewShell;
};
-
-
SFX_IMPL_INTERFACE(LayoutMenu, SfxShell,
SdResId(STR_TASKPANELAYOUTMENU))
{
@@ -222,22 +215,29 @@ static snewfoil_value_info standard[] =
-LayoutMenu::LayoutMenu (
- TreeNode* pParent,
- DrawDocShell& rDocumentShell,
- ViewShellBase& rViewShellBase,
- bool bUseOwnScrollBar)
+LayoutMenu::LayoutMenu( TreeNode* pParent, ToolPanelViewShell& i_rPanelViewShell )
: ValueSet (pParent->GetWindow()),
TreeNode(pParent),
DragSourceHelper(this),
DropTargetHelper(this),
- mrBase (rViewShellBase),
- mbUseOwnScrollBar (bUseOwnScrollBar),
+ mrBase( i_rPanelViewShell.GetViewShellBase() ),
+ mpShellManager (&i_rPanelViewShell.GetSubShellManager()),
+ mbUseOwnScrollBar( false ),
mnPreferredColumnCount(3),
mxListener(NULL),
mbSelectionUpdatePending(true),
mbIsMainViewChangePending(false)
{
+ ImplConstruct( *mrBase.GetDocument()->GetDocSh() );
+}
+
+
+void LayoutMenu::ImplConstruct( DrawDocShell& rDocumentShell )
+{
+ OSL_ENSURE( mrBase.GetDocument()->GetDocSh() == &rDocumentShell,
+ "LayoutMenu::ImplConstruct: hmm?" );
+ // if this fires, then my assumption that the rDocumentShell parameter to our first ctor is superfluous ...
+
SetStyle (
( GetStyle() & ~(WB_ITEMBORDER) )
| WB_TABSTOP
@@ -276,7 +276,6 @@ LayoutMenu::LayoutMenu (
-
LayoutMenu::~LayoutMenu (void)
{
// Tell the shell factory that this object is no longer available.
@@ -296,10 +295,9 @@ LayoutMenu::~LayoutMenu (void)
::std::auto_ptr<ControlFactory> LayoutMenu::CreateControlFactory (
- ViewShellBase& rBase,
- DrawDocShell& rDocShell)
+ ToolPanelViewShell& i_rPanelViewShell )
{
- return ::std::auto_ptr<ControlFactory>(new LayoutMenuFactory(rBase, rDocShell));
+ return ::std::auto_ptr<ControlFactory>(new LayoutMenuRootFactory(i_rPanelViewShell));
}
@@ -631,6 +629,13 @@ void LayoutMenu::InsertPageWithLayout (AutoLayout aLayout)
+TaskPaneShellManager* LayoutMenu::GetShellManager()
+{
+ if ( mpShellManager )
+ return mpShellManager;
+ return TreeNode::GetShellManager();
+}
+
void LayoutMenu::InvalidateContent (void)
{
// The number of items may have changed. Request a resize so that the
diff --git a/sd/source/ui/toolpanel/LayoutMenu.hxx b/sd/source/ui/toolpanel/LayoutMenu.hxx
index bd121403c2d3..86606ef0b69c 100644
--- a/sd/source/ui/toolpanel/LayoutMenu.hxx
+++ b/sd/source/ui/toolpanel/LayoutMenu.hxx
@@ -60,6 +60,7 @@ class EventMultiplexerEvent;
namespace sd { namespace toolpanel {
class ControlFactory;
+class ToolPanelViewShell;
class LayoutMenu
@@ -76,28 +77,18 @@ public:
/** Create a new layout menu. Depending on the given flag it
displays its own scroll bar or lets a surrounding window
handle that.
- @param rDocumentShell
- Used to determine writing direction.
- @param rViewShellBase
- Gives access to the view shell at whose active page the
- layout will be set.
- @param bUseOwnScrollBar
- When <TRUE/> then we will show our own scroll bar when not
- all icons can be displayed in the visible window area.
- When <FALSE/> then rely on an outer scroll bar. In this
- case we will set the height of the window so that all
- icons are visible.
+ @param i_pParent
+ the parent node in the control tree
+ @param i_rPanelViewShell
+ the view shell of the task pane.
*/
LayoutMenu (
- TreeNode* pParent,
- DrawDocShell& rDocumentShell,
- ViewShellBase& rViewShellBase,
- bool bUseOwnScrollBar);
+ TreeNode* i_pParent,
+ ToolPanelViewShell& i_rPanelViewShell);
virtual ~LayoutMenu (void);
static std::auto_ptr<ControlFactory> CreateControlFactory (
- ViewShellBase& rBase,
- DrawDocShell& rDocShell);
+ ToolPanelViewShell& i_rPanelViewShell );
/** Return the name of the currently selected layout.
*/
@@ -140,6 +131,9 @@ public:
enum MasterMode { MM_NORMAL, MM_MASTER, MM_UNKNOWN };
void UpdateEnabledState (const MasterMode eMode);
+ // TreeNode overridables
+ virtual TaskPaneShellManager* GetShellManager (void);
+
/** Call this method when the set of displayed layouts is not up-to-date
anymore. It will re-assemple this set according to the current
settings.
@@ -168,6 +162,8 @@ public:
private:
ViewShellBase& mrBase;
+ TaskPaneShellManager* mpShellManager;
+
/** Do we use our own scroll bar or is viewport handling done by
our parent?
*/
@@ -231,6 +227,9 @@ private:
*/
void UpdateSelection (void);
+ // internal ctor
+ void ImplConstruct( DrawDocShell& rDocumentShell );
+
/** When clicked then set the current page of the view in the center pane.
*/
DECL_LINK(ClickHandler, ValueSet*);
diff --git a/sd/source/ui/toolpanel/LayoutableWindow.hxx b/sd/source/ui/toolpanel/LayoutableWindow.hxx
deleted file mode 100644
index ed4e1ec77959..000000000000
--- a/sd/source/ui/toolpanel/LayoutableWindow.hxx
+++ /dev/null
@@ -1,79 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-#ifndef SD_TOOLPANEL_I_LAYOUTABLE_WINDOW_HXX
-#define SD_TOOLPANEL_I_LAYOUTABLE_WINDOW_HXX
-
-#include <vcl/gen.hxx>
-
-class Window;
-
-namespace sd { namespace toolpanel {
-
-
-/** This interface has to be implemented by windows that want to be
- layouted by a ToolPanel, SubToolPanel, or ScrollablePanel object.
-*/
-class LayoutableWindow
-{
-public:
- /** Return the preferred size without constraints on either the
- height or the width.
- The size the window will later be set to may but does not have
- to be equal to this size.
- */
- virtual Size GetPreferredSize (void) = 0;
-
- /** Return the preferred width with the constraint, that the
- window will be set to the given height.
- The width the window will later be set to may but does not have
- to be equal to this width.
- */
- virtual int GetPreferredWidth (int nHeight) = 0;
-
- /** Return the preferred height with the constraint, that the
- window will be set to the given width.
- The height the window will later be set to may but does not have
- to be equal to this height.
- */
- virtual int GetPreferredHeight (int nWidth) = 0;
-
- /** Return wether the window is generally resizable. When used by
- a VerticalLayouter then the width will always be resized and
- the return value of this method determines whether the height
- may be modified as well.
- */
- virtual bool IsResizable (void) = 0;
-
- /** Return the window so that its size and position can be set.
- */
- virtual ::Window& GetWindow (void) = 0;
-};
-
-} } // end of namespace ::sd::toolpanel
-
-#endif
diff --git a/sd/source/ui/toolpanel/ScrollPanel.cxx b/sd/source/ui/toolpanel/ScrollPanel.cxx
index cff065777235..cae08c76ca39 100644
--- a/sd/source/ui/toolpanel/ScrollPanel.cxx
+++ b/sd/source/ui/toolpanel/ScrollPanel.cxx
@@ -56,6 +56,30 @@ ScrollPanel::ScrollPanel (
mnVerticalGap(3),
mnHorizontalBorder(2)
{
+ Construct();
+}
+
+ScrollPanel::ScrollPanel (
+ ::Window& i_rParentWindow)
+ : Control (&i_rParentWindow, WB_DIALOGCONTROL),
+ TreeNode(NULL),
+ maScrollWindow(this, WB_DIALOGCONTROL),
+ maVerticalScrollBar(this, WB_VERT),
+ maHorizontalScrollBar(this, WB_HORZ),
+ maScrollBarFiller(this),
+ maScrollWindowFiller(&maScrollWindow),
+ mbIsRearrangePending(true),
+ mbIsLayoutPending(true),
+ mnChildrenWidth(0),
+ mnVerticalBorder(2),
+ mnVerticalGap(3),
+ mnHorizontalBorder(2)
+{
+ Construct();
+}
+
+void ScrollPanel::Construct()
+{
SetAccessibleName (
::rtl::OUString::createFromAscii("Sub Task Panel"));
mpControlContainer->SetMultiSelection (true);
@@ -95,7 +119,7 @@ ScrollPanel::~ScrollPanel (void)
// control instead of pNode directly.
TitledControl* pTitledControl = static_cast<TitledControl*>(pNode);
if (pTitledControl != NULL)
- pControl = pTitledControl->GetControl(false);
+ pControl = pTitledControl->GetControl();
// Remove this object as listener from the control.
if (pControl != NULL && pControl->GetWindow()!=NULL)
diff --git a/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx b/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
index 3cef1ca6ee88..a032b6ef02f0 100644
--- a/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
+++ b/sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
@@ -71,38 +71,6 @@ namespace sd { namespace toolpanel {
::std::map<const SdDrawDocument*, SlideSorterCacheDisplay*> SlideSorterCacheDisplay::maDisplays;
-/** This factory class is used to create instances of TestPanel. It can be
- extended so that its constructor stores arguments that later are passed
- to new TestPanel objects.
-*/
-class SlideSorterCacheDisplayFactory
- : public ControlFactory
-{
-public:
- SlideSorterCacheDisplayFactory (const SdDrawDocument* pDocument)
- : mpDocument(pDocument)
- {
- }
-
-protected:
- virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode)
- {
- SlideSorterCacheDisplay* pDisplay = SlideSorterCacheDisplay::Instance(mpDocument);
- pDisplay->SetParentWindow(pTreeNode->GetWindow());
- pDisplay->SetParentNode(pTreeNode);
- return pDisplay;
- }
-
-private:
- const SdDrawDocument* mpDocument;
-};
-
-
-
-
-
-
-
SlideSorterCacheDisplay::SlideSorterCacheDisplay (const SdDrawDocument* pDocument)
: TreeNode(NULL),
mpWindow(NULL),
@@ -137,15 +105,6 @@ void SlideSorterCacheDisplay::SetParentWindow (::Window* pParentWindow)
-std::auto_ptr<ControlFactory> SlideSorterCacheDisplay::CreateControlFactory (
- const SdDrawDocument* pDocument)
-{
- return std::auto_ptr<ControlFactory>(new SlideSorterCacheDisplayFactory(pDocument));
-}
-
-
-
-
void SlideSorterCacheDisplay::Paint (const Rectangle& rBoundingBox)
{
if (maCellSize.Width()>0 && maCellSize.Height()>0 && mpWindow!=NULL)
diff --git a/sd/source/ui/toolpanel/StandardToolPanel.cxx b/sd/source/ui/toolpanel/StandardToolPanel.cxx
new file mode 100644
index 000000000000..ede20ea3404c
--- /dev/null
+++ b/sd/source/ui/toolpanel/StandardToolPanel.cxx
@@ -0,0 +1,163 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "StandardToolPanel.hxx"
+#include "ToolPanelDeck.hxx"
+#include "sdresid.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::drawing::framework::XResourceId;
+ using ::com::sun::star::accessibility::XAccessible;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= StandardToolPanel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ StandardToolPanel::StandardToolPanel( ToolPanelDeck& i_rPanelDeck, ::std::auto_ptr< ControlFactory >& i_rControlFactory,
+ const USHORT i_nTitleResId, const Image& i_rImage, const ULONG i_nHelpId,
+ const Reference< XResourceId >& i_rPanelResourceId )
+ :TaskPaneToolPanel( i_rPanelDeck, SdResId( i_nTitleResId ), i_rImage, SmartId( i_nHelpId ) )
+ ,m_pControlFactory( i_rControlFactory )
+ ,m_xPanelResourceId( i_rPanelResourceId )
+ {
+ ENSURE_OR_THROW( m_pControlFactory.get(), "illegal control factory" );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ StandardToolPanel::~StandardToolPanel()
+ {
+ m_pControl.reset();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void StandardToolPanel::Activate( ::Window& i_rParentWindow )
+ {
+ Window* pPanelWindow( impl_getPanelWindow() );
+ ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to show" );
+ pPanelWindow->SetPosSizePixel( Point(), i_rParentWindow.GetSizePixel() );
+ pPanelWindow->Show();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void StandardToolPanel::Deactivate()
+ {
+ Window* pPanelWindow( impl_getPanelWindow() );
+ ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to hide" );
+ pPanelWindow->Hide();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void StandardToolPanel::SetSizePixel( const Size& i_rPanelWindowSize )
+ {
+ Window* pPanelWindow( impl_getPanelWindow() );
+ ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to resize" );
+ pPanelWindow->SetSizePixel( i_rPanelWindowSize );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void StandardToolPanel::GrabFocus()
+ {
+ Window* pPanelWindow( impl_getPanelWindow() );
+ ENSURE_OR_RETURN_VOID( pPanelWindow, "no window to focus" );
+ pPanelWindow->GrabFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void StandardToolPanel::Dispose()
+ {
+ m_pControl.reset();
+ TaskPaneToolPanel::Dispose();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > StandardToolPanel::CreatePanelAccessible( const Reference< XAccessible >& i_rParentAccessible )
+ {
+ ENSURE_OR_RETURN( !isDisposed(), "already disposed!", NULL );
+
+ Window* pControlWindow( m_pControl->GetWindow() );
+
+ Reference< XAccessible > xControlAccessible( pControlWindow->GetAccessible( FALSE ) );
+ if ( !xControlAccessible.is() )
+ {
+ xControlAccessible = m_pControl->CreateAccessibleObject( i_rParentAccessible );
+ OSL_ENSURE( xControlAccessible.is(), "StandardToolPanel::CreatePanelAccessible: invalid XAccessible returned by CreateAccessibleObject!" );
+ pControlWindow->SetAccessible( xControlAccessible );
+ }
+ return xControlAccessible;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ const Reference< XResourceId >& StandardToolPanel::getResourceId() const
+ {
+ return m_xPanelResourceId;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::Window* StandardToolPanel::impl_getPanelWindow() const
+ {
+ if ( const_cast< StandardToolPanel* >( this )->impl_ensureControl() )
+ return m_pControl->GetWindow();
+ return NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ bool StandardToolPanel::impl_ensureControl()
+ {
+ if ( m_pControl.get() )
+ return true;
+ if ( isDisposed() )
+ return false;
+ m_pControl = m_pControlFactory->CreateControl( getPanelWindowAnchor() );
+ return ( m_pControl.get() != NULL );
+ }
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
diff --git a/sd/source/ui/toolpanel/StandardToolPanel.hxx b/sd/source/ui/toolpanel/StandardToolPanel.hxx
new file mode 100644
index 000000000000..a40c3d4af5f2
--- /dev/null
+++ b/sd/source/ui/toolpanel/StandardToolPanel.hxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_TOOLPANEL_STANDARDTOOLPANEL_HXX
+#define SD_TOOLPANEL_STANDARDTOOLPANEL_HXX
+
+#include "TaskPaneToolPanel.hxx"
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= StandardToolPanel
+ //==================================================================================================================
+ /** an IToolPanel implementation for one of the standard (aka built-in) tool panels
+ */
+ class StandardToolPanel : public TaskPaneToolPanel
+ {
+ public:
+ StandardToolPanel(
+ ToolPanelDeck& i_rPanelDeck,
+ ::std::auto_ptr< ControlFactory >& i_rControlFactory,
+ const USHORT i_nTitleResId,
+ const Image& i_rImage,
+ const ULONG i_nHelpId,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& i_rPanelResourceId
+ );
+ ~StandardToolPanel();
+
+ // IToolPanel overridables
+ virtual void Activate( ::Window& i_rParentWindow );
+ virtual void Deactivate();
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize );
+ virtual void GrabFocus();
+ virtual void Dispose();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreatePanelAccessible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // TaskPaneToolPanel overridables
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& getResourceId() const;
+
+ private:
+ bool impl_ensureControl();
+ ::Window* impl_getPanelWindow() const;
+
+ private:
+ ::std::auto_ptr< ControlFactory > m_pControlFactory;
+ ::std::auto_ptr< TreeNode > m_pControl;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >
+ m_xPanelResourceId;
+ };
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
+
+#endif // SD_TOOLPANEL_STANDARDTOOLPANEL_HXX
diff --git a/sd/source/ui/toolpanel/SubToolPanel.cxx b/sd/source/ui/toolpanel/SubToolPanel.cxx
index 31c29f4f1c08..f554d44e8f18 100644
--- a/sd/source/ui/toolpanel/SubToolPanel.cxx
+++ b/sd/source/ui/toolpanel/SubToolPanel.cxx
@@ -70,6 +70,35 @@ SubToolPanel::SubToolPanel (
+SubToolPanel::SubToolPanel (
+ Window& i_rParentWindow)
+ : Control (&i_rParentWindow, WB_DIALOGCONTROL),
+ TreeNode(NULL),
+ maWindowFiller(this),
+ mbIsRearrangePending(true),
+ mbIsLayoutPending(true),
+ mnChildrenWidth(0),
+ mnVerticalBorder(0),
+ mnVerticalGap(3),
+ mnHorizontalBorder(2)
+{
+ SetAccessibleName (
+ ::rtl::OUString::createFromAscii("Sub Task Panel"));
+ mpControlContainer->SetMultiSelection (true);
+
+ SetBorderStyle (WINDOW_BORDER_NORMAL);
+ SetMapMode (MapMode(MAP_PIXEL));
+
+ // To reduce flickering during repaints make the container windows
+ // transparent and rely on their children to paint the whole area.
+ SetBackground(Wallpaper());
+ maWindowFiller.SetBackground(
+ Application::GetSettings().GetStyleSettings().GetWindowColor());
+}
+
+
+
+
SubToolPanel::~SubToolPanel (void)
{
sal_uInt32 nCount = mpControlContainer->GetControlCount();
diff --git a/sd/source/ui/toolpanel/TaskPaneControlFactory.cxx b/sd/source/ui/toolpanel/TaskPaneControlFactory.cxx
index c1651d62010b..4ad610df7f7f 100644
--- a/sd/source/ui/toolpanel/TaskPaneControlFactory.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneControlFactory.cxx
@@ -48,13 +48,10 @@ ControlFactory::~ControlFactory (void)
-::std::auto_ptr<TreeNode> ControlFactory::CreateControl (TreeNode* pTreeNode)
+::std::auto_ptr<TreeNode> ControlFactory::CreateControl( ::Window& i_rParent )
{
- // Create a new control by using the protected virtual hook.
- TreeNode* pNewNode = InternalCreateControl(pTreeNode);
-
- return ::std::auto_ptr<TreeNode>(pNewNode);
+ TreeNode* pNewNode = InternalCreateControl( i_rParent );
+ return ::std::auto_ptr<TreeNode>( pNewNode );
}
-
} } // end of namespace ::sd::toolpanel
diff --git a/sd/source/ui/toolpanel/TaskPaneShellManager.cxx b/sd/source/ui/toolpanel/TaskPaneShellManager.cxx
index 5a4875340840..52054c43fe8b 100644
--- a/sd/source/ui/toolpanel/TaskPaneShellManager.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneShellManager.cxx
@@ -31,7 +31,7 @@
#include "TaskPaneShellManager.hxx"
#include "ViewShellManager.hxx"
-#include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
#include <vcl/window.hxx>
#include <algorithm>
@@ -111,6 +111,21 @@ void TaskPaneShellManager::AddSubShell (
+void TaskPaneShellManager::RemoveSubShell (const ShellId i_nShellId)
+{
+ SubShells::iterator pos = maSubShells.find( i_nShellId );
+ ENSURE_OR_RETURN_VOID( pos != maSubShells.end(), "no shell for this ID" );
+ if ( pos->second.mpWindow != NULL )
+ {
+ pos->second.mpWindow->RemoveEventListener( LINK( this, TaskPaneShellManager, WindowCallback ) );
+ }
+ mpViewShellManager->DeactivateSubShell( mrViewShell, pos->first );
+ maSubShells.erase( pos );
+}
+
+
+
+
void TaskPaneShellManager::RemoveSubShell (const SfxShell* pShell)
{
if (pShell != NULL)
diff --git a/sd/source/ui/toolpanel/TaskPaneShellManager.hxx b/sd/source/ui/toolpanel/TaskPaneShellManager.hxx
index 2c2e49b98c48..92e7b6b83b8d 100644
--- a/sd/source/ui/toolpanel/TaskPaneShellManager.hxx
+++ b/sd/source/ui/toolpanel/TaskPaneShellManager.hxx
@@ -46,7 +46,7 @@ namespace sd { namespace toolpanel {
/** The TaskPaneShellManager implements the ViewShellManager::ShellFactory
interface. However, it does not create or delete shells. It only
gives the ViewShellManager access to the sub shells of the
- TaskPaneViewShell. Life time control of the sub shells is managed by
+ ToolPanelViewShell. Life time control of the sub shells is managed by
the sub shells themselves.
*/
class TaskPaneShellManager
@@ -86,6 +86,11 @@ public:
NULL when this shell is requested.
*/
void RemoveSubShell (const SfxShell* pShell);
+ /** removes the shell given by its ID from the set of sub shells managed by the
+ TaskPaneShellManager. Subsequent calls to CreateShell() will return
+ NULL when this shell is requested.
+ */
+ void RemoveSubShell (const ShellId i_nShellId);
/** Move the given sub-shell to the top of the local shell stack.
Furthermore move the view shell whose sub-shells this class manages
diff --git a/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx b/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx
new file mode 100644
index 000000000000..4d0103086932
--- /dev/null
+++ b/sd/source/ui/toolpanel/TaskPaneToolPanel.cxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "TaskPaneToolPanel.hxx"
+#include "ToolPanelDeck.hxx"
+
+#include <tools/diagnose_ex.h>
+#include <vcl/window.hxx>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::drawing::framework::XResourceId;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= TaskPaneToolPanel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneToolPanel::TaskPaneToolPanel( ToolPanelDeck& i_rPanelDeck, const String& i_rPanelName, const Image& i_rImage,
+ const SmartId& i_rHelpId )
+ :m_pPanelDeck( &i_rPanelDeck )
+ ,m_aPanelImage( i_rImage )
+ ,m_sPanelName( i_rPanelName )
+ ,m_aHelpId( i_rHelpId )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ TaskPaneToolPanel::~TaskPaneToolPanel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Window& TaskPaneToolPanel::getPanelWindowAnchor()
+ {
+ OSL_ENSURE( !isDisposed(), "already disposed!" );
+ return m_pPanelDeck->GetPanelWindowAnchor();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString TaskPaneToolPanel::GetDisplayName() const
+ {
+ return m_sPanelName;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Image TaskPaneToolPanel::GetImage() const
+ {
+ return m_aPanelImage;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void TaskPaneToolPanel::Dispose()
+ {
+ ENSURE_OR_RETURN_VOID( m_pPanelDeck, "disposed twice" );
+ m_pPanelDeck = NULL;
+ }
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
diff --git a/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx b/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx
new file mode 100644
index 000000000000..d92b1c14bf27
--- /dev/null
+++ b/sd/source/ui/toolpanel/TaskPaneToolPanel.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_TASKPANETOOLPANEL_HXX
+#define SD_TASKPANETOOLPANEL_HXX
+
+#include "taskpane/TaskPaneControlFactory.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/XResourceId.hpp>
+/** === end UNO includes === **/
+
+#include <svtools/toolpanel/toolpanel.hxx>
+
+#include <vcl/image.hxx>
+#include <vcl/smartid.hxx>
+
+#include <memory>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ class ToolPanelDeck;
+
+ //==================================================================================================================
+ //= TaskPaneToolPanel
+ //==================================================================================================================
+ class TaskPaneToolPanel : public ::svt::ToolPanelBase
+ {
+ protected:
+ TaskPaneToolPanel(
+ ToolPanelDeck& i_rPanelDeck,
+ const String& i_rPanelName,
+ const Image& i_rImage,
+ const SmartId& i_rHelpId
+ );
+ ~TaskPaneToolPanel();
+
+ public:
+ // IToolPanel overridables
+ virtual ::rtl::OUString GetDisplayName() const;
+ virtual Image GetImage() const;
+ virtual void Dispose();
+ // those are still abstract, and waiting to be overloaded
+ virtual void Activate( ::Window& i_rParentWindow ) = 0;
+ virtual void Deactivate() = 0;
+ virtual void SetSizePixel( const Size& i_rPanelWindowSize ) = 0;
+ virtual void GrabFocus() = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ CreatePanelAccessible(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ ) = 0;
+
+ // own overridables
+ virtual const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& getResourceId() const = 0;
+
+ protected:
+ bool isDisposed() const { return m_pPanelDeck == NULL; }
+ Window& getPanelWindowAnchor();
+
+ private:
+ ToolPanelDeck* m_pPanelDeck;
+ const Image m_aPanelImage;
+ const String m_sPanelName;
+ const SmartId m_aHelpId;
+ };
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
+
+#endif // SD_TASKPANETOOLPANEL_HXX
diff --git a/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx b/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
index 152f576bd5bc..f70e643636d5 100644
--- a/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
+++ b/sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
@@ -122,17 +122,6 @@ sal_Int32 TreeNode::GetMinimumWidth (void)
-ObjectBarManager* TreeNode::GetObjectBarManager (void)
-{
- if (mpParent != NULL)
- return mpParent->GetObjectBarManager();
- else
- return NULL;
-}
-
-
-
-
bool TreeNode::IsResizable (void)
{
return false;
diff --git a/sd/source/ui/toolpanel/TaskPaneViewShell.cxx b/sd/source/ui/toolpanel/TaskPaneViewShell.cxx
deleted file mode 100644
index d80beba7cd10..000000000000
--- a/sd/source/ui/toolpanel/TaskPaneViewShell.cxx
+++ /dev/null
@@ -1,889 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sd.hxx"
-
-#include "TaskPaneViewShell.hxx"
-
-#include "TaskPaneShellManager.hxx"
-#include "ToolPanelChildWindow.hrc"
-#include "ToolPanelChildWindow.hxx"
-#include "taskpane/SlideSorterCacheDisplay.hxx"
-#include "taskpane/ToolPanel.hxx"
-#include "taskpane/TitledControl.hxx"
-#include "LayoutMenu.hxx"
-#include "TaskPaneFocusManager.hxx"
-#include "taskpane/SubToolPanel.hxx"
-#include "taskpane/ScrollPanel.hxx"
-#include "taskpane/TaskPaneControlFactory.hxx"
-#include "controls/MasterPagesPanel.hxx"
-#include "controls/MasterPagesSelector.hxx"
-#include "controls/TableDesignPanel.hxx"
-#include "controls/CustomAnimationPanel.hxx"
-#include "controls/SlideTransitionPanel.hxx"
-#include "controls/AnimationSchemesPanel.hxx"
-#include "TitleToolBox.hxx"
-#include "taskpane/ControlContainer.hxx"
-#include "FrameView.hxx"
-#include "Window.hxx"
-#include "PaneDockingWindow.hxx"
-#include "AccessibleTaskPane.hxx"
-#include "DrawSubController.hxx"
-#include "sdmod.hxx"
-#include "app.hrc"
-#include "glob.hrc"
-#include "res_bmp.hrc"
-#include "helpids.h"
-#include "strings.hrc"
-#include "sdresid.hxx"
-#include "framework/FrameworkHelper.hxx"
-#include <com/sun/star/drawing/framework/XResourceId.hpp>
-#include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
-#include <com/sun/star/drawing/XDrawSubController.hpp>
-
-#include <svx/dlgctrl.hxx>
-#include <sfx2/bindings.hxx>
-#include <sfx2/dispatch.hxx>
-#include <sfx2/viewfrm.hxx>
-#include <sfx2/msg.hxx>
-#include <sfx2/objface.hxx>
-#include <svx/colrctrl.hxx>
-#include <svx/xtable.hxx>
-#include <vcl/dockwin.hxx>
-#include "sdtreelb.hxx"
-#include "DrawViewShell.hxx"
-#include "drawdoc.hxx"
-#include "ViewShellBase.hxx"
-#include <svx/ruler.hxx>
-#include <vcl/svapp.hxx>
-
-//#define SHOW_TEST_PANEL
-#ifdef SHOW_TEST_PANEL
-#include "TestPanel.hxx"
-#endif
-//#define SHOW_COLOR_MENU
-#ifdef SHOW_COLOR_MENU
-#include "TestMenu.hxx"
-#endif
-
-#include <vector>
-#include <boost/shared_ptr.hpp>
-
-using namespace ::sd::toolpanel;
-
-#define TaskPaneViewShell
-#include "sdslots.hxx"
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-using ::sd::framework::FrameworkHelper;
-
-namespace sd { namespace toolpanel {
-
-SFX_IMPL_INTERFACE(TaskPaneViewShell, SfxShell, SdResId(STR_TASKPANEVIEWSHELL))
-{
-}
-
-
-TYPEINIT1(TaskPaneViewShell, ViewShell);
-
-
-/** Inner implementation class of TaskPaneViewShell.
-*/
-class TaskPaneViewShell::Implementation
-{
-public:
- static const sal_uInt32 mnInvalidId = 0xffffffff;
-
- Implementation (void);
- ~Implementation (void);
-
- /** Here the panels are created that are shown in the task pane.
- */
- void Setup (ToolPanel* pToolPanel, ViewShellBase& rBase);
-
- /** Make a new panel known to the translation table that translates
- between internal indices as returned by
- ControlContainer::AddControl() and public indices defined by
- TaskPaneViewShell::PanelId.
- */
- void AddPanel (sal_uInt32 nInternalId, PanelId nPublicId);
-
- /** Return the public id for the given internal one.
- @return
- When the given public id is not known then PID_UNKNOWN is
- returned.
- */
- PanelId GetPublicId (sal_uInt32 nInternalId) const;
-
- /** Return the internal id for the given public one.
- @return
- When the given public id is not known then mnInvalidId is
- returned.
- */
- sal_uInt32 GetInternalId (PanelId nPublicId) const;
-
-private:
- /** This map translates between internal indices returned by
- ControlContainer::AddControl() and public indices defined by
- TaskPaneViewShell::PanelId.
- */
- typedef ::std::vector<PanelId> InternalIdToPanelIdMap;
- InternalIdToPanelIdMap maIndexMap;
-};
-
-
-
-
-namespace {
-
-enum MenuId {
- MID_UNLOCK_TASK_PANEL = 1,
- MID_LOCK_TASK_PANEL = 2,
- MID_CUSTOMIZE = 3,
- MID_FIRST_CONTROL = 4
-};
-
-/** This control is used for extracting the title string from the resource
- of some dialogs that are displayed in the task pane. With this the
- actual controls can be created on demand. This class only loads (a part
- of) their resource.
-*/
-class DummyControl : public Control
-{
-public:
- DummyControl (::Window* pParent, const ResId& rResId)
- : Control(pParent,rResId)
- {
- FreeResource();
- }
-};
-
-class ResourceActivationClickHandler
-{
-public:
- ResourceActivationClickHandler (
- const ::boost::shared_ptr<FrameworkHelper>& rpFrameworkHelper,
- const Reference<drawing::framework::XResourceId>& rxResourceId,
- ControlContainer& rControlContainer);
- void operator () (TitledControl& rTitledControl);
-
-private:
- ::boost::shared_ptr<FrameworkHelper> mpFrameworkHelper;
- Reference<drawing::framework::XResourceId> mxResourceId;
- ControlContainer& mrControlContainer;
-};
-
-} // end of anonymouse namespace
-
-
-
-
-
-void TaskPaneViewShell::Implementation::Setup (
- ToolPanel* pToolPanel,
- ViewShellBase& rBase)
-{
- SdDrawDocument* pDocument = rBase.GetDocument();
- sal_uInt32 nId;
- sal_uInt32 nIdOfControlToExpand;
-
- ::boost::shared_ptr<FrameworkHelper> pFrameworkHelper (FrameworkHelper::Instance(rBase));
- Reference<drawing::framework::XResourceId> xTaskPaneId (pFrameworkHelper->CreateResourceId(
- FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL));
-
- // The master page controls.
- nId = pToolPanel->AddControl (
- controls::MasterPagesPanel::CreateControlFactory(rBase),
- SdResId(STR_TASKPANEL_MASTER_PAGE_TITLE),
- HID_SD_SLIDE_DESIGNS,
- ResourceActivationClickHandler(
- pFrameworkHelper,
- pFrameworkHelper->CreateResourceId(
- FrameworkHelper::msMasterPagesTaskPanelURL, xTaskPaneId),
- pToolPanel->GetControlContainer()));
- AddPanel (nId, PID_MASTER_PAGES);
-
- // Layout Menu.
- nId = pToolPanel->AddControl (
- LayoutMenu::CreateControlFactory(rBase, *pDocument->GetDocSh()),
- SdResId(STR_TASKPANEL_LAYOUT_MENU_TITLE),
- HID_SD_SLIDE_LAYOUTS,
- ResourceActivationClickHandler(
- pFrameworkHelper,
- pFrameworkHelper->CreateResourceId(
- FrameworkHelper::msLayoutTaskPanelURL, xTaskPaneId),
- pToolPanel->GetControlContainer()));
- AddPanel (nId, PID_LAYOUT);
- nIdOfControlToExpand = nId;
-
- {
- DummyControl aControl (pToolPanel, SdResId(DLG_TABLEDESIGNPANE));
-
- // TableDesignPanel
- nId = pToolPanel->AddControl (
- controls::TableDesignPanel::CreateControlFactory(rBase),
- aControl.GetText(),
- HID_SD_TABLE_DESIGN,
- ResourceActivationClickHandler(
- pFrameworkHelper,
- pFrameworkHelper->CreateResourceId(
- FrameworkHelper::msTableDesignPanelURL, xTaskPaneId),
- pToolPanel->GetControlContainer()));
- AddPanel (nId, PID_TABLE_DESIGN);
- }
-
- {
- DummyControl aControl (pToolPanel, SdResId(RID_CUSTOMANIMATION_START+0));
-
- // CustomAnimationPanel
- nId = pToolPanel->AddControl (
- controls::CustomAnimationPanel::CreateControlFactory(rBase),
- aControl.GetText(),
- HID_SD_CUSTOM_ANIMATIONS,
- ResourceActivationClickHandler(
- pFrameworkHelper,
- pFrameworkHelper->CreateResourceId(
- FrameworkHelper::msCustomAnimationTaskPanelURL, xTaskPaneId),
- pToolPanel->GetControlContainer()));
- AddPanel (nId, PID_CUSTOM_ANIMATION);
- }
-
- // SlideTransitionPanel
- {
- DummyControl aControl (pToolPanel, SdResId(RID_CUSTOMANIMATION_START+3));
-
- nId = pToolPanel->AddControl (
- controls::SlideTransitionPanel::CreateControlFactory(rBase),
- aControl.GetText(),
- HID_SD_SLIDE_TRANSITIONS,
- ResourceActivationClickHandler(
- pFrameworkHelper,
- pFrameworkHelper->CreateResourceId(
- FrameworkHelper::msSlideTransitionTaskPanelURL, xTaskPaneId),
- pToolPanel->GetControlContainer()));
- AddPanel (nId, PID_SLIDE_TRANSITION);
- }
-
-#ifdef SHOW_COLOR_MENU
- // Test Menu.
- pToolPanel->AddControl (
- ColorMenu::CreateControlFactory(),
- String::CreateFromAscii ("Color Test Menu"),
- 0);
-#endif
-
-#ifdef SHOW_TEST_PANEL
- // Test Panel.
- pToolPanel->AddControl (
- TestPanel::CreateControlFactory(),
- String::CreateFromAscii ("Test Panel"),
- 0);
-#endif
-
-#ifdef USE_SLIDE_SORTER_CACHE_DISPLAY
- pToolPanel->AddControl (
- SlideSorterCacheDisplay::CreateControlFactory(pDocument),
- String::CreateFromAscii("Slide Sorter Cache Status"),
- 0);
-#endif
-
- // Expand the layout menu.
- pToolPanel->GetControlContainer().SetExpansionState (
- nIdOfControlToExpand,
- ControlContainer::ES_EXPAND);
-
- pToolPanel->GetWindow()->Show();
-}
-
-
-
-
-void TaskPaneViewShell::Initialize (void)
-{
- if ( ! mbIsInitialized)
- {
- mbIsInitialized = true;
- mpImpl->Setup (mpTaskPane.get(), GetViewShellBase());
- }
-}
-
-
-
-
-TaskPaneViewShell::TaskPaneViewShell (
- SfxViewFrame* pFrame,
- ViewShellBase& rViewShellBase,
- ::Window* pParentWindow,
- FrameView* pFrameViewArgument)
- : ViewShell (pFrame, pParentWindow, rViewShellBase),
- mpImpl(NULL),
- mpTaskPane(NULL),
- mbIsInitialized(false),
- mpSubShellManager(),
- mnMenuId(0)
-{
- meShellType = ST_TASK_PANE;
-
- mpImpl.reset (new Implementation());
-
- mpContentWindow->SetCenterAllowed (false);
- pParentWindow->SetStyle(pParentWindow->GetStyle() | WB_DIALOGCONTROL);
-
- mpTaskPane = ::std::auto_ptr<ToolPanel>(new ToolPanel (
- mpContentWindow.get(), *this));
-
- GetParentWindow()->SetBackground(Wallpaper());
- mpContentWindow->SetBackground(Wallpaper());
-
- GetParentWindow()->SetHelpId(HID_SD_TASK_PANE);
-
- PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(GetDockingWindow());
- if (pDockingWindow != NULL)
- {
- pDockingWindow->InitializeTitleToolBox();
- mnMenuId = pDockingWindow->AddMenu (
- String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_TITLE)),
- HID_SD_TASK_PANE_VIEW_MENU,
- LINK(this, TaskPaneViewShell, ToolboxClickHandler));
- }
-
- // Tell the focus manager that we want to pass the focus to our
- // child.
- FocusManager::Instance().RegisterDownLink(pParentWindow, mpTaskPane.get());
-
- SetPool (&GetDoc()->GetPool());
-
- if (pFrameViewArgument != NULL)
- mpFrameView = pFrameViewArgument;
- else
- mpFrameView = new FrameView(GetDoc());
- GetFrameView()->Connect();
-
- // Hide or delete unused controls that we have inherited from the
- // ViewShell base class.
- mpHorizontalScrollBar.reset();
- mpVerticalScrollBar.reset();
- mpScrollBarBox.reset();
- mpHorizontalRuler.reset();
- mpVerticalRuler.reset();
-
- SetName (String (RTL_CONSTASCII_USTRINGPARAM("TaskPaneViewShell")));
-
- // For accessibility we have to shortly hide the content window. This
- // triggers the construction of a new accessibility object for the new
- // view shell. (One is created earlier while the construtor of the base
- // class is executed. At that time the correct accessibility object can
- // not be constructed.)
- if (mpContentWindow.get() !=NULL)
- {
- mpContentWindow->Hide();
- mpContentWindow->Show();
- }
-
- // Register the shell manager as factory at the ViewShellManager.
- mpSubShellManager.reset (new TaskPaneShellManager(
- GetViewShellBase().GetViewShellManager(),
- *this));
- GetViewShellBase().GetViewShellManager()->AddSubShellFactory(this, mpSubShellManager);
-}
-
-
-
-
-TaskPaneViewShell::~TaskPaneViewShell (void)
-{
- GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory(this, mpSubShellManager);
-}
-
-
-
-// static
-void TaskPaneViewShell::RegisterControls (void)
-{
- SfxModule* pModule = SD_MOD();
- controls::MasterPagesSelector::RegisterInterface (pModule);
- LayoutMenu::RegisterInterface (pModule);
-}
-
-
-
-
-void TaskPaneViewShell::ArrangeGUIElements (void)
-{
- ViewShell::ArrangeGUIElements();
-
- Point aOrigin (maViewPos);
- Size aSize (maViewSize);
-
- Initialize();
-
- // Place the task pane.
- if (mpTaskPane.get() != NULL)
- mpTaskPane->SetPosSizePixel (Point(0,0), aSize);
-}
-
-
-
-
-void TaskPaneViewShell::GetFocus (void)
-{
- Invalidate ();
-}
-
-
-
-
-void TaskPaneViewShell::LoseFocus (void)
-{
- Invalidate ();
-}
-
-
-
-
-void TaskPaneViewShell::KeyInput (const KeyEvent& rEvent)
-{
- KeyCode nCode = rEvent.GetKeyCode();
- if (nCode == KEY_RETURN)
- {
- mpTaskPane->GrabFocus();
- }
- else
- ViewShell::KeyInput (rEvent, NULL);
-}
-
-
-
-
-IMPL_LINK(TaskPaneViewShell, ToolboxClickHandler, ToolBox*, pToolBox)
-{
- if (pToolBox->GetCurItemId() == mnMenuId)
- {
- pToolBox->EndSelection();
-
- DockingWindow* pDockingWindow = GetDockingWindow();
- ::std::auto_ptr<PopupMenu> pMenu = CreatePopupMenu (
- pDockingWindow!=NULL && !pDockingWindow->IsFloatingMode());
- pMenu->SetSelectHdl (
- LINK(this, TaskPaneViewShell, MenuSelectHandler));
-
- // pass toolbox button rect so the menu can stay open on button up
- Rectangle aRect = pToolBox->GetItemRect(mnMenuId);
- aRect.SetPos(pToolBox->GetPosPixel() );
- pMenu->Execute (pDockingWindow, aRect, POPUPMENU_EXECUTE_DOWN);
- }
-
- return 0;
-}
-
-
-
-
-IMPL_LINK(TaskPaneViewShell, MenuSelectHandler, Menu*, pMenu)
-{
- if (pMenu)
- {
- pMenu->Deactivate();
- switch (pMenu->GetCurItemId())
- {
- case MID_UNLOCK_TASK_PANEL:
- {
- DockingWindow* pDockingWindow = GetDockingWindow();
- if (pDockingWindow != NULL)
- pDockingWindow->SetFloatingMode (TRUE);
- }
- break;
-
- case MID_LOCK_TASK_PANEL:
- {
- DockingWindow* pDockingWindow = GetDockingWindow();
- if (pDockingWindow != NULL)
- pDockingWindow->SetFloatingMode (FALSE);
- }
- break;
-
- case MID_CUSTOMIZE:
- DBG_ASSERT (0, "Customization not yet implemented");
- break;
-
- default:
- {
- sal_uInt32 nIndex (pMenu->GetUserValue(pMenu->GetCurItemId()));
- mpTaskPane->GetControlContainer().SetVisibilityState (
- nIndex,
- ControlContainer::VS_TOGGLE);
- // mpTaskPane->Resize();
- // mpTaskPane->Invalidate();
- }
- break;
- }
- }
-
- return 0;
-}
-
-
-
-
-::std::auto_ptr<PopupMenu> TaskPaneViewShell::CreatePopupMenu (
- bool bIsDocking)
-{
- ::std::auto_ptr<PopupMenu> pMenu (new PopupMenu ());
- FloatingWindow* pFloat = static_cast<FloatingWindow*>(pMenu->GetWindow());
- if (pFloat != NULL)
- {
- pFloat->SetPopupModeFlags (
- pFloat->GetPopupModeFlags()
- | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE);
- }
-
- // warning free code changes:
- // FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE is 0x10000, so cast to USHORT is 0
- // so why was this used anyway?
- pMenu->SetMenuFlags (
- pMenu->GetMenuFlags() /* | (USHORT)FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE */ );
-
- // Add one entry for every tool panel element to individually make
- // them visible or hide them.
- USHORT nIndex = MID_FIRST_CONTROL;
- sal_uInt32 nControlIndex;
- ControlContainer& rContainer (mpTaskPane->GetControlContainer());
- for (nControlIndex=0;
- nControlIndex<rContainer.GetControlCount();
- nControlIndex=rContainer.GetNextIndex(nControlIndex,true,false))
- {
- TreeNode* pChild = rContainer.GetControl(nControlIndex);
- TitledControl* pControl
- = static_cast<TitledControl*>(pChild->GetWindow());
- pMenu->InsertItem (nIndex,
- pControl->GetTitle(),
- MIB_CHECKABLE);
- pMenu->SetUserValue (nIndex, nControlIndex);
- if (pControl->IsVisible())
- pMenu->CheckItem (nIndex, TRUE);
- nIndex++;
- }
-
- pMenu->InsertSeparator ();
-
- // Add entry for docking or un-docking the tool panel.
- if (bIsDocking)
- pMenu->InsertItem (
- MID_UNLOCK_TASK_PANEL,
- String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_UNLOCK)));
- else
- pMenu->InsertItem (
- MID_LOCK_TASK_PANEL,
- String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_LOCK)));
- pMenu->RemoveDisabledEntries (FALSE, FALSE);
-
- return pMenu;
-}
-
-
-
-
-SdPage* TaskPaneViewShell::GetActualPage (void)
-{
- return NULL;
-}
-
-SdPage* TaskPaneViewShell::getCurrentPage(void) const
-{
- return NULL;
-}
-
-
-
-void TaskPaneViewShell::Execute (SfxRequest& )
-{
-}
-
-
-
-
-void TaskPaneViewShell::GetState (SfxItemSet& rItemSet)
-{
- (void)rItemSet;
-}
-
-
-
-
-TaskPaneShellManager& TaskPaneViewShell::GetSubShellManager (void) const
-{
- return *mpSubShellManager.get();
-}
-
-
-
-
-DockingWindow* TaskPaneViewShell::GetDockingWindow (void)
-{
- ::Window* pParentWindow = GetParentWindow();
- DockingWindow* pDockingWindow = NULL;
- while (pParentWindow!=NULL && pDockingWindow==NULL)
- {
- pDockingWindow = dynamic_cast<DockingWindow*>(pParentWindow);
- pParentWindow = pParentWindow->GetParent();
- }
- return pDockingWindow;
-}
-
-
-
-
-void TaskPaneViewShell::ShowPanel (const PanelId nPublicId)
-{
- Initialize();
- sal_uInt32 nId (mpImpl->GetInternalId(nPublicId));
- if (nId != Implementation::mnInvalidId)
- {
- mpTaskPane->GetControlContainer().SetVisibilityState (
- nId,
- ControlContainer::VS_SHOW);
- }
-}
-
-
-
-
-void TaskPaneViewShell::HidePanel (const PanelId nPublicId)
-{
- Initialize();
- sal_uInt32 nId (mpImpl->GetInternalId(nPublicId));
- if (nId != Implementation::mnInvalidId)
- {
- mpTaskPane->GetControlContainer().SetVisibilityState (
- nId,
- ControlContainer::VS_HIDE);
- }
-}
-
-
-
-
-void TaskPaneViewShell::ExpandPanel (const PanelId nPublicId)
-{
- Initialize();
- sal_uInt32 nId (mpImpl->GetInternalId(nPublicId));
- if (nId != Implementation::mnInvalidId)
- {
- mpTaskPane->GetControlContainer().SetExpansionState (
- nId,
- ControlContainer::ES_EXPAND);
- }
-}
-
-
-
-
-void TaskPaneViewShell::CollapsePanel (const PanelId nPublicId)
-{
- Initialize();
- sal_uInt32 nId (mpImpl->GetInternalId(nPublicId));
- if (nId != Implementation::mnInvalidId)
- {
- mpTaskPane->GetControlContainer().SetExpansionState (
- nId,
- ControlContainer::ES_COLLAPSE);
- }
-}
-
-
-
-
-::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible>
- TaskPaneViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow)
-{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible> xAccessible;
-
- if (mpTaskPane.get()!=NULL && pWindow!=NULL)
- {
- // We have to call CreateAccessible directly so that we can specify
- // the correct accessible parent.
- ::Window* pParentWindow = pWindow->GetAccessibleParentWindow();
- if (pParentWindow != NULL)
- xAccessible = mpTaskPane->CreateAccessibleObject(
- pParentWindow->GetAccessible());
- }
-
- return xAccessible;
-}
-
-
-
-
-Reference<drawing::XDrawSubController> TaskPaneViewShell::CreateSubController (void)
-{
- // This view shell is not designed to be the main view shell and thus
- // does not support a UNO sub controller.
- return Reference<drawing::XDrawSubController>();
-}
-
-
-
-
-bool TaskPaneViewShell::RelocateToParentWindow (::Window* pParentWindow)
-{
- ::Window* pOldParentWindow = GetParentWindow();
- FocusManager::Instance().RemoveLinks(pOldParentWindow, mpTaskPane.get());
- FocusManager::Instance().RemoveLinks(mpTaskPane.get(), pOldParentWindow);
-
- ViewShell::RelocateToParentWindow(pParentWindow);
-
- PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(GetDockingWindow());
- if (pDockingWindow != NULL)
- {
- pDockingWindow->InitializeTitleToolBox();
- mnMenuId = pDockingWindow->AddMenu (
- String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_TITLE)),
- HID_SD_TASK_PANE_VIEW_MENU,
- LINK(this, TaskPaneViewShell, ToolboxClickHandler));
- }
- FocusManager::Instance().RegisterDownLink(pParentWindow, mpTaskPane.get());
-
- Resize();
-
- return true;
-}
-
-
-
-
-//===== TaskPaneViewShell::Implementation =====================================
-
-TaskPaneViewShell::Implementation::Implementation (void)
- : maIndexMap(
- (InternalIdToPanelIdMap::size_type)PID__END,
- PID_UNKNOWN)
-{
-}
-
-
-
-
-TaskPaneViewShell::Implementation::~Implementation (void)
-{
-}
-
-
-
-
-void TaskPaneViewShell::Implementation::AddPanel (
- sal_uInt32 nInternalId,
- PanelId nPublicId)
-{
- maIndexMap[nInternalId] = nPublicId;
-}
-
-
-
-
-TaskPaneViewShell::PanelId
- TaskPaneViewShell::Implementation::GetPublicId (
- sal_uInt32 nInternalId) const
-{
- if (nInternalId < maIndexMap.size())
- return maIndexMap[nInternalId];
- else
- return PID_UNKNOWN;
-}
-
-
-
-
-sal_uInt32
- TaskPaneViewShell::Implementation::GetInternalId (
- TaskPaneViewShell::PanelId nPublicId) const
-{
- sal_uInt32 nId = mnInvalidId;
- for (sal_uInt32 nI=0; nI<maIndexMap.size(); nI++)
- if (maIndexMap[nI] == nPublicId)
- {
- nId = nI;
- break;
- }
-
- return nId;
-}
-
-
-
-
-//===== PanelActivation =======================================================
-
-PanelActivation::PanelActivation (ViewShellBase& rBase, TaskPaneViewShell::PanelId nPanelId)
- : mrBase(rBase),
- mnPanelId(nPanelId)
-{
-}
-
-void PanelActivation::operator() (bool)
-{
- toolpanel::TaskPaneViewShell* pTaskPane
- = dynamic_cast<toolpanel::TaskPaneViewShell*>(
- framework::FrameworkHelper::Instance(mrBase)
- ->GetViewShell(framework::FrameworkHelper::msRightPaneURL).get());
- if (pTaskPane != NULL)
- pTaskPane->ShowPanel(mnPanelId);
-}
-
-
-
-
-//===== ResourceActivationClickHandler ========================================
-
-ResourceActivationClickHandler::ResourceActivationClickHandler (
- const ::boost::shared_ptr<FrameworkHelper>& rpFrameworkHelper,
- const Reference<drawing::framework::XResourceId>& rxResourceId,
- ControlContainer& rControlContainer)
- : mpFrameworkHelper(rpFrameworkHelper),
- mxResourceId(rxResourceId),
- mrControlContainer(rControlContainer)
-{
-}
-
-
-
-
-void ResourceActivationClickHandler::operator () (TitledControl& rTitledControl)
-{
- mrControlContainer.SetExpansionState (
- &rTitledControl,
- ControlContainer::ES_EXPAND);
- mpFrameworkHelper->GetConfigurationController()->requestResourceActivation(
- mxResourceId, drawing::framework::ResourceActivationMode_REPLACE);
-}
-
-
-} } // end of namespace ::sd::toolpanel
diff --git a/sd/source/ui/toolpanel/TestMenu.cxx b/sd/source/ui/toolpanel/TestMenu.cxx
index 7bfb6adebe8d..54c865f12728 100644
--- a/sd/source/ui/toolpanel/TestMenu.cxx
+++ b/sd/source/ui/toolpanel/TestMenu.cxx
@@ -45,16 +45,16 @@ class ColorMenuFactory
: public ControlFactory
{
protected:
- virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode)
+ virtual TreeNode* InternalCreateControl( ::Window& i_rParent )
{
- return new ColorMenu (pTreeNode);
+ return new ColorMenu (&i_rParent);
}
};
-ColorMenu::ColorMenu (TreeNode* pParent)
- : Window (pParent->GetWindow()),
- TreeNode(pParent),
+ColorMenu::ColorMenu (::Window* i_pParent)
+ : Window (i_pParent),
+ TreeNode(NULL),
maSet (this),
mnPreferredColumnCount(2)
{
@@ -71,7 +71,7 @@ ColorMenu::ColorMenu (TreeNode* pParent)
Fill ();
maSet.Show();
- pParent->RequestResize();
+ i_pParent->Resize();
}
diff --git a/sd/source/ui/toolpanel/TestMenu.hxx b/sd/source/ui/toolpanel/TestMenu.hxx
index 37ac6542970d..2b5dfe2e2e57 100644
--- a/sd/source/ui/toolpanel/TestMenu.hxx
+++ b/sd/source/ui/toolpanel/TestMenu.hxx
@@ -47,7 +47,7 @@ class ColorMenu
public TreeNode
{
public:
- ColorMenu (TreeNode* pParent);
+ ColorMenu (::Window* i_pParent);
virtual ~ColorMenu (void);
static ::std::auto_ptr<ControlFactory> CreateControlFactory (void);
diff --git a/sd/source/ui/toolpanel/TestPanel.cxx b/sd/source/ui/toolpanel/TestPanel.cxx
index e2786e23a0c5..f0b6951cefc4 100644
--- a/sd/source/ui/toolpanel/TestPanel.cxx
+++ b/sd/source/ui/toolpanel/TestPanel.cxx
@@ -45,9 +45,9 @@ class TestPanelFactory
: public ControlFactory
{
protected:
- virtual TreeNode* InternalCreateControl (TreeNode* pTreeNode)
+ virtual TreeNode* InternalCreateControl( ::Window& i_rParent )
{
- return new TestPanel (pTreeNode);
+ return new TestPanel (i_rParent);
}
};
@@ -109,8 +109,8 @@ private:
};
-TestPanel::TestPanel (TreeNode* pParent)
- : SubToolPanel (pParent)
+TestPanel::TestPanel (::Window& i_rParent)
+ : SubToolPanel (i_rParent)
{
// Create a scrollable panel with two list boxes.
ScrollPanel* pScrollPanel = new ScrollPanel (this);
diff --git a/sd/source/ui/toolpanel/TestPanel.hxx b/sd/source/ui/toolpanel/TestPanel.hxx
index f883cc08c1e1..af1b97d0f885 100644
--- a/sd/source/ui/toolpanel/TestPanel.hxx
+++ b/sd/source/ui/toolpanel/TestPanel.hxx
@@ -42,7 +42,7 @@ class TestPanel
: public SubToolPanel
{
public:
- TestPanel (TreeNode* pParent);
+ TestPanel (::Window& i_rParent);
virtual ~TestPanel (void);
static std::auto_ptr<ControlFactory> CreateControlFactory (void);
diff --git a/sd/source/ui/toolpanel/TitleBar.cxx b/sd/source/ui/toolpanel/TitleBar.cxx
index e0b48a6cf57b..0bfc62cbd50b 100644
--- a/sd/source/ui/toolpanel/TitleBar.cxx
+++ b/sd/source/ui/toolpanel/TitleBar.cxx
@@ -60,7 +60,7 @@ namespace sd { namespace toolpanel {
const int TitleBar::snIndentationWidth = 16;
TitleBar::TitleBar ( ::Window* pParent, const String& rsTitle, TitleBarType eType, bool bIsExpandable)
-: ::Window (pParent)
+: ::Window (pParent, WB_TABSTOP)
, TreeNode(this)
, meType(eType)
, msTitle(rsTitle)
@@ -77,9 +77,6 @@ TitleBar::TitleBar ( ::Window* pParent, const String& rsTitle, TitleBarType eTyp
// Change the mouse pointer shape so that it acts as a mouse over effect.
switch (meType)
{
- case TBT_WINDOW_TITLE:
- break;
-
case TBT_CONTROL_TITLE:
case TBT_SUB_CONTROL_HEADLINE:
if (mbIsExpandable)
@@ -170,10 +167,6 @@ void TitleBar::Paint (const Rectangle& rBoundingBox)
switch (meType)
{
- case TBT_WINDOW_TITLE:
- PaintWindowTitleBar ();
- break;
-
case TBT_CONTROL_TITLE:
PaintPanelControlTitle ();
break;
@@ -223,10 +216,21 @@ void TitleBar::SetEnabledState(bool bFlag)
}
-void TitleBar::SetFocus (bool bFlag)
+
+
+void TitleBar::GetFocus()
{
- mbFocused = bFlag;
- Invalidate ();
+ mbFocused = true;
+ Invalidate();
+}
+
+
+
+
+void TitleBar::LoseFocus()
+{
+ mbFocused = false;
+ Invalidate();
}
@@ -255,11 +259,6 @@ bool TitleBar::HasExpansionIndicator (void) const
case TBT_SUB_CONTROL_HEADLINE:
bHasExpansionIndicator = true;
break;
-
- default:
- case TBT_WINDOW_TITLE:
- // bHasExpansionIndicator remains false
- break;
}
}
return bHasExpansionIndicator;
@@ -306,11 +305,6 @@ Image TitleBar::GetExpansionIndicator (void) const
aIndicator = IconCache::Instance().GetIcon(nResourceId);
break;
-
- default:
- case TBT_WINDOW_TITLE:
- // aIndicator remains empty Image.
- break;
}
}
@@ -336,19 +330,6 @@ void TitleBar::PaintPanelControlTitle (void)
-void TitleBar::PaintWindowTitleBar (void)
-{
- Rectangle aTextBox (CalculateTextBoundingBox (
- GetOutputSizePixel().Width(),
- true));
-
- PaintText (aTextBox);
- PaintFocusIndicator (aTextBox);
-}
-
-
-
-
void TitleBar::PaintSubPanelHeadLineBar (void)
{
int nWidth (GetOutputSizePixel().Width());
@@ -534,10 +515,6 @@ void TitleBar::PaintBackground (const Rectangle& rTitleBarBox)
Point(rTitleBarBox.Right(), rTitleBarBox.Bottom()));
}
break;
-
- default:
- case TBT_WINDOW_TITLE:
- break;
}
}
@@ -588,11 +565,6 @@ Rectangle TitleBar::CalculateTitleBarBox (
switch (meType)
{
- case TBT_WINDOW_TITLE:
- aTitleBarBox.Bottom() += aTitleBarBox.Top();
- aTitleBarBox.Top() = 0;
- break;
-
case TBT_CONTROL_TITLE:
aTitleBarBox.Bottom() += aTitleBarBox.Top();
aTitleBarBox.Top() = 0;
diff --git a/sd/source/ui/toolpanel/TitledControl.cxx b/sd/source/ui/toolpanel/TitledControl.cxx
index 7930bb4cd7f1..8961565922cc 100644
--- a/sd/source/ui/toolpanel/TitledControl.cxx
+++ b/sd/source/ui/toolpanel/TitledControl.cxx
@@ -52,7 +52,6 @@ TitledControl::TitledControl (
msTitle(rTitle),
mbVisible(true),
mpUserData(NULL),
- mpControlFactory(NULL),
mpClickHandler(new ClickHandler(rClickHandler)),
mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
{
@@ -79,39 +78,6 @@ TitledControl::TitledControl (
-TitledControl::TitledControl (
- TreeNode* pParent,
- ::std::auto_ptr<ControlFactory> pControlFactory,
- const String& rTitle,
- const ClickHandler& rClickHandler,
- TitleBar::TitleBarType eType)
- : ::Window (pParent->GetWindow(), WB_TABSTOP),
- TreeNode(pParent),
- msTitle (rTitle),
- mbVisible (true),
- mpUserData (NULL),
- mpControlFactory(pControlFactory),
- mpClickHandler(new ClickHandler(rClickHandler)),
- mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
-{
- mpControlContainer->AddControl (::std::auto_ptr<TreeNode> (
- new TitleBar (this, rTitle, eType, true)));
-
- // The second control is created on demand, i.e. when GetControl(true)
- // is called the first time.
-
- SetBackground (Wallpaper());
-
- GetTitleBar()->GetWindow()->Show ();
- GetTitleBar()->GetWindow()->AddEventListener (
- LINK(this,TitledControl,WindowEventListener));
-
- UpdateStates ();
-}
-
-
-
-
TitledControl::~TitledControl (void)
{
GetTitleBar()->GetWindow()->RemoveEventListener (
@@ -124,7 +90,7 @@ TitledControl::~TitledControl (void)
Size TitledControl::GetPreferredSize (void)
{
Size aPreferredSize;
- if (GetControl(false) != NULL)
+ if (GetControl() != NULL)
{
aPreferredSize = GetControl()->GetPreferredSize();
if ( ! IsExpanded())
@@ -146,7 +112,7 @@ Size TitledControl::GetPreferredSize (void)
sal_Int32 TitledControl::GetPreferredWidth (sal_Int32 nHeight)
{
int nPreferredWidth = 0;
- if (GetControl(false) != NULL)
+ if (GetControl() != NULL)
nPreferredWidth = GetControl()->GetPreferredWidth(
nHeight - GetTitleBar()->GetWindow()->GetSizePixel().Height());
else
@@ -163,7 +129,7 @@ sal_Int32 TitledControl::GetPreferredWidth (sal_Int32 nHeight)
sal_Int32 TitledControl::GetPreferredHeight (sal_Int32 nWidth)
{
int nPreferredHeight = 0;
- if (IsExpanded() && GetControl(false)!=NULL)
+ if (IsExpanded() && GetControl()!=NULL)
nPreferredHeight = GetControl()->GetPreferredHeight(nWidth);
nPreferredHeight += GetTitleBar()->GetPreferredHeight(nWidth);
@@ -201,7 +167,7 @@ void TitledControl::Resize (void)
Size (aWindowSize.Width(), nTitleBarHeight));
- TreeNode* pControl = GetControl(false);
+ TreeNode* pControl = GetControl();
if (pControl != NULL
&& pControl->GetWindow() != NULL
&& pControl->GetWindow()->IsVisible())
@@ -219,17 +185,7 @@ void TitledControl::GetFocus (void)
{
::Window::GetFocus();
if (GetTitleBar() != NULL)
- GetTitleBar()->SetFocus (true);
-}
-
-
-
-
-void TitledControl::LoseFocus (void)
-{
- ::Window::LoseFocus();
- if (GetTitleBar() != NULL)
- GetTitleBar()->SetFocus (false);
+ GetTitleBar()->GrabFocus();
}
@@ -258,7 +214,7 @@ void TitledControl::KeyInput (const KeyEvent& rEvent)
if ( ! FocusManager::Instance().TransferFocus(this,nCode))
{
// When already expanded then put focus on first child.
- TreeNode* pControl = GetControl(false);
+ TreeNode* pControl = GetControl();
if (pControl!=NULL && IsExpanded())
if (pControl->GetWindow() != NULL)
pControl->GetWindow()->GrabFocus();
@@ -296,7 +252,7 @@ bool TitledControl::Expand (bool bExpanded)
// Get the control. Use the bExpanded parameter as argument to
// indicate that a control is created via its factory only when it
// is to be expanded. When it is collapsed this is not necessary.
- TreeNode* pControl = GetControl(bExpanded);
+ TreeNode* pControl = GetControl();
if (pControl != NULL
&& GetControl()->IsExpanded() != bExpanded)
{
@@ -314,7 +270,7 @@ bool TitledControl::Expand (bool bExpanded)
bool TitledControl::IsExpandable (void) const
{
- const TreeNode* pControl = GetConstControl(false);
+ const TreeNode* pControl = GetConstControl();
if (pControl != NULL)
return pControl->IsExpandable();
else
@@ -328,7 +284,7 @@ bool TitledControl::IsExpandable (void) const
bool TitledControl::IsExpanded (void) const
{
- const TreeNode* pControl = GetConstControl(false);
+ const TreeNode* pControl = GetConstControl();
if (pControl != NULL)
return pControl->IsExpanded();
else
@@ -402,7 +358,7 @@ void TitledControl::UpdateStates (void)
else
GetWindow()->Hide();
- TreeNode* pControl = GetControl(false);
+ TreeNode* pControl = GetControl();
if (pControl!=NULL && pControl->GetWindow() != NULL)
{
if (IsVisible() && IsExpanded())
@@ -435,33 +391,17 @@ IMPL_LINK(TitledControl, WindowEventListener,
-TreeNode* TitledControl::GetControl (bool bCreate)
+TreeNode* TitledControl::GetControl (void)
{
- TreeNode* pNode = mpControlContainer->GetControl(1);
- if (pNode==NULL && mpControlFactory.get()!=NULL && bCreate)
- {
- // We have to create the control with the factory object.
- ::std::auto_ptr<TreeNode> pControl (mpControlFactory->CreateControl(this));//GetParentNode()));
- if (pControl.get() != NULL)
- {
- pControl->SetParentNode(this);
- mpControlContainer->AddControl(pControl);
-
- pNode = mpControlContainer->GetControl(1);
- FocusManager::Instance().RegisterDownLink(this, pNode->GetWindow());
- FocusManager::Instance().RegisterUpLink(pNode->GetWindow(), this);
- }
- }
-
- return pNode;
+ return mpControlContainer->GetControl(1);
}
-const TreeNode* TitledControl::GetConstControl (bool bCreate) const
+const TreeNode* TitledControl::GetConstControl () const
{
- return const_cast<TitledControl*>(this)->GetControl(bCreate);
+ return const_cast<TitledControl*>(this)->GetControl();
}
diff --git a/sd/source/ui/toolpanel/ToolPanel.cxx b/sd/source/ui/toolpanel/ToolPanel.cxx
deleted file mode 100644
index 89ab9397d4ee..000000000000
--- a/sd/source/ui/toolpanel/ToolPanel.cxx
+++ /dev/null
@@ -1,289 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sd.hxx"
-
-#include "taskpane/ToolPanel.hxx"
-
-#include "TaskPaneFocusManager.hxx"
-#include "taskpane/TitleBar.hxx"
-#include "taskpane/TitledControl.hxx"
-#include "taskpane/ControlContainer.hxx"
-#include "TaskPaneViewShell.hxx"
-#include "taskpane/TaskPaneControlFactory.hxx"
-#include "AccessibleTaskPane.hxx"
-
-#include "strings.hrc"
-#include "sdresid.hxx"
-#include <vcl/decoview.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/svapp.hxx>
-
-namespace sd { namespace toolpanel {
-
-
-/** Use WB_DIALOGCONTROL as argument for the Control constructor to
- let VCL handle focus traveling. In addition the control
- descriptors have to use WB_TABSTOP.
-*/
-ToolPanel::ToolPanel (
- Window* pParentWindow,
- TaskPaneViewShell& rViewShell)
- : Control (pParentWindow, WB_DIALOGCONTROL),
- TreeNode (NULL),
- mrViewShell(rViewShell),
- mbRearrangeActive(false)
-{
- SetBackground (Wallpaper ());
-}
-
-
-
-
-ToolPanel::~ToolPanel (void)
-{
-}
-
-
-
-
-sal_uInt32 ToolPanel::AddControl (
- ::std::auto_ptr<ControlFactory> pControlFactory,
- const String& rTitle,
- ULONG nHelpId,
- const TitledControl::ClickHandler& rClickHandler)
-{
- TitledControl* pTitledControl = new TitledControl (
- this,
- pControlFactory,
- rTitle,
- rClickHandler,
- TitleBar::TBT_CONTROL_TITLE);
- ::std::auto_ptr<TreeNode> pChild (pTitledControl);
-
- // Get the (grand) parent window which is focus-wise our parent.
- Window* pParent = GetParent();
- if (pParent != NULL)
- pParent = pParent->GetParent();
-
- FocusManager& rFocusManager (FocusManager::Instance());
- int nControlCount (mpControlContainer->GetControlCount());
-
- // Add a link up from every control to the parent. A down link is added
- // only for the first control so that when entering the sub tool panel
- // the focus is set to the first control.
- if (pParent != NULL)
- {
- if (nControlCount == 1)
- rFocusManager.RegisterDownLink(pParent, pChild->GetWindow());
- rFocusManager.RegisterUpLink(pChild->GetWindow(), pParent);
- }
-
- // Replace the old links for cycling between first and last child by
- // current ones.
- if (nControlCount > 0)
- {
- ::Window* pFirst = mpControlContainer->GetControl(0)->GetWindow();
- ::Window* pLast = mpControlContainer->GetControl(nControlCount-1)->GetWindow();
- rFocusManager.RemoveLinks(pFirst,pLast);
- rFocusManager.RemoveLinks(pLast,pFirst);
-
- rFocusManager.RegisterLink(pFirst,pChild->GetWindow(), KEY_UP);
- rFocusManager.RegisterLink(pChild->GetWindow(),pFirst, KEY_DOWN);
- }
-
- pTitledControl->GetWindow()->SetHelpId(nHelpId);
-
- return mpControlContainer->AddControl (pChild);
-}
-
-
-
-
-void ToolPanel::ListHasChanged (void)
-{
- mpControlContainer->ListHasChanged ();
- Rearrange ();
-}
-
-
-
-
-void ToolPanel::Resize (void)
-{
- Control::Resize();
- Rearrange ();
-}
-
-
-
-
-void ToolPanel::RequestResize (void)
-{
- Invalidate();
- Rearrange ();
-}
-
-
-
-
-/** Subtract the space for the title bars from the available space and
- give the remaining space to the active control.
-*/
-void ToolPanel::Rearrange (void)
-{
- // Prevent recursive calls.
- if ( ! mbRearrangeActive && mpControlContainer->GetVisibleControlCount()>0)
- {
- mbRearrangeActive = true;
-
- SetBackground (Wallpaper ());
-
- // Make the area that is covered by the children a little bit
- // smaller so that a frame is visible arround them.
- Rectangle aAvailableArea (Point(0,0), GetOutputSizePixel());
-
- int nWidth = aAvailableArea.GetWidth();
- sal_uInt32 nControlCount (mpControlContainer->GetControlCount());
- sal_uInt32 nActiveControlIndex (
- mpControlContainer->GetActiveControlIndex());
-
- // Place title bars of controls above the active control and thereby
- // determine the top of the active control.
- sal_uInt32 nIndex;
- for (nIndex=mpControlContainer->GetFirstIndex();
- nIndex<nActiveControlIndex;
- nIndex=mpControlContainer->GetNextIndex(nIndex))
- {
- TreeNode* pChild = mpControlContainer->GetControl(nIndex);
- if (pChild != NULL)
- {
- sal_uInt32 nHeight = pChild->GetPreferredHeight (nWidth);
- pChild->GetWindow()->SetPosSizePixel (
- aAvailableArea.TopLeft(),
- Size(nWidth, nHeight));
- aAvailableArea.Top() += nHeight;
- }
- }
-
- // Place title bars of controls below the active control and thereby
- // determine the bottom of the active control.
- for (nIndex=mpControlContainer->GetLastIndex();
- nIndex<nControlCount && nIndex!=nActiveControlIndex;
- nIndex=mpControlContainer->GetPreviousIndex(nIndex))
- {
- TreeNode* pChild = mpControlContainer->GetControl(nIndex);
- if (pChild != NULL)
- {
- sal_uInt32 nHeight = pChild->GetPreferredHeight (nWidth);
- pChild->GetWindow()->SetPosSizePixel (
- Point(aAvailableArea.Left(),
- aAvailableArea.Bottom()-nHeight+1),
- Size(nWidth, nHeight));
- aAvailableArea.Bottom() -= nHeight;
- }
- }
-
- // Finally place the active control.
- TreeNode* pChild = mpControlContainer->GetControl(nActiveControlIndex);
- if (pChild != NULL)
- pChild->GetWindow()->SetPosSizePixel (
- aAvailableArea.TopLeft(),
- aAvailableArea.GetSize());
-
- mbRearrangeActive = false;
- }
- else
- SetBackground (
- Application::GetSettings().GetStyleSettings().GetDialogColor());
-}
-
-
-
-
-Size ToolPanel::GetPreferredSize (void)
-{
- return Size(300,300);
-}
-
-
-
-
-sal_Int32 ToolPanel::GetPreferredWidth (sal_Int32 )
-{
- return 300;
-}
-
-
-
-
-sal_Int32 ToolPanel::GetPreferredHeight (sal_Int32 )
-{
- return 300;
-}
-
-
-
-
-bool ToolPanel::IsResizable (void)
-{
- return true;
-}
-
-
-
-
-::Window* ToolPanel::GetWindow (void)
-{
- return this;
-}
-
-
-
-
-TaskPaneShellManager* ToolPanel::GetShellManager (void)
-{
- return &mrViewShell.GetSubShellManager();
-}
-
-
-
-
-::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible> ToolPanel::CreateAccessibleObject (
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::accessibility::XAccessible>& rxParent)
-{
- return new ::accessibility::AccessibleTaskPane (
- rxParent,
- String(SdResId(STR_RIGHT_PANE_TITLE)),
- String(SdResId(STR_RIGHT_PANE_TITLE)),
- *this);
-}
-
-} } // end of namespace ::sd::toolpanel
diff --git a/sd/source/ui/toolpanel/ToolPanelChildWindow.cxx b/sd/source/ui/toolpanel/ToolPanelChildWindow.cxx
deleted file mode 100644
index 1db383091bff..000000000000
--- a/sd/source/ui/toolpanel/ToolPanelChildWindow.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sd.hxx"
-
-#include "ToolPanelChildWindow.hxx"
-#include "ToolPanelDockingWindow.hxx"
-
-#include "sdresid.hxx"
-#include "app.hrc"
-#include "sfx2/app.hxx"
-
-
-namespace sd { namespace toolpanel {
-
-
-
-ToolPanelChildWindow::ToolPanelChildWindow (
- ::Window* pParentWindow,
- USHORT nId,
- SfxBindings* pBindings,
- SfxChildWinInfo* pInfo)
- : SfxChildWindow (pParentWindow, nId)
-{
- pWindow = new ToolPanelDockingWindow (pBindings, this, pParentWindow);
- eChildAlignment = SFX_ALIGN_RIGHT;
- static_cast<SfxDockingWindow*>(pWindow)->Initialize (pInfo);
- // SetHideNotDelete (TRUE);
-};
-
-
-
-
-ToolPanelChildWindow::~ToolPanelChildWindow()
-{}
-
-
-SFX_IMPL_DOCKINGWINDOW(ToolPanelChildWindow, SID_TOOLPANEL)
-
-
-
-
-} } // end of namespace ::sd::toolpanel
diff --git a/sd/source/ui/toolpanel/ToolPanelChildWindow.src b/sd/source/ui/toolpanel/ToolPanelChildWindow.src
deleted file mode 100644
index 079f9608f616..000000000000
--- a/sd/source/ui/toolpanel/ToolPanelChildWindow.src
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * 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.
- *
- * 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).
- *
- * 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.
- *
- ************************************************************************/
-
-#include "app.hrc"
-#include "ToolPanelChildWindow.hrc"
-
-DockingWindow FLT_WIN_TOOLPANEL
-{
- HelpID = SID_TOOLPANEL ;
- Border = TRUE ;
- Hide = FALSE ;
- SVLook = TRUE ;
- Sizeable = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- Zoomable = TRUE ;
- Dockable = TRUE ;
- EnableResizing = TRUE ;
- Size = MAP_APPFONT ( 140 , 120 ) ;
- Text = "Tool Panel" ;
-
- Control TOOLPANEL
- {
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 69, 150 ) ;
- Border = FALSE;
- };
-};
diff --git a/sd/source/ui/toolpanel/ToolPanelDeck.cxx b/sd/source/ui/toolpanel/ToolPanelDeck.cxx
new file mode 100755
index 000000000000..a6fc04ded305
--- /dev/null
+++ b/sd/source/ui/toolpanel/ToolPanelDeck.cxx
@@ -0,0 +1,160 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "ToolPanelDeck.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
+#include "ToolPanelDrawer.hxx"
+#include "taskpane/ControlContainer.hxx"
+#include "framework/FrameworkHelper.hxx"
+#include "TaskPaneToolPanel.hxx"
+#include "strings.hrc"
+#include "sdresid.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
+/** === end UNO includes === **/
+
+#include <svtools/toolpanel/tablayouter.hxx>
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::drawing::framework::XResourceId;
+ using ::com::sun::star::drawing::framework::ResourceActivationMode_REPLACE;
+ /** === end UNO using === **/
+ using ::sd::framework::FrameworkHelper;
+
+ //==================================================================================================================
+ //= ToolPanelDeck
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ToolPanelDeck::ToolPanelDeck( Window& i_rParent, ToolPanelViewShell& i_rViewShell )
+ :ToolPanelDeck_Base( i_rParent, WB_DIALOGCONTROL )
+ ,m_rViewShell( i_rViewShell )
+ {
+ SetDrawersLayout();
+
+ const String sPaneTitle( SdResId( STR_RIGHT_PANE_TITLE ) );
+ SetAccessibleName( sPaneTitle );
+ SetAccessibleDescription( sPaneTitle );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ToolPanelDeck::~ToolPanelDeck()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDeck::SetDrawersLayout()
+ {
+ const ::svt::PDeckLayouter pLayouter( GetLayouter() );
+ const ToolPanelDrawer* pDrawerLayouter = dynamic_cast< const ToolPanelDrawer* >( pLayouter.get() );
+ if ( pDrawerLayouter != NULL )
+ // already have the proper layout
+ return;
+ SetLayouter( new ToolPanelDrawer( *this, *this ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDeck::SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent )
+ {
+ ::svt::PDeckLayouter pLayouter( GetLayouter() );
+ ::svt::TabDeckLayouter* pTabLayouter = dynamic_cast< ::svt::TabDeckLayouter* >( pLayouter.get() );
+ if ( ( pTabLayouter != NULL )
+ && ( pTabLayouter->GetTabAlignment() == i_eTabAlignment )
+ && ( pTabLayouter->GetTabItemContent() == i_eTabContent )
+ )
+ // already have the requested layout
+ return;
+
+ if ( pTabLayouter && ( pTabLayouter->GetTabAlignment() == i_eTabAlignment ) )
+ {
+ // changing only the item content does not require a new layouter instance
+ pTabLayouter->SetTabItemContent( i_eTabContent );
+ return;
+ }
+
+ SetLayouter( new ::svt::TabDeckLayouter( *this, *this, i_eTabAlignment, i_eTabContent ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDeck::ActivatePanelDirectly( const ::boost::optional< size_t >& i_rPanel )
+ {
+ ToolPanelDeck_Base::ActivatePanel( i_rPanel );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDeck::ActivatePanelResource( const size_t i_nPanel )
+ {
+ // determine resource ID for the given panel
+ ::svt::PToolPanel pPanel( GetPanel( i_nPanel ) );
+ const TaskPaneToolPanel* pTaskPanePanel( dynamic_cast< const TaskPaneToolPanel* >( pPanel.get() ) );
+ ENSURE_OR_RETURN_VOID( pTaskPanePanel, "did not find the right panel/type at the given position" );
+ const Reference< XResourceId > xPanelId( pTaskPanePanel->getResourceId() );
+
+ // delegate the request to the configuration controller
+ ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( m_rViewShell.GetViewShellBase() ) );
+ pFrameworkHelper->GetConfigurationController()->requestResourceActivation(
+ xPanelId, ResourceActivationMode_REPLACE );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDeck::ActivatePanel( const ::boost::optional< size_t >& i_rPanel )
+ {
+ if ( !i_rPanel )
+ {
+ // this is a de-activate request. Quite improbable that this really happens: We're within the overloaded
+ // version of IToolPanelDeck::ActivatePanel. The only instance which has access to this IToolPanel
+ // interface is the panel layouter, which is not expected to call us with a NULL panel position.
+ // All other instances should not have access to this method, as it is protected in this class here.
+ OSL_ENSURE( false, "ToolPanelDeck::ActivatePanel: is this legitimate?" );
+ // well, handle it nonetheless.
+ ActivatePanelDirectly( i_rPanel );
+ }
+ else
+ ActivatePanelResource( *i_rPanel );
+ }
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
diff --git a/sd/source/ui/toolpanel/ToolPanelDeck.hxx b/sd/source/ui/toolpanel/ToolPanelDeck.hxx
new file mode 100644
index 000000000000..e140d9577220
--- /dev/null
+++ b/sd/source/ui/toolpanel/ToolPanelDeck.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_TOOLPANELDECK_HXX
+#define SD_TOOLPANELDECK_HXX
+
+#include "taskpane/TaskPaneTreeNode.hxx"
+#include "taskpane/TaskPaneControlFactory.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/XResourceId.hpp>
+/** === end UNO includes === **/
+
+#include <svtools/toolpanel/toolpaneldeck.hxx>
+#include <svtools/toolpanel/tabalignment.hxx>
+#include <svtools/toolpanel/tabitemcontent.hxx>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ class ToolPanelViewShell;
+
+ //==================================================================================================================
+ //= ToolPanelDeck
+ //==================================================================================================================
+ typedef ::svt::ToolPanelDeck ToolPanelDeck_Base;
+ class ToolPanelDeck : public ToolPanelDeck_Base
+ {
+ public:
+ ToolPanelDeck(
+ ::Window& i_rParent,
+ ToolPanelViewShell& i_rViewShell
+ );
+ ~ToolPanelDeck();
+
+ /** activates a layout where the active panel is selected via tabs at the right/left/top/bottom (depending on
+ the given TabAlignment value).
+ */
+ void SetTabsLayout( const ::svt::TabAlignment i_eTabAlignment, const ::svt::TabItemContent i_eTabContent );
+
+ /** activates the "classical" layout with the panels being represneted by stacked drawers
+ */
+ void SetDrawersLayout();
+
+ /** directly activates the given panel, without re-routing the activation request through the drawing
+ framework's configuration controller.
+ */
+ void ActivatePanelDirectly( const ::boost::optional< size_t >& i_rPanel );
+
+ /** activates the given panel by delegating the acvtivation request to the drawing framework's configuration
+ controller.
+ */
+ void ActivatePanelResource( const size_t i_nPanel );
+
+ protected:
+ // IToolPanelDeck
+ /** this method, which is part of the callback used by the PanelSelector, does not forward the request to
+ the base class. Instead, it forwards it to the ToolPanelViewShell, which transforms it into a request
+ to the drawing framework's configuration controller, which in turn will end up in our public
+ ActivatePanelDirectly method.
+ */
+ virtual void ActivatePanel( const ::boost::optional< size_t >& i_rPanel );
+
+ private:
+ ToolPanelViewShell& m_rViewShell;
+ };
+
+//......................................................................................................................
+} } // sd::toolpanel
+//......................................................................................................................
+
+#endif // SD_TOOLPANELDECK_HXX
diff --git a/sd/source/ui/toolpanel/ToolPanelDrawer.cxx b/sd/source/ui/toolpanel/ToolPanelDrawer.cxx
new file mode 100755
index 000000000000..86406fdff5b4
--- /dev/null
+++ b/sd/source/ui/toolpanel/ToolPanelDrawer.cxx
@@ -0,0 +1,282 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "ToolPanelDrawer.hxx"
+#include "taskpane/TitleBar.hxx"
+
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::accessibility::XAccessible;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= ToolPanelDrawer
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ToolPanelDrawer::ToolPanelDrawer( ::Window& i_rParentWindow, ::svt::IToolPanelDeck& i_rPanels )
+ :m_rParentWindow( i_rParentWindow )
+ ,m_rPanelDeck( i_rPanels )
+ ,m_aDrawers()
+ ,m_aLastKnownActivePanel()
+ {
+ m_rPanelDeck.AddListener( *this );
+
+ // simulate PanelInserted events for the panels which are already there
+ for ( size_t i=0; i<m_rPanelDeck.GetPanelCount(); ++i )
+ PanelInserted( m_rPanelDeck.GetPanel( i ), i );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ToolPanelDrawer::~ToolPanelDrawer()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPLEMENT_IREFERENCE( ToolPanelDrawer )
+
+ //------------------------------------------------------------------------------------------------------------------
+ Rectangle ToolPanelDrawer::Layout( const Rectangle& i_rDeckPlayground )
+ {
+ const size_t nPanelCount( m_rPanelDeck.GetPanelCount() );
+ if ( nPanelCount == 0 )
+ return i_rDeckPlayground;
+
+ const int nWidth( i_rDeckPlayground.GetWidth() );
+ ::boost::optional< size_t > aActivePanel( m_rPanelDeck.GetActivePanel() );
+ if ( !aActivePanel )
+ aActivePanel = m_aLastKnownActivePanel;
+
+ // arrange the title bars which are *above* the active panel (or *all* if there is no active panel), plus
+ // the title bar of the active panel itself
+ Point aUpperDrawerPos( i_rDeckPlayground.TopLeft() );
+ const size_t nUpperBound = !!aActivePanel ? *aActivePanel : nPanelCount - 1;
+ for ( size_t i=0; i<=nUpperBound; ++i )
+ {
+ sal_uInt32 nDrawerHeight = m_aDrawers[i]->GetPreferredHeight( nWidth );
+ m_aDrawers[i]->GetWindow()->SetPosSizePixel(
+ aUpperDrawerPos, Size( nWidth, nDrawerHeight ) );
+ aUpperDrawerPos.Move( 0, nDrawerHeight );
+ }
+
+ // arrange title bars which are below the active panel (or *none* if there is no active panel)
+ Point aLowerDrawerPos( i_rDeckPlayground.BottomLeft() );
+ for ( size_t j = nPanelCount - 1; j > nUpperBound; --j )
+ {
+ sal_uInt32 nDrawerHeight = m_aDrawers[j]->GetPreferredHeight( nWidth );
+ m_aDrawers[j]->GetWindow()->SetPosSizePixel(
+ Point( aLowerDrawerPos.X(), aLowerDrawerPos.Y() - nDrawerHeight + 1 ),
+ Size( nWidth, nDrawerHeight )
+ );
+ aLowerDrawerPos.Move( 0, -nDrawerHeight );
+ }
+
+ // fincally calculate the rectangle for the active panel
+ return Rectangle(
+ aUpperDrawerPos,
+ Size( nWidth, aLowerDrawerPos.Y() - aUpperDrawerPos.Y() + 1 )
+ );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::Destroy()
+ {
+ while ( !m_aDrawers.empty() )
+ impl_removeTitleBar( 0 );
+ m_rPanelDeck.RemoveListener( *this );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::SetFocusToPanelSelector()
+ {
+ const size_t nPanelCount( m_rPanelDeck.GetPanelCount() );
+ if ( !nPanelCount )
+ // nothing to focus
+ return;
+ ::boost::optional< size_t > aActivePanel( m_rPanelDeck.GetActivePanel() );
+ if ( !aActivePanel )
+ aActivePanel = 0;
+ ENSURE_OR_RETURN_VOID( *aActivePanel < m_aDrawers.size(), "ToolPanelDrawer::SetFocusToPanelSelector: invalid active panel, or inconsistent drawers!" );
+ m_aDrawers[ *aActivePanel ]->GetWindow()->GrabFocus();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ size_t ToolPanelDrawer::GetAccessibleChildCount() const
+ {
+ return m_aDrawers.size();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XAccessible > ToolPanelDrawer::GetAccessibleChild( const size_t i_nChildIndex, const Reference< XAccessible >& i_rParentAccessible )
+ {
+ ENSURE_OR_RETURN( i_nChildIndex < m_aDrawers.size(), "illegal index", NULL );
+
+ const PTitleBar pTitleBar( m_aDrawers[ i_nChildIndex ] );
+ Window* pItemWindow( pTitleBar->GetWindow() );
+
+ Reference< XAccessible > xItemAccessible( pItemWindow->GetAccessible( FALSE ) );
+ if ( !xItemAccessible.is() )
+ {
+ xItemAccessible = pTitleBar->CreateAccessibleObject( i_rParentAccessible );
+ OSL_ENSURE( xItemAccessible.is(), "ToolPanelDrawer::GetAccessibleChild: invalid XAccessible returned by CreateAccessibleObject!" );
+ pItemWindow->SetAccessible( xItemAccessible );
+ }
+
+ return xItemAccessible;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition )
+ {
+ OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "ToolPanelDrawer::PanelInserted: inconsistency!" );
+
+ ::boost::shared_ptr< TitleBar > pTitleBar( new TitleBar( &m_rParentWindow, i_pPanel->GetDisplayName(), TitleBar::TBT_CONTROL_TITLE, true ) );
+ pTitleBar->GetWindow()->Show();
+ pTitleBar->GetWindow()->AddEventListener( LINK( this, ToolPanelDrawer, OnWindowEvent ) );
+ m_aDrawers.insert( m_aDrawers.begin() + i_nPosition, pTitleBar );
+ impl_triggerRearrange();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::PanelRemoved( const size_t i_nPosition )
+ {
+ impl_removeTitleBar( i_nPosition );
+ impl_triggerRearrange();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::impl_triggerRearrange() const
+ {
+ // this is somewhat hacky, it assumes that the parent of our panels is a tool panel deck, which, in its
+ // Resize implementation, rearrances all elements.
+ m_rParentWindow.Resize();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive )
+ {
+ if ( !!i_rOldActive )
+ {
+ OSL_ENSURE( *i_rOldActive < m_aDrawers.size(), "ToolPanelDrawer::ActivePanelChanged: illegal old index!" );
+ m_aDrawers[ *i_rOldActive ]->Expand( false );
+ }
+
+ if ( !!i_rNewActive )
+ {
+ OSL_ENSURE( *i_rNewActive < m_aDrawers.size(), "ToolPanelDrawer::ActivePanelChanged: illegal new index!" );
+ m_aDrawers[ *i_rNewActive ]->Expand( true );
+ }
+
+ impl_triggerRearrange();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter )
+ {
+ // not interested in
+ (void)i_rNewLayouter;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ size_t ToolPanelDrawer::impl_getPanelPositionFromWindow( const Window* i_pTitleBarWindow ) const
+ {
+ for ( ::std::vector< PTitleBar >::const_iterator drawerPos = m_aDrawers.begin();
+ drawerPos != m_aDrawers.end();
+ ++drawerPos
+ )
+ {
+ if ( (*drawerPos)->GetWindow() == i_pTitleBarWindow )
+ return drawerPos - m_aDrawers.begin();
+ }
+ return m_aDrawers.size();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::impl_removeTitleBar( const size_t i_nPosition )
+ {
+ OSL_PRECOND( i_nPosition < m_aDrawers.size(), "ToolPanelDrawer::impl_removeTitleBar: invalid panel position!" );
+ m_aDrawers[ i_nPosition ]->GetWindow()->RemoveEventListener( LINK( this, ToolPanelDrawer, OnWindowEvent ) );
+ OSL_ENSURE( m_aDrawers[ i_nPosition ].unique(), "ToolPanelDrawer::impl_removeTitleBar: somebody else is still holding a reference!" );
+ m_aDrawers.erase( m_aDrawers.begin() + i_nPosition );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( ToolPanelDrawer, OnWindowEvent, VclSimpleEvent*, i_pEvent )
+ {
+ const VclWindowEvent* pWindowEvent = PTR_CAST( VclWindowEvent, i_pEvent );
+ ENSURE_OR_RETURN( pWindowEvent, "no WindowEvent", 0L );
+
+ bool bActivatePanel = false;
+ switch ( pWindowEvent->GetId() )
+ {
+ case VCLEVENT_WINDOW_MOUSEBUTTONUP:
+ {
+ const MouseEvent* pMouseEvent = static_cast< const MouseEvent* >( pWindowEvent->GetData() );
+ ENSURE_OR_RETURN( pMouseEvent, "no mouse event with MouseButtonUp", 0L );
+ if ( pMouseEvent->GetButtons() == MOUSE_LEFT )
+ {
+ bActivatePanel = true;
+ }
+ }
+ break;
+ case VCLEVENT_WINDOW_KEYINPUT:
+ {
+ const KeyEvent* pKeyEvent = static_cast< const KeyEvent* >( pWindowEvent->GetData() );
+ ENSURE_OR_RETURN( pKeyEvent, "no key event with KeyInput", 0L );
+ const KeyCode& rKeyCode( pKeyEvent->GetKeyCode() );
+ if ( ( rKeyCode.GetModifier() == 0 ) && ( rKeyCode.GetCode() == KEY_RETURN ) )
+ {
+ bActivatePanel = true;
+ }
+ }
+ break;
+ }
+ if ( bActivatePanel )
+ {
+ const size_t nPanelPos = impl_getPanelPositionFromWindow( pWindowEvent->GetWindow() );
+ m_rPanelDeck.ActivatePanel( nPanelPos );
+ return 1L;
+ }
+ return 0L;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ToolPanelDrawer::Dying()
+ {
+ Destroy();
+ }
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
diff --git a/sd/source/ui/toolpanel/ToolPanelDrawer.hxx b/sd/source/ui/toolpanel/ToolPanelDrawer.hxx
new file mode 100755
index 000000000000..0d850ab1d7a2
--- /dev/null
+++ b/sd/source/ui/toolpanel/ToolPanelDrawer.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_TOOLPANEL_TOOLPANELDRAWER_HXX
+#define SD_TOOLPANEL_TOOLPANELDRAWER_HXX
+
+#include <svtools/toolpanel/refbase.hxx>
+#include <svtools/toolpanel/toolpaneldeck.hxx>
+#include <svtools/toolpanel/decklayouter.hxx>
+
+#include <boost/shared_ptr.hpp>
+
+//......................................................................................................................
+namespace sd { namespace toolpanel
+{
+//......................................................................................................................
+
+ class ToolPanelViewShell;
+ class TitleBar;
+ typedef ::boost::shared_ptr< TitleBar > PTitleBar;
+
+ //==================================================================================================================
+ //= ToolPanelDrawer
+ //==================================================================================================================
+ /** a class which implements a tool panel selector in the form of the classical drawers
+ */
+ class ToolPanelDrawer :public ::svt::RefBase
+ ,public ::svt::IDeckLayouter
+ ,public ::svt::IToolPanelDeckListener
+ {
+ public:
+ ToolPanelDrawer(
+ ::Window& i_rParentWindow,
+ ::svt::IToolPanelDeck& i_rPanels
+ );
+ ~ToolPanelDrawer();
+
+ // IReference
+ DECLARE_IREFERENCE()
+
+ // IDeckLayouter
+ virtual Rectangle Layout( const Rectangle& i_rDeckPlayground );
+ virtual void Destroy();
+ virtual void SetFocusToPanelSelector();
+ virtual size_t GetAccessibleChildCount() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
+ GetAccessibleChild(
+ const size_t i_nChildIndex,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
+ );
+
+ // IToolPanelDeckListener
+ virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual void PanelRemoved( const size_t i_nPosition );
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter );
+ virtual void Dying();
+
+ private:
+ // triggers a re-arrance of the panel deck elements
+ void impl_triggerRearrange() const;
+ size_t impl_getPanelPositionFromWindow( const Window* i_pTitleBarWindow ) const;
+ void impl_removeTitleBar( const size_t i_nPosition );
+
+ DECL_LINK( OnWindowEvent, VclSimpleEvent* );
+
+private:
+ Window& m_rParentWindow;
+ ::svt::IToolPanelDeck& m_rPanelDeck;
+ ::std::vector< PTitleBar > m_aDrawers;
+ ::boost::optional< size_t > m_aLastKnownActivePanel;
+ };
+
+//......................................................................................................................
+} } // namespace sd::toolpanel
+//......................................................................................................................
+
+#endif // SD_TOOLPANEL_TOOLPANELDRAWER_HXX
diff --git a/sd/source/ui/toolpanel/ToolPanelViewShell.cxx b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
new file mode 100755
index 000000000000..a4c060efc559
--- /dev/null
+++ b/sd/source/ui/toolpanel/ToolPanelViewShell.cxx
@@ -0,0 +1,1271 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"
+
+#include "taskpane/ToolPanelViewShell.hxx"
+
+#include "TaskPaneShellManager.hxx"
+#include "TaskPaneFocusManager.hxx"
+#include "StandardToolPanel.hxx"
+#include "CustomToolPanel.hxx"
+#include "controls/MasterPagesPanel.hxx"
+#include "LayoutMenu.hxx"
+#include "controls/TableDesignPanel.hxx"
+#include "controls/CustomAnimationPanel.hxx"
+#include "controls/SlideTransitionPanel.hxx"
+#include "controls/MasterPagesSelector.hxx"
+#include "PaneDockingWindow.hxx"
+#include "FrameView.hxx"
+#include "Window.hxx"
+#include "ToolPanelDeck.hxx"
+#include "sdmod.hxx"
+#include "app.hrc"
+#include "glob.hrc"
+#include "res_bmp.hrc"
+#include "helpids.h"
+#include "strings.hrc"
+#include "sdresid.hxx"
+#include "framework/FrameworkHelper.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/XResourceId.hpp>
+#include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
+#include <com/sun/star/drawing/framework/AnchorBindingMode.hpp>
+#include <com/sun/star/drawing/XDrawSubController.hpp>
+/** === end UNO includes === **/
+
+#include <svx/dlgctrl.hxx>
+#include <sfx2/imagemgr.hxx>
+#include <sfx2/bindings.hxx>
+#include <sfx2/dispatch.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/msg.hxx>
+#include <sfx2/objface.hxx>
+#include <svx/colrctrl.hxx>
+#include <svx/xtable.hxx>
+#include <vcl/dockwin.hxx>
+#include "sdtreelb.hxx"
+#include "DrawViewShell.hxx"
+#include "drawdoc.hxx"
+#include "ViewShellBase.hxx"
+#include <svx/ruler.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/toolbox.hxx>
+#include <tools/diagnose_ex.h>
+#include <unotools/confignode.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <vector>
+
+using namespace ::sd::toolpanel;
+
+#define ToolPanelViewShell
+#include "sdslots.hxx"
+
+/** === begin UNO using === **/
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::XInterface;
+using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::uno::UNO_SET_THROW;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::RuntimeException;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::uno::makeAny;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Type;
+using ::com::sun::star::accessibility::XAccessible;
+using ::com::sun::star::drawing::XDrawSubController;
+using ::com::sun::star::frame::XFrame;
+using ::com::sun::star::drawing::framework::XResourceId;
+using ::com::sun::star::drawing::framework::XConfigurationChangeListener;
+using ::com::sun::star::drawing::framework::ConfigurationChangeEvent;
+using ::com::sun::star::lang::EventObject;
+using ::com::sun::star::lang::DisposedException;
+using ::com::sun::star::drawing::framework::XConfigurationControllerBroadcaster;
+using ::com::sun::star::drawing::framework::XConfigurationController;
+using ::com::sun::star::drawing::framework::XConfiguration;
+using ::com::sun::star::drawing::framework::AnchorBindingMode_DIRECT;
+/** === end UNO using === **/
+
+using ::sd::framework::FrameworkHelper;
+
+namespace sd { namespace toolpanel {
+
+// =====================================================================================================================
+// = PanelDescriptor
+// =====================================================================================================================
+/** is a helper class for ToolPanelViewShell_Impl, holding the details about a single panel which is not
+ contained in the IToolPanel implementation itself.
+*/
+struct PanelDescriptor
+{
+ PanelId nId;
+ ::svt::PToolPanel pPanel;
+ bool bHidden;
+
+ PanelDescriptor()
+ :nId( PID_UNKNOWN )
+ ,pPanel()
+ ,bHidden( false )
+ {
+ }
+
+ PanelDescriptor( const PanelId i_nPanelId, const ::svt::PToolPanel& i_rPanel )
+ :nId( i_nPanelId )
+ ,pPanel( i_rPanel )
+ ,bHidden( false )
+ {
+ }
+};
+
+// =====================================================================================================================
+// = PanelSelectorLayout
+// =====================================================================================================================
+enum PanelSelectorLayout
+{
+ LAYOUT_DRAWERS,
+ LAYOUT_TABS_RIGHT,
+ LAYOUT_TABS_LEFT,
+ LAYOUT_TABS_TOP,
+ LAYOUT_TABS_BOTTOM
+};
+
+// =====================================================================================================================
+// = ConfigurationListener - declaration
+// =====================================================================================================================
+typedef ::cppu::WeakImplHelper1 < XConfigurationChangeListener
+ > ConfigurationListener_Base;
+
+class ConfigurationListener :public ::cppu::BaseMutex
+ ,public ConfigurationListener_Base
+{
+public:
+ ConfigurationListener( ToolPanelViewShell_Impl& i_rShellImpl );
+
+ // XConfigurationChangeListener
+ virtual void SAL_CALL notifyConfigurationChange( const ConfigurationChangeEvent& aEvent ) throw (RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const EventObject& Source ) throw (RuntimeException);
+
+ // XComponent equivalents (not available per UNO interface)
+ void dispose();
+
+protected:
+ ~ConfigurationListener();
+
+ void impl_checkDisposed_throw()
+ {
+ if ( !m_pShellImpl )
+ throw DisposedException( ::rtl::OUString(), *this );
+ }
+
+private:
+ ToolPanelViewShell_Impl* m_pShellImpl;
+};
+
+// =====================================================================================================================
+// = ToolPanelViewShell_Impl - declaration
+// =====================================================================================================================
+/** Inner implementation class of ToolPanelViewShell.
+*/
+class ToolPanelViewShell_Impl : public ::svt::IToolPanelDeckListener
+{
+public:
+ static const size_t mnInvalidId = static_cast< size_t >( -1 );
+
+ ToolPanelViewShell_Impl( ToolPanelViewShell& i_rPanelViewShell, ::Window& i_rPanelDeckParent );
+ ~ToolPanelViewShell_Impl();
+
+ ToolPanelViewShell& GetAntiImpl() { return m_rPanelViewShell; }
+
+ /** Here the panels are created that are shown in the task pane.
+ */
+ void Setup();
+
+ /** clean up the instance
+ */
+ void Cleanup();
+
+ /** sets the given layout for the panel selector
+ */
+ void SetLayout( const PanelSelectorLayout i_eLayout, const bool i_bForce = false );
+
+ /** returns the current layout
+ */
+ PanelSelectorLayout
+ GetLayout() const { return m_eCurrentLayout; }
+
+ /** called by our configuration controller listener when the request to activate a tool panel has been observed.
+ */
+ void OnToolPanelActivationRequest( const ::rtl::OUString& i_rResourceURL );
+
+ /** provides access to the the VCL window of the panel deck
+ */
+ ::Window& GetPanelDeck() { return *m_pPanelDeck.get(); }
+ const ::Window& GetPanelDeck() const { return *m_pPanelDeck.get(); }
+
+ ::Window* GetToolPanelParentWindow() { return m_pPanelDeck.get() ? &m_pPanelDeck->GetPanelWindowAnchor() : NULL; }
+
+ /** returns the logical number of panels. This is greater than or equal to the number of panels displayed in the
+ panel deck
+ */
+ size_t GetPanelCount() const
+ {
+ return m_aPanels.size();
+ }
+
+ const PanelDescriptor& GetPanel( const size_t i_nLogicalPanelIndex ) const
+ {
+ return m_aPanels[ i_nLogicalPanelIndex ];
+ }
+
+ void TogglePanelVisibility( const size_t i_nLogicalPanelIndex );
+
+ /** ensures the panel with the given ID is visible, and directly activates it, bypassing the configuration controller
+ */
+ void ActivatePanelDirectly( const PanelId i_nPanelId );
+
+ /** de-activates the panel given by ID, bypassing the configuration controller
+
+ If the panel is not active currently, nothing happens.
+ */
+ void DeactivatePanelDirectly( const PanelId i_nPanelId );
+
+ Reference< XAccessible >
+ CreateAccessible( ::sd::Window& i_rWindow );
+
+protected:
+ // IToolPanelDeckListener overridables
+ virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition );
+ virtual void PanelRemoved( const size_t i_nPosition );
+ virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive );
+ virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter );
+ virtual void Dying();
+
+private:
+ void RegisterPanel( size_t i_nPosition, PanelId i_nPanelId, const ::svt::PToolPanel& i_rPanel );
+ void UpdateDockingWindowTitle();
+
+ /** creates the built-in panels, returns the position of the panel to initially activate
+ */
+ struct PanelActivation
+ {
+ size_t nPanelPos;
+ bool bActivateAsResource;
+
+ PanelActivation()
+ :nPanelPos( size_t( -1 ) )
+ ,bActivateAsResource( true )
+ {
+ }
+ };
+ PanelActivation SetupDefaultPanels();
+
+ /** creates the custom panels
+ */
+ void SetupCustomPanels();
+
+ typedef ::std::vector< PanelDescriptor > PanelDescriptors;
+ PanelDescriptors m_aPanels;
+ ToolPanelViewShell& m_rPanelViewShell;
+ ::boost::scoped_ptr< ToolPanelDeck > m_pPanelDeck;
+ ::rtl::Reference< ConfigurationListener > m_pConfigListener;
+ PanelSelectorLayout m_eCurrentLayout;
+ bool m_bInitialized;
+};
+
+// =====================================================================================================================
+// = ConfigurationListener - implementation
+// =====================================================================================================================
+// ---------------------------------------------------------------------------------------------------------------------
+ConfigurationListener::ConfigurationListener( ToolPanelViewShell_Impl& i_rShellImpl )
+ :m_pShellImpl( &i_rShellImpl )
+{
+ ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( i_rShellImpl.GetAntiImpl().GetViewShellBase() ) );
+ Reference< XConfigurationControllerBroadcaster > xBroadcaster;
+ if ( pFrameworkHelper.get() )
+ xBroadcaster.set( pFrameworkHelper->GetConfigurationController().get() );
+ ENSURE_OR_THROW( pFrameworkHelper.get(), "no access to the config controller" );
+
+ osl_incrementInterlockedCount( &m_refCount );
+ {
+ xBroadcaster->addConfigurationChangeListener( this, ::rtl::OUString(), Any() );
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+ConfigurationListener::~ConfigurationListener()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ConfigurationListener::notifyConfigurationChange( const ConfigurationChangeEvent& i_rEvent ) throw (RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ impl_checkDisposed_throw();
+
+// if ( i_rEvent.Type == FrameworkHelper::msConfigurationUpdateStartEvent )
+// {
+// m_pShellImpl->GetPanelDeck().SetUpdateMode( FALSE );
+// return;
+// }
+// if ( i_rEvent.Type == FrameworkHelper::msConfigurationUpdateEndEvent )
+// {
+// m_pShellImpl->GetPanelDeck().SetUpdateMode( TRUE );
+// return;
+// }
+//
+ // is this an event we're interested in?
+ if ( i_rEvent.Type != FrameworkHelper::msResourceActivationEvent )
+ return;
+
+ // is this a resource we're interested in? Must be anchored in the task pane ...
+ Reference< XResourceId > xAnchorId;
+ if ( i_rEvent.ResourceId.is() )
+ xAnchorId = i_rEvent.ResourceId->getAnchor();
+ if ( !xAnchorId.is() )
+ return;
+ const ::rtl::OUString sAnchorURL( xAnchorId->getResourceURL() );
+ if ( sAnchorURL != FrameworkHelper::msTaskPaneURL )
+ return;
+
+ m_pShellImpl->OnToolPanelActivationRequest( i_rEvent.ResourceId->getResourceURL() );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void SAL_CALL ConfigurationListener::disposing( const EventObject& i_rEvent ) throw (RuntimeException)
+{
+ (void)i_rEvent;
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ impl_checkDisposed_throw();
+ }
+
+ dispose();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ConfigurationListener::dispose()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_pShellImpl = NULL;
+}
+
+// =====================================================================================================================
+// = helpers
+// =====================================================================================================================
+// ---------------------------------------------------------------------------------------------------------------------
+namespace {
+
+enum MenuId {
+ MID_UNLOCK_TASK_PANEL = 1,
+ MID_LOCK_TASK_PANEL = 2,
+ MID_LAYOUT_TABS = 3,
+ MID_LAYOUT_DRAWERS = 4,
+ MID_FIRST_PANEL = 5
+};
+
+} // end of anonymouse namespace
+
+// =====================================================================================================================
+// = ToolPanelViewShell
+// =====================================================================================================================
+// ---------------------------------------------------------------------------------------------------------------------
+SFX_IMPL_INTERFACE(ToolPanelViewShell, SfxShell, SdResId(STR_TASKPANEVIEWSHELL))
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+TYPEINIT1(ToolPanelViewShell, ViewShell);
+
+// ---------------------------------------------------------------------------------------------------------------------
+ToolPanelViewShell_Impl::PanelActivation ToolPanelViewShell_Impl::SetupDefaultPanels()
+{
+ typedef std::auto_ptr<ControlFactory> (*ControlFactoryFactory)( ToolPanelViewShell& i_rToolPanelShell );
+
+ struct PanelDescriptor
+ {
+ ControlFactoryFactory pFactory;
+ const sal_Char* pImageCommandName;
+ USHORT nTitleResourceID;
+ ULONG nHelpID;
+ PanelId nPanelID;
+ ::rtl::OUString sResourceURL;
+ };
+
+ PanelDescriptor aPanels[] =
+ {
+ // "Master Pages"
+ { &controls::MasterPagesPanel::CreateControlFactory,
+ "PresentationLayout",
+ STR_TASKPANEL_MASTER_PAGE_TITLE,
+ HID_SD_SLIDE_DESIGNS,
+ PID_MASTER_PAGES,
+ FrameworkHelper::msMasterPagesTaskPanelURL
+ },
+ // "Layout"
+ { &LayoutMenu::CreateControlFactory,
+ "ModifyPage",
+ STR_TASKPANEL_LAYOUT_MENU_TITLE,
+ HID_SD_SLIDE_LAYOUTS,
+ PID_LAYOUT,
+ FrameworkHelper::msLayoutTaskPanelURL
+ },
+ // "Tables Design"
+ { &controls::TableDesignPanel::CreateControlFactory,
+ "InsertTable",
+ DLG_TABLEDESIGNPANE,
+ HID_SD_TABLE_DESIGN,
+ PID_TABLE_DESIGN,
+ FrameworkHelper::msTableDesignPanelURL
+ },
+ // "Custom Animation"
+ { &controls::CustomAnimationPanel::CreateControlFactory,
+ "CustomAnimation",
+ STR_CUSTOMANIMATIONPANE,
+ HID_SD_CUSTOM_ANIMATIONS,
+ PID_CUSTOM_ANIMATION,
+ FrameworkHelper::msCustomAnimationTaskPanelURL
+ },
+ // "Slide Transition"
+ { &controls::SlideTransitionPanel::CreateControlFactory,
+ "RehearseTimings",
+ STR_SLIDE_TRANSITION_PANE,
+ HID_SD_SLIDE_TRANSITIONS,
+ PID_SLIDE_TRANSITION,
+ FrameworkHelper::msSlideTransitionTaskPanelURL
+ }
+ };
+
+ // compose the resource ID for the ToolPanel view
+ ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( m_rPanelViewShell.GetViewShellBase() ) );
+ const Reference< XResourceId > xToolPanelId( pFrameworkHelper->CreateResourceId( FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL ) );
+
+ // determine which panel should be activated initially.
+ // Default to PID_LAYOUT, but check whether the requested configuration already contains a tool panel, in this case,
+ // use that one.
+ PanelId nPanelToActivate = PID_LAYOUT;
+ PanelActivation aPanelToActivate;
+ try
+ {
+ Reference< XConfigurationController > xCC( pFrameworkHelper->GetConfigurationController(), UNO_QUERY_THROW );
+ Reference< XConfiguration > xConfiguration( xCC->getRequestedConfiguration(), UNO_QUERY_THROW );
+ Sequence< Reference< XResourceId > > aViewIds( xConfiguration->getResources(
+ FrameworkHelper::CreateResourceId( FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL ),
+ FrameworkHelper::msTaskPanelURLPrefix, AnchorBindingMode_DIRECT ) );
+
+ if ( aViewIds.getLength() > 0 )
+ {
+ const ::rtl::OUString sResourceURL( aViewIds[0]->getResourceURL() );
+ PanelId nRequestedPanel = GetStandardPanelId( sResourceURL );
+ if ( nRequestedPanel != PID_UNKNOWN )
+ {
+ nPanelToActivate = nRequestedPanel;
+ aPanelToActivate.bActivateAsResource = false;
+ }
+ }
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+
+ // create the panels
+ Reference< XFrame > xFrame( m_rPanelViewShell.GetViewShellBase().GetViewFrame()->GetFrame()->GetFrameInterface() );
+ const BOOL bHiContrast( m_pPanelDeck->GetSettings().GetStyleSettings().GetHighContrastMode() );
+ for ( size_t i=0; i < sizeof( aPanels ) / sizeof( aPanels[0] ); ++i )
+ {
+ // compose the command name, and obtain the image for it
+ ::rtl::OUStringBuffer aCommandName;
+ aCommandName.appendAscii( ".uno:" );
+ aCommandName.appendAscii( aPanels[i].pImageCommandName );
+ const Image aPanelImage( GetImage( xFrame, aCommandName.makeStringAndClear(), FALSE, bHiContrast ) );
+
+ // compose the resource ID of the panel
+ const Reference< XResourceId > xPanelId( pFrameworkHelper->CreateResourceId( aPanels[i].sResourceURL, xToolPanelId ) );
+
+ // create and insert the panel
+ ::std::auto_ptr< ControlFactory > pControlFactory( (*aPanels[i].pFactory)( m_rPanelViewShell ) );
+ ::svt::PToolPanel pNewPanel( new StandardToolPanel(
+ *m_pPanelDeck,
+ pControlFactory,
+ aPanels[i].nTitleResourceID,
+ aPanelImage,
+ aPanels[i].nHelpID,
+ xPanelId
+ ) );
+ const size_t nPanelPos = m_pPanelDeck->InsertPanel( pNewPanel, m_pPanelDeck->GetPanelCount() );
+
+ // remember it
+ RegisterPanel( nPanelPos, aPanels[i].nPanelID, pNewPanel );
+
+ if ( nPanelToActivate == aPanels[i].nPanelID )
+ aPanelToActivate.nPanelPos = nPanelPos;
+ }
+
+ return aPanelToActivate;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::SetupCustomPanels()
+{
+ // compose the resource ID for the ToolPanel view
+ ::boost::shared_ptr< FrameworkHelper > pFrameworkHelper( FrameworkHelper::Instance( m_rPanelViewShell.GetViewShellBase() ) );
+ const Reference< XResourceId > xToolPanelId( pFrameworkHelper->CreateResourceId( FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL ) );
+
+ // get the config node holding the custom tool panel descriptions
+ ::utl::OConfigurationTreeRoot aConfig( ::comphelper::ComponentContext( ::comphelper::getProcessServiceFactory() ),
+ "/org.openoffice.Office.Impress/MultiPaneGUI/ToolPanel/CustomPanels", false );
+ const Sequence< ::rtl::OUString > aCustomPanelDescs( aConfig.getNodeNames() );
+
+ // create panels
+ size_t nCustomPanelNo = 0;
+ for ( const ::rtl::OUString* panelNodeName = aCustomPanelDescs.getConstArray();
+ panelNodeName != aCustomPanelDescs.getConstArray() + aCustomPanelDescs.getLength();
+ ++panelNodeName
+ )
+ {
+ ::utl::OConfigurationNode aPanelDesc( aConfig.openNode( *panelNodeName ) );
+
+ // create and insert the panel
+ ::svt::PToolPanel pNewPanel( new CustomToolPanel( *m_pPanelDeck, aPanelDesc, xToolPanelId, pFrameworkHelper ) );
+ const size_t nPanelPos = m_pPanelDeck->InsertPanel( pNewPanel, m_pPanelDeck->GetPanelCount() );
+
+ // remember it
+ RegisterPanel( nPanelPos, PanelId( PID_FIRST_CUSTOM_PANEL + nCustomPanelNo ), pNewPanel );
+ ++nCustomPanelNo;
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::Setup()
+{
+ if ( m_bInitialized )
+ return;
+ m_bInitialized = true;
+
+ // standard (built-in) panels
+ const PanelActivation aPanelToActivate = SetupDefaultPanels();
+
+ // custom panels
+ SetupCustomPanels();
+
+ // activate default panel
+ if ( aPanelToActivate.bActivateAsResource )
+ m_pPanelDeck->ActivatePanelResource( aPanelToActivate.nPanelPos );
+ else
+ m_pPanelDeck->ActivatePanelDirectly( aPanelToActivate.nPanelPos );
+
+ // add as listener to the panel deck
+ m_pPanelDeck->AddListener( *this );
+
+ // initialize panel selector
+ SetLayout( LAYOUT_DRAWERS, true );
+
+ // listen at the configuration
+ m_pConfigListener.set( new ConfigurationListener( *this ) );
+
+ m_pPanelDeck->Show();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::SetLayout( const PanelSelectorLayout i_eLayout, const bool i_bForce )
+{
+ if ( !i_bForce && ( m_eCurrentLayout == i_eLayout ) )
+ return;
+
+ switch ( i_eLayout )
+ {
+ case LAYOUT_DRAWERS:
+ m_pPanelDeck->SetDrawersLayout();
+ break;
+ case LAYOUT_TABS_TOP:
+ m_pPanelDeck->SetTabsLayout( ::svt::TABS_TOP, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ case LAYOUT_TABS_BOTTOM:
+ m_pPanelDeck->SetTabsLayout( ::svt::TABS_BOTTOM, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ case LAYOUT_TABS_LEFT:
+ m_pPanelDeck->SetTabsLayout( ::svt::TABS_LEFT, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ case LAYOUT_TABS_RIGHT:
+ m_pPanelDeck->SetTabsLayout( ::svt::TABS_RIGHT, ::svt::TABITEM_IMAGE_ONLY );
+ break;
+ }
+ m_eCurrentLayout = i_eLayout;
+ UpdateDockingWindowTitle();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::Cleanup()
+{
+ if ( m_bInitialized )
+ {
+ m_pPanelDeck->RemoveListener( *this );
+ // remove the panels which are not under the control of the panel deck currently
+ for ( PanelDescriptors::iterator panelPos = m_aPanels.begin();
+ panelPos != m_aPanels.end();
+ ++panelPos
+ )
+ {
+ if ( panelPos->bHidden )
+ panelPos->pPanel->Dispose();
+ }
+ m_aPanels.clear();
+
+ if ( m_pConfigListener.is() )
+ m_pConfigListener->dispose();
+ }
+ m_pPanelDeck.reset();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::OnToolPanelActivationRequest( const ::rtl::OUString& i_rResourceURL )
+{
+ // look up the panel which belongs to the given resource
+ for ( size_t i=0; i<GetPanelCount(); ++i )
+ {
+ const PanelDescriptor& rPanel = GetPanel( i );
+ const TaskPaneToolPanel* pPanel( dynamic_cast< const TaskPaneToolPanel* >( rPanel.pPanel.get() ) );
+ ENSURE_OR_CONTINUE( pPanel != NULL, "ToolPanelViewShell::OnToolPanelActivationRequest: illegal panel implementation!" );
+
+ Reference< XResourceId > xPanelId( pPanel->getResourceId() );
+ ::rtl::OUString sPanelURL( xPanelId.is() ? xPanelId->getResourceURL() : ::rtl::OUString() );
+ ENSURE_OR_CONTINUE( sPanelURL.getLength(), "illegal panel resource!" );
+
+ if ( sPanelURL == i_rResourceURL )
+ {
+ CustomToolPanel* pCustomPanel = dynamic_cast< CustomToolPanel* >( rPanel.pPanel.get() );
+ OSL_ENSURE( ( pCustomPanel != NULL ) == ( rPanel.nId >= PID_FIRST_CUSTOM_PANEL ),
+ "ToolPanelViewShell::OnToolPanelActivationRequest: inconsistency!" );
+ if ( pCustomPanel != NULL )
+ {
+ // if that's a custom tool panel, then temporarily disable the access of the tool panel implementation
+ // to the XPane object. Otherwise, it would request this resource from the configuration controller during
+ // the below ActivatePanelDirectly call, which would fail, since the resource is just to be created.
+ pCustomPanel->LockResourceAccess();
+ }
+ ActivatePanelDirectly( rPanel.nId );
+ if ( pCustomPanel != NULL )
+ {
+ pCustomPanel->UnlockResourceAccess();
+ }
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::Initialize()
+{
+ mpImpl->Setup();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+ToolPanelViewShell::ToolPanelViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, ::Window* pParentWindow,
+ FrameView* pFrameViewArgument )
+ :ViewShell(pFrame, pParentWindow, rViewShellBase)
+ ,mpImpl( new ToolPanelViewShell_Impl( *this, *mpContentWindow.get() ) )
+ ,mpSubShellManager()
+ ,mnMenuId(0)
+{
+ meShellType = ST_TASK_PANE;
+
+ mpContentWindow->SetCenterAllowed( false );
+ pParentWindow->SetStyle( pParentWindow->GetStyle() | WB_DIALOGCONTROL );
+
+ GetParentWindow()->SetBackground( Wallpaper() );
+ mpContentWindow->SetBackground( Wallpaper() );
+
+ GetParentWindow()->SetHelpId(HID_SD_TASK_PANE);
+
+ ConnectToDockingWindow();
+
+ SetPool( &GetDoc()->GetPool() );
+
+ if ( pFrameViewArgument )
+ mpFrameView = pFrameViewArgument;
+ else
+ mpFrameView = new FrameView( GetDoc() );
+ GetFrameView()->Connect();
+
+ // Hide or delete unused controls that we have inherited from the
+ // ViewShell base class.
+ mpHorizontalScrollBar.reset();
+ mpVerticalScrollBar.reset();
+ mpScrollBarBox.reset();
+ mpHorizontalRuler.reset();
+ mpVerticalRuler.reset();
+
+ SetName( String( RTL_CONSTASCII_USTRINGPARAM( "ToolPanelViewShell" ) ) );
+
+ // For accessibility we have to shortly hide the content window. This
+ // triggers the construction of a new accessibility object for the new
+ // view shell. (One is created earlier while the construtor of the base
+ // class is executed. At that time the correct accessibility object can
+ // not be constructed.)
+ if ( mpContentWindow.get() )
+ {
+ mpContentWindow->Hide();
+ mpContentWindow->Show();
+ }
+
+ // Register the shell manager as factory at the ViewShellManager.
+ mpSubShellManager.reset( new TaskPaneShellManager(
+ GetViewShellBase().GetViewShellManager(),
+ *this
+ ) );
+ GetViewShellBase().GetViewShellManager()->AddSubShellFactory( this, mpSubShellManager );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+ToolPanelViewShell::~ToolPanelViewShell()
+{
+ mpImpl->Cleanup();
+
+ // reset our impl before destroying the panel deck, to ensure the hidden panels are properly
+ // disposed/destroyed, too
+ mpImpl.reset();
+ GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory(this, mpSubShellManager);
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+// static
+void ToolPanelViewShell::RegisterControls()
+{
+ SfxModule* pModule = SD_MOD();
+ controls::MasterPagesSelector::RegisterInterface( pModule );
+ LayoutMenu::RegisterInterface( pModule );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::ArrangeGUIElements()
+{
+ ViewShell::ArrangeGUIElements();
+
+ Initialize();
+
+ mpImpl->GetPanelDeck().SetPosSizePixel( Point(), maViewSize );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::GetFocus()
+{
+ Invalidate();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::LoseFocus()
+{
+ Invalidate();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::KeyInput( const KeyEvent& i_rKeyEvent )
+{
+ const KeyCode nCode = i_rKeyEvent.GetKeyCode();
+ if ( nCode == KEY_RETURN )
+ {
+ if ( !mpImpl->GetPanelDeck().HasChildPathFocus() )
+ mpImpl->GetPanelDeck().GrabFocus();
+ }
+ else
+ ViewShell::KeyInput( i_rKeyEvent, NULL );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+namespace
+{
+ PanelSelectorLayout lcl_getTabLayoutFromAlignment( const SfxChildAlignment i_eAlignment )
+ {
+ switch ( i_eAlignment )
+ {
+ case SFX_ALIGN_LEFT:
+ return LAYOUT_TABS_LEFT;
+ case SFX_ALIGN_TOP:
+ return LAYOUT_TABS_TOP;
+ case SFX_ALIGN_BOTTOM:
+ return LAYOUT_TABS_BOTTOM;
+ default:
+ return LAYOUT_TABS_RIGHT;
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+IMPL_LINK( ToolPanelViewShell, DockingChanged, PaneDockingWindow*, i_pDockingWindow )
+{
+ ENSURE_OR_RETURN( i_pDockingWindow == dynamic_cast< PaneDockingWindow* >( GetDockingWindow() ), "unknown source", 0 );
+
+ if ( mpImpl->GetLayout() == LAYOUT_DRAWERS )
+ return 0L;
+
+ mpImpl->SetLayout( lcl_getTabLayoutFromAlignment( i_pDockingWindow->GetAlignment() ) );
+ return 0L;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+IMPL_LINK(ToolPanelViewShell, ToolboxClickHandler, ToolBox*, pToolBox)
+{
+ if (pToolBox->GetCurItemId() == mnMenuId)
+ {
+ pToolBox->EndSelection();
+
+ DockingWindow* pDockingWindow = GetDockingWindow();
+ ::std::auto_ptr<PopupMenu> pMenu = CreatePopupMenu (
+ pDockingWindow!=NULL && !pDockingWindow->IsFloatingMode());
+ pMenu->SetSelectHdl (
+ LINK(this, ToolPanelViewShell, MenuSelectHandler));
+
+ // pass toolbox button rect so the menu can stay open on button up
+ Rectangle aRect = pToolBox->GetItemRect(mnMenuId);
+ aRect.SetPos(pToolBox->GetPosPixel() );
+ pMenu->Execute (pDockingWindow, aRect, POPUPMENU_EXECUTE_DOWN);
+ }
+
+ return 0;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+IMPL_LINK(ToolPanelViewShell, MenuSelectHandler, Menu*, pMenu)
+{
+ if (pMenu)
+ {
+ pMenu->Deactivate();
+ switch (pMenu->GetCurItemId())
+ {
+ case MID_UNLOCK_TASK_PANEL:
+ {
+ DockingWindow* pDockingWindow = GetDockingWindow();
+ if (pDockingWindow != NULL)
+ pDockingWindow->SetFloatingMode (TRUE);
+ }
+ break;
+
+ case MID_LOCK_TASK_PANEL:
+ {
+ DockingWindow* pDockingWindow = GetDockingWindow();
+ if (pDockingWindow != NULL)
+ pDockingWindow->SetFloatingMode (FALSE);
+ }
+ break;
+
+ case MID_LAYOUT_DRAWERS:
+ mpImpl->SetLayout( LAYOUT_DRAWERS );
+ break;
+
+ case MID_LAYOUT_TABS:
+ {
+ PaneDockingWindow* pDockingWindow = dynamic_cast< PaneDockingWindow* >( GetDockingWindow() );
+ OSL_ENSURE( pDockingWindow != NULL, "ToolPanelViewShell::MenuSelectHandler: unknown docking window type!" );
+ if ( pDockingWindow )
+ mpImpl->SetLayout( lcl_getTabLayoutFromAlignment( pDockingWindow->GetAlignment() ) );
+ }
+ break;
+
+ default:
+ {
+ size_t nPanelIndex = size_t( pMenu->GetCurItemId() - MID_FIRST_PANEL );
+ mpImpl->TogglePanelVisibility( nPanelIndex );
+ }
+ break;
+ }
+ }
+
+ return 0;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+::std::auto_ptr<PopupMenu> ToolPanelViewShell::CreatePopupMenu (
+ bool bIsDocking)
+{
+ ::std::auto_ptr<PopupMenu> pMenu (new PopupMenu ());
+ FloatingWindow* pFloat = static_cast<FloatingWindow*>(pMenu->GetWindow());
+ if (pFloat != NULL)
+ {
+ pFloat->SetPopupModeFlags (
+ pFloat->GetPopupModeFlags()
+ | FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE);
+ }
+
+ // Add one entry for every tool panel element to individually make
+ // them visible or hide them.
+ USHORT nIndex = MID_FIRST_PANEL;
+ for ( size_t i=0; i<mpImpl->GetPanelCount(); ++i, ++nIndex )
+ {
+ const PanelDescriptor& rPanelDesc( mpImpl->GetPanel(i) );
+ pMenu->InsertItem( nIndex, rPanelDesc.pPanel->GetDisplayName(), MIB_CHECKABLE );
+ pMenu->SetUserValue( nIndex, rPanelDesc.nId );
+ pMenu->CheckItem( nIndex, !rPanelDesc.bHidden );
+ }
+ pMenu->InsertSeparator();
+
+#if OSL_DEBUG_LEVEL > 0
+ pMenu->InsertItem( MID_LAYOUT_TABS, String::CreateFromAscii( "Tab-Layout (exp.)" ), MIB_CHECKABLE );
+ pMenu->CheckItem( MID_LAYOUT_TABS, mpImpl->GetLayout() != LAYOUT_DRAWERS );
+ pMenu->InsertItem( MID_LAYOUT_DRAWERS, String::CreateFromAscii( "Drawer-Layout" ), MIB_CHECKABLE );
+ pMenu->CheckItem( MID_LAYOUT_DRAWERS, mpImpl->GetLayout() == LAYOUT_DRAWERS );
+
+ pMenu->InsertSeparator();
+#endif
+
+ // Add entry for docking or un-docking the tool panel.
+ if (bIsDocking)
+ pMenu->InsertItem (
+ MID_UNLOCK_TASK_PANEL,
+ String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_UNLOCK)));
+ else
+ pMenu->InsertItem (
+ MID_LOCK_TASK_PANEL,
+ String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_LOCK)));
+
+ pMenu->RemoveDisabledEntries (FALSE, FALSE);
+
+ return pMenu;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+SdPage* ToolPanelViewShell::GetActualPage()
+{
+ return NULL;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+SdPage* ToolPanelViewShell::getCurrentPage() const
+{
+ return NULL;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::Execute( SfxRequest& )
+{
+ OSL_ENSURE( false, "ToolPanelViewShell::Execute: not to be called! (right?)" );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::GetState( SfxItemSet& )
+{
+ OSL_ENSURE( false, "ToolPanelViewShell::GetState: not to be called! (right?)" );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+TaskPaneShellManager& ToolPanelViewShell::GetSubShellManager() const
+{
+ return *mpSubShellManager.get();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+DockingWindow* ToolPanelViewShell::GetDockingWindow()
+{
+ ::Window* pParentWindow = GetParentWindow();
+ DockingWindow* pDockingWindow = NULL;
+ while (pParentWindow!=NULL && pDockingWindow==NULL)
+ {
+ pDockingWindow = dynamic_cast<DockingWindow*>(pParentWindow);
+ pParentWindow = pParentWindow->GetParent();
+ }
+ return pDockingWindow;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+Reference< XAccessible > ToolPanelViewShell::CreateAccessibleDocumentView( ::sd::Window* i_pWindow )
+{
+ ENSURE_OR_RETURN( i_pWindow, "ToolPanelViewShell::CreateAccessibleDocumentView: illegal window!", NULL );
+ return mpImpl->CreateAccessible( *i_pWindow );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+Reference< XDrawSubController > ToolPanelViewShell::CreateSubController()
+{
+ // This view shell is not designed to be the main view shell and thus
+ // does not support a UNO sub controller.
+ return Reference< XDrawSubController >();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::ConnectToDockingWindow()
+{
+ PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(GetDockingWindow());
+ if (pDockingWindow != NULL)
+ {
+ pDockingWindow->InitializeTitleToolBox();
+ mnMenuId = pDockingWindow->AddMenu (
+ String(SdResId(STR_TASKPANEL_MASTER_PAGE_MENU_TITLE)),
+ HID_SD_TASK_PANE_VIEW_MENU,
+ LINK(this, ToolPanelViewShell, ToolboxClickHandler));
+
+ // be notified when the docking position of the window changes
+ pDockingWindow->SetEndDockingHdl( LINK( this, ToolPanelViewShell, DockingChanged ) );
+ }
+
+ // Tell the focus manager that we want to pass the focus to our
+ // child.
+ FocusManager::Instance().RegisterDownLink( GetParentWindow(), &mpImpl->GetPanelDeck() );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+bool ToolPanelViewShell::RelocateToParentWindow( ::Window* pParentWindow )
+{
+ ::Window* pOldParentWindow = GetParentWindow();
+ FocusManager::Instance().RemoveLinks( pOldParentWindow, &mpImpl->GetPanelDeck() );
+ FocusManager::Instance().RemoveLinks( &mpImpl->GetPanelDeck(), pOldParentWindow );
+
+ PaneDockingWindow* pDockingWindow = dynamic_cast< PaneDockingWindow* >( GetDockingWindow() );
+ if ( pDockingWindow != NULL )
+ {
+ pDockingWindow->SetEndDockingHdl( Link() );
+ }
+
+ ViewShell::RelocateToParentWindow(pParentWindow);
+
+ ConnectToDockingWindow();
+
+ Resize();
+
+ return true;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+::Window* ToolPanelViewShell::GetToolPanelParentWindow()
+{
+ return mpImpl->GetToolPanelParentWindow();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::DeactivatePanel( const PanelId i_ePanelId )
+{
+ mpImpl->DeactivatePanelDirectly( i_ePanelId );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell::ActivatePanel( const PanelId i_ePanelId )
+{
+ mpImpl->ActivatePanelDirectly( i_ePanelId );
+}
+
+
+// =====================================================================================================================
+// = ToolPanelViewShell_Impl - implementation
+// =====================================================================================================================
+// ---------------------------------------------------------------------------------------------------------------------
+ToolPanelViewShell_Impl::ToolPanelViewShell_Impl( ToolPanelViewShell& i_rPanelViewShell, ::Window& i_rPanelDeckParent )
+ :m_aPanels()
+ ,m_rPanelViewShell( i_rPanelViewShell )
+ ,m_pPanelDeck( new ToolPanelDeck( i_rPanelDeckParent, i_rPanelViewShell ) )
+ ,m_eCurrentLayout( LAYOUT_DRAWERS )
+ ,m_bInitialized( false )
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+ToolPanelViewShell_Impl::~ToolPanelViewShell_Impl()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::TogglePanelVisibility( const size_t i_nLogicalPanelIndex )
+{
+ ENSURE_OR_RETURN_VOID( i_nLogicalPanelIndex < m_aPanels.size(), "illegal index" );
+
+ // get the actual panel index, within the deck
+ size_t nActualPanelIndex(0);
+ for ( size_t i=0; i < i_nLogicalPanelIndex; ++i )
+ {
+ if ( !m_aPanels[i].bHidden )
+ ++nActualPanelIndex;
+ }
+ if ( m_aPanels[ i_nLogicalPanelIndex ].bHidden )
+ {
+ OSL_VERIFY( m_pPanelDeck->InsertPanel( m_aPanels[ i_nLogicalPanelIndex ].pPanel, nActualPanelIndex ) == nActualPanelIndex );
+ // if there has not been an active panel before, activate the newly inserted one
+ ::boost::optional< size_t > aActivePanel( m_pPanelDeck->GetActivePanel() );
+ if ( !aActivePanel )
+ m_pPanelDeck->ActivatePanelResource( nActualPanelIndex );
+ }
+ else
+ {
+ OSL_VERIFY( m_pPanelDeck->RemovePanel( nActualPanelIndex ).get() == m_aPanels[ i_nLogicalPanelIndex ].pPanel.get() );
+ }
+ m_aPanels[ i_nLogicalPanelIndex ].bHidden = !m_aPanels[ i_nLogicalPanelIndex ].bHidden;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::DeactivatePanelDirectly( const PanelId i_nPanelId )
+{
+ for ( size_t i=0; i<m_aPanels.size(); ++i )
+ {
+ if ( m_aPanels[i].nId == i_nPanelId )
+ {
+ if ( m_pPanelDeck->GetActivePanel() == i )
+ m_pPanelDeck->ActivatePanelDirectly( ::boost::optional< size_t >() );
+ return;
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::ActivatePanelDirectly( const PanelId i_nPanelId )
+{
+ size_t nActualPanelIndex(0);
+ for ( size_t i=0; i<m_aPanels.size(); ++i )
+ {
+ if ( m_aPanels[i].nId == i_nPanelId )
+ {
+ if ( m_aPanels[i].bHidden )
+ TogglePanelVisibility( i );
+ m_pPanelDeck->ActivatePanelDirectly( nActualPanelIndex );
+ return;
+ }
+ if ( !m_aPanels[i].bHidden )
+ ++nActualPanelIndex;
+ }
+ OSL_ENSURE( false, "ToolPanelViewShell::ActivatePanelDirectly: don't have a panel with the given ID!" );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::RegisterPanel( size_t i_nPosition, PanelId i_nPanelId, const ::svt::PToolPanel& i_rPanel )
+{
+ if ( i_nPosition >= m_aPanels.size() )
+ m_aPanels.resize( i_nPosition + 1 );
+
+ OSL_PRECOND( m_aPanels[ i_nPosition ].nId == PID_UNKNOWN, "ToolPanelViewShell_Impl::RegisterPanel: "
+ "already registered a panel for this ID!" );
+ m_aPanels[ i_nPosition ] = PanelDescriptor( i_nPanelId, i_rPanel );
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition )
+{
+ (void)i_pPanel;
+ (void)i_nPosition;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::PanelRemoved( const size_t i_nPosition )
+{
+ (void)i_nPosition;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::UpdateDockingWindowTitle()
+{
+ PaneDockingWindow* pDockingWindow = dynamic_cast< PaneDockingWindow* >( m_rPanelViewShell.GetDockingWindow() );
+ ENSURE_OR_RETURN_VOID( pDockingWindow, "ToolPanelViewShell_Impl::UpdateDockingWindowTitle: no PaneDockingWindow!?" );
+
+ ::boost::optional< size_t > aActivePanel( m_pPanelDeck->GetActivePanel() );
+ if ( !aActivePanel || ( GetLayout() == LAYOUT_DRAWERS ) )
+ pDockingWindow->SetTitle( String( SdResId( STR_RIGHT_PANE_TITLE ) ) );
+ else
+ {
+ size_t nNewActive( *aActivePanel );
+ for ( size_t i=0; i < m_aPanels.size(); ++i )
+ {
+ if ( m_aPanels[i].bHidden )
+ continue;
+
+ if ( !nNewActive )
+ {
+ pDockingWindow->SetTitle( m_aPanels[i].pPanel->GetDisplayName() );
+ break;
+ }
+ --nNewActive;
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive )
+{
+ if ( GetLayout() == LAYOUT_DRAWERS )
+ // no adjustment of the title when we use the classical "drawers" layout
+ return;
+
+ UpdateDockingWindowTitle( );
+ (void)i_rOldActive;
+ (void)i_rNewActive;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter )
+{
+ // not interested in
+ (void)i_rNewLayouter;
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+void ToolPanelViewShell_Impl::Dying()
+{
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+Reference< XAccessible > ToolPanelViewShell_Impl::CreateAccessible( ::sd::Window& i_rWindow )
+{
+ ::Window* pAccessibleParent = i_rWindow.GetAccessibleParentWindow();
+ m_pPanelDeck->SetAccessibleParentWindow( pAccessibleParent );
+ return m_pPanelDeck->GetAccessible();
+}
+
+// ---------------------------------------------------------------------------------------------------------------------
+PanelId GetStandardPanelId( const ::rtl::OUString& i_rTaskPanelResourceURL )
+{
+ PanelId ePanelId( PID_UNKNOWN );
+
+ if ( i_rTaskPanelResourceURL.equals( FrameworkHelper::msMasterPagesTaskPanelURL ) )
+ {
+ ePanelId = PID_MASTER_PAGES;
+ }
+ else if ( i_rTaskPanelResourceURL.equals( FrameworkHelper::msLayoutTaskPanelURL ) )
+ {
+ ePanelId = PID_LAYOUT;
+ }
+ else if ( i_rTaskPanelResourceURL.equals( FrameworkHelper::msTableDesignPanelURL ) )
+ {
+ ePanelId = PID_TABLE_DESIGN;
+ }
+ else if ( i_rTaskPanelResourceURL.equals( FrameworkHelper::msCustomAnimationTaskPanelURL ) )
+ {
+ ePanelId = PID_CUSTOM_ANIMATION;
+ }
+ else if ( i_rTaskPanelResourceURL.equals( FrameworkHelper::msSlideTransitionTaskPanelURL ) )
+ {
+ ePanelId = PID_SLIDE_TRANSITION;
+ }
+ else
+ {
+ OSL_ENSURE( false, "GetStandardPanelId: cannot translate the given resource URL!" );
+ }
+
+ return ePanelId;
+}
+
+} } // end of namespace ::sd::toolpanel
diff --git a/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx b/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
index 9767efe87c48..e7edf109cffd 100644
--- a/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
+++ b/sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
@@ -31,6 +31,7 @@
#include "CustomAnimationPanel.hxx"
#include "taskpane/TaskPaneControlFactory.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "strings.hrc"
#include "sdresid.hxx"
@@ -44,10 +45,11 @@ namespace sd
namespace toolpanel { namespace controls {
-CustomAnimationPanel::CustomAnimationPanel(TreeNode* pParent, ViewShellBase& rBase)
- : SubToolPanel (pParent)
+CustomAnimationPanel::CustomAnimationPanel(Window& i_rParentWindow, ToolPanelViewShell& i_rPanelViewShell)
+ :SubToolPanel( i_rParentWindow )
+ ,m_pPanelViewShell( &i_rPanelViewShell )
{
- mpWrappedControl = createCustomAnimationPanel( pParent->GetWindow(), rBase );
+ mpWrappedControl = createCustomAnimationPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase() );
mpWrappedControl->Show();
}
@@ -56,10 +58,17 @@ CustomAnimationPanel::~CustomAnimationPanel()
delete mpWrappedControl;
}
-std::auto_ptr<ControlFactory> CustomAnimationPanel::CreateControlFactory (ViewShellBase& rBase)
+std::auto_ptr< ControlFactory > CustomAnimationPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
{
- return std::auto_ptr<ControlFactory>(
- new ControlFactoryWithArgs1<CustomAnimationPanel,ViewShellBase>(rBase));
+ return std::auto_ptr< ControlFactory >(
+ new RootControlFactoryWithArg< CustomAnimationPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
+}
+
+TaskPaneShellManager* CustomAnimationPanel::GetShellManager()
+{
+ if ( m_pPanelViewShell )
+ return &m_pPanelViewShell->GetSubShellManager();
+ return SubToolPanel::GetShellManager();
}
Size CustomAnimationPanel::GetPreferredSize()
diff --git a/sd/source/ui/toolpanel/controls/CustomAnimationPanel.hxx b/sd/source/ui/toolpanel/controls/CustomAnimationPanel.hxx
index 734965e5264b..864ba637b94d 100644
--- a/sd/source/ui/toolpanel/controls/CustomAnimationPanel.hxx
+++ b/sd/source/ui/toolpanel/controls/CustomAnimationPanel.hxx
@@ -37,6 +37,7 @@ class ViewShellBase;
namespace sd { namespace toolpanel {
class TreeNode;
class ControlFactory;
+class ToolPanelViewShell;
} }
namespace sd { namespace toolpanel { namespace controls {
@@ -46,12 +47,16 @@ class CustomAnimationPanel
{
public:
CustomAnimationPanel (
- TreeNode* pParent,
- ViewShellBase& rBase);
+ Window& i_rParentWindow,
+ ToolPanelViewShell& i_rPanelViewShell);
virtual ~CustomAnimationPanel (void);
- static std::auto_ptr<ControlFactory> CreateControlFactory (ViewShellBase& rBase);
+ static std::auto_ptr<ControlFactory> CreateControlFactory (ToolPanelViewShell& i_rPanelViewShell);
+ // TreeNode overridables
+ virtual TaskPaneShellManager* GetShellManager();
+
+ // ILayoutableWindow overridables
virtual Size GetPreferredSize (void);
virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeigh);
virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
@@ -68,6 +73,7 @@ public:
private:
Size maPreferredSize;
::Window* mpWrappedControl;
+ ToolPanelViewShell* m_pPanelViewShell;
};
} } } // end of namespace ::sd::toolpanel::controls
diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
index 2e121098194a..b9040e72283f 100644
--- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
+++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
@@ -44,6 +44,8 @@
#include <com/sun/star/container/XIndexAccess.hpp>
#include "stlpool.hxx"
#include <svx/xfillit0.hxx>
+#include <tools/diagnose_ex.h>
+
using namespace ::com::sun::star;
namespace sd { namespace toolpanel { namespace controls {
@@ -245,9 +247,7 @@ SdPage* DocumentHelper::AddMasterPage (
catch (uno::Exception& rException)
{
pClonedMasterPage = NULL;
- OSL_TRACE("caught exception while adding master page: %s",
- ::rtl::OUStringToOString(rException.Message,
- RTL_TEXTENCODING_UTF8).getStr());
+ DBG_UNHANDLED_EXCEPTION();
}
catch (::std::exception rException)
{
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx
index 6b9ff09bbed3..9a5eefb6d925 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainerProviders.cxx
@@ -40,6 +40,7 @@
#include <vcl/image.hxx>
#include <vcl/pngread.hxx>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -291,7 +292,7 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume
}
catch (uno::RuntimeException)
{
- OSL_TRACE ("caught exception while loading page from template file");
+ DBG_UNHANDLED_EXCEPTION();
pPage = NULL;
}
diff --git a/sd/source/ui/toolpanel/controls/MasterPagesPanel.cxx b/sd/source/ui/toolpanel/controls/MasterPagesPanel.cxx
index b897e1514862..8dab51e93a58 100644
--- a/sd/source/ui/toolpanel/controls/MasterPagesPanel.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPagesPanel.cxx
@@ -33,6 +33,7 @@
#include "CurrentMasterPagesSelector.hxx"
#include "RecentMasterPagesSelector.hxx"
#include "AllMasterPagesSelector.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "taskpane/TaskPaneControlFactory.hxx"
#include "taskpane/TitledControl.hxx"
#include "../TaskPaneShellManager.hxx"
@@ -48,8 +49,14 @@
namespace sd { namespace toolpanel { namespace controls {
-MasterPagesPanel::MasterPagesPanel (TreeNode* pParent, ViewShellBase& rBase)
- : ScrollPanel (pParent)
+MasterPagesPanel::MasterPagesPanel (::Window& i_rParentWindow, ToolPanelViewShell& i_rPanelViewShell)
+ :ScrollPanel (i_rParentWindow)
+ ,m_pPanelViewShell( &i_rPanelViewShell )
+{
+ impl_construct( m_pPanelViewShell->GetViewShellBase() );
+}
+
+void MasterPagesPanel::impl_construct( ViewShellBase& rBase )
{
SdDrawDocument* pDocument = rBase.GetDocument();
::std::auto_ptr<controls::MasterPagesSelector> pSelector;
@@ -118,18 +125,33 @@ MasterPagesPanel::MasterPagesPanel (TreeNode* pParent, ViewShellBase& rBase)
MasterPagesPanel::~MasterPagesPanel (void)
{
+ TaskPaneShellManager* pShellManager( GetShellManager() );
+ OSL_ENSURE( pShellManager, "MasterPagesPanel::~MasterPagesPanel: no shell manager anymore - cannot remove sub shells!" );
+ if ( pShellManager )
+ {
+ pShellManager->RemoveSubShell( HID_SD_TASK_PANE_PREVIEW_CURRENT );
+ pShellManager->RemoveSubShell( HID_SD_TASK_PANE_PREVIEW_RECENT );
+ pShellManager->RemoveSubShell( HID_SD_TASK_PANE_PREVIEW_ALL );
+ }
}
-std::auto_ptr<ControlFactory> MasterPagesPanel::CreateControlFactory (ViewShellBase& rBase)
+TaskPaneShellManager* MasterPagesPanel::GetShellManager()
{
- return std::auto_ptr<ControlFactory>(
- new ControlFactoryWithArgs1<MasterPagesPanel,ViewShellBase>(rBase));
+ if ( m_pPanelViewShell )
+ return &m_pPanelViewShell->GetSubShellManager();
+ return TreeNode::GetShellManager();
}
+std::auto_ptr< ControlFactory > MasterPagesPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
+{
+ return std::auto_ptr< ControlFactory >(
+ new RootControlFactoryWithArg< MasterPagesPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
+}
+
} } } // end of namespace ::sd::toolpanel::controls
diff --git a/sd/source/ui/toolpanel/controls/MasterPagesPanel.hxx b/sd/source/ui/toolpanel/controls/MasterPagesPanel.hxx
index 1c6d75ea8dcb..932007802ebf 100644
--- a/sd/source/ui/toolpanel/controls/MasterPagesPanel.hxx
+++ b/sd/source/ui/toolpanel/controls/MasterPagesPanel.hxx
@@ -37,6 +37,7 @@ class ViewShellBase;
namespace sd { namespace toolpanel {
class ControlFactory;
class TreeNode;
+class ToolPanelViewShell;
} }
namespace sd { namespace toolpanel { namespace controls {
@@ -50,11 +51,20 @@ class MasterPagesPanel
{
public:
MasterPagesPanel (
- TreeNode* pParent,
- ViewShellBase& rBase);
+ ::Window& i_rParentWindow,
+ ToolPanelViewShell& i_rPanelViewShell);
virtual ~MasterPagesPanel (void);
- static std::auto_ptr<ControlFactory> CreateControlFactory (ViewShellBase& rBase);
+ // TreeNode overridables
+ virtual TaskPaneShellManager* GetShellManager (void);
+
+ static std::auto_ptr<ControlFactory> CreateControlFactory (ToolPanelViewShell& i_rToolPanelShell);
+
+private:
+ void impl_construct( ViewShellBase& rBase );
+
+private:
+ ToolPanelViewShell* m_pPanelViewShell;
};
} } } // end of namespace ::sd::toolpanel::controls
diff --git a/sd/source/ui/toolpanel/controls/SlideTransitionPanel.cxx b/sd/source/ui/toolpanel/controls/SlideTransitionPanel.cxx
index 2cb0f58a029b..4ad67b876983 100644
--- a/sd/source/ui/toolpanel/controls/SlideTransitionPanel.cxx
+++ b/sd/source/ui/toolpanel/controls/SlideTransitionPanel.cxx
@@ -30,6 +30,7 @@
#include "SlideTransitionPanel.hxx"
#include "taskpane/TaskPaneControlFactory.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "strings.hrc"
#include "sdresid.hxx"
@@ -45,11 +46,12 @@ namespace toolpanel { namespace controls {
-SlideTransitionPanel::SlideTransitionPanel(TreeNode* pParent, ViewShellBase& rBase)
- : SubToolPanel (pParent),
- maPreferredSize( 100, 200 )
+SlideTransitionPanel::SlideTransitionPanel(Window& i_rParentWindow, ToolPanelViewShell& i_rToolPanelShell)
+ :SubToolPanel( i_rParentWindow )
+ ,maPreferredSize( 100, 200 )
+ ,m_pPanelViewShell( &i_rToolPanelShell )
{
- mpWrappedControl = createSlideTransitionPanel( pParent->GetWindow(), rBase );
+ mpWrappedControl = createSlideTransitionPanel( &i_rParentWindow, i_rToolPanelShell.GetViewShellBase() );
mpWrappedControl->Show();
}
@@ -58,10 +60,17 @@ SlideTransitionPanel::~SlideTransitionPanel()
delete mpWrappedControl;
}
-std::auto_ptr<ControlFactory> SlideTransitionPanel::CreateControlFactory (ViewShellBase& rBase)
+std::auto_ptr< ControlFactory > SlideTransitionPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
{
- return std::auto_ptr<ControlFactory>(
- new ControlFactoryWithArgs1<SlideTransitionPanel,ViewShellBase>(rBase));
+ return std::auto_ptr< ControlFactory >(
+ new RootControlFactoryWithArg< SlideTransitionPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
+}
+
+TaskPaneShellManager* SlideTransitionPanel::GetShellManager()
+{
+ if ( m_pPanelViewShell )
+ return &m_pPanelViewShell->GetSubShellManager();
+ return SubToolPanel::GetShellManager();
}
Size SlideTransitionPanel::GetPreferredSize()
diff --git a/sd/source/ui/toolpanel/controls/SlideTransitionPanel.hxx b/sd/source/ui/toolpanel/controls/SlideTransitionPanel.hxx
index 478f69091f63..f62cb918806b 100644
--- a/sd/source/ui/toolpanel/controls/SlideTransitionPanel.hxx
+++ b/sd/source/ui/toolpanel/controls/SlideTransitionPanel.hxx
@@ -36,6 +36,7 @@ class ViewShellBase;
namespace sd { namespace toolpanel {
class ControlFactory;
class TreeNode;
+class ToolPanelViewShell;
} }
namespace sd { namespace toolpanel { namespace controls {
@@ -45,12 +46,16 @@ class SlideTransitionPanel
{
public:
SlideTransitionPanel (
- TreeNode* pParent,
- ViewShellBase& rBase);
+ Window& i_rParentWindow,
+ ToolPanelViewShell& i_rToolPanelShell);
virtual ~SlideTransitionPanel (void);
- static std::auto_ptr<ControlFactory> CreateControlFactory (ViewShellBase& rBase);
+ static std::auto_ptr<ControlFactory> CreateControlFactory (ToolPanelViewShell& i_rToolPanelShell);
+ // TreeNode overridables
+ virtual TaskPaneShellManager* GetShellManager();
+
+ // ILayoutableWindow overridables
virtual Size GetPreferredSize (void);
virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeigh);
virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
@@ -68,6 +73,7 @@ public:
private:
Size maPreferredSize;
::Window* mpWrappedControl;
+ ToolPanelViewShell* m_pPanelViewShell;
};
} } } // end of namespace ::sd::toolpanel::controls
diff --git a/sd/source/ui/toolpanel/controls/TableDesignPanel.cxx b/sd/source/ui/toolpanel/controls/TableDesignPanel.cxx
index ce242d557ee7..d6507a25c11f 100644
--- a/sd/source/ui/toolpanel/controls/TableDesignPanel.cxx
+++ b/sd/source/ui/toolpanel/controls/TableDesignPanel.cxx
@@ -31,6 +31,7 @@
#include "TableDesignPanel.hxx"
#include "taskpane/TaskPaneControlFactory.hxx"
+#include "taskpane/ToolPanelViewShell.hxx"
#include "strings.hrc"
#include "sdresid.hxx"
@@ -44,10 +45,11 @@ namespace sd
namespace toolpanel { namespace controls {
-TableDesignPanel::TableDesignPanel(TreeNode* pParent, ViewShellBase& rBase)
- : SubToolPanel (pParent)
+TableDesignPanel::TableDesignPanel( ::Window& i_rParentWindow, ToolPanelViewShell& i_rPanelViewShell )
+ :SubToolPanel( i_rParentWindow )
+ ,m_pPanelViewShell( &i_rPanelViewShell )
{
- mpWrappedControl = createTableDesignPanel( pParent->GetWindow(), rBase );
+ mpWrappedControl = createTableDesignPanel( &i_rParentWindow, i_rPanelViewShell.GetViewShellBase() );
mpWrappedControl->Show();
}
@@ -56,10 +58,17 @@ TableDesignPanel::~TableDesignPanel()
delete mpWrappedControl;
}
-std::auto_ptr<ControlFactory> TableDesignPanel::CreateControlFactory (ViewShellBase& rBase)
+std::auto_ptr< ControlFactory > TableDesignPanel::CreateControlFactory( ToolPanelViewShell& i_rToolPanelShell )
{
- return std::auto_ptr<ControlFactory>(
- new ControlFactoryWithArgs1<TableDesignPanel,ViewShellBase>(rBase));
+ return std::auto_ptr< ControlFactory >(
+ new RootControlFactoryWithArg< TableDesignPanel, ToolPanelViewShell >( i_rToolPanelShell ) );
+}
+
+TaskPaneShellManager* TableDesignPanel::GetShellManager()
+{
+ if ( m_pPanelViewShell )
+ return &m_pPanelViewShell->GetSubShellManager();
+ return SubToolPanel::GetShellManager();
}
Size TableDesignPanel::GetPreferredSize()
diff --git a/sd/source/ui/toolpanel/controls/TableDesignPanel.hxx b/sd/source/ui/toolpanel/controls/TableDesignPanel.hxx
index aae06e37ad14..a3620df2ef68 100644
--- a/sd/source/ui/toolpanel/controls/TableDesignPanel.hxx
+++ b/sd/source/ui/toolpanel/controls/TableDesignPanel.hxx
@@ -37,6 +37,7 @@ class ViewShellBase;
namespace sd { namespace toolpanel {
class TreeNode;
class ControlFactory;
+class ToolPanelViewShell;
} }
namespace sd { namespace toolpanel { namespace controls {
@@ -46,12 +47,16 @@ class TableDesignPanel
{
public:
TableDesignPanel (
- TreeNode* pParent,
- ViewShellBase& rBase);
+ ::Window& i_rParentWindow,
+ ToolPanelViewShell& i_rPanelViewShell);
virtual ~TableDesignPanel (void);
- static std::auto_ptr<ControlFactory> CreateControlFactory (ViewShellBase& rBase);
+ static std::auto_ptr<ControlFactory> CreateControlFactory (ToolPanelViewShell& i_rToolPanelShell);
+ // TreeNode overridables
+ virtual TaskPaneShellManager* GetShellManager();
+
+ // ILayoutableWindow overridables
virtual Size GetPreferredSize (void);
virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeigh);
virtual sal_Int32 GetPreferredHeight (sal_Int32 nWidth);
@@ -68,6 +73,7 @@ public:
private:
Size maPreferredSize;
::Window* mpWrappedControl;
+ ToolPanelViewShell* m_pPanelViewShell;
};
} } } // end of namespace ::sd::toolpanel::controls
diff --git a/sd/source/ui/toolpanel/makefile.mk b/sd/source/ui/toolpanel/makefile.mk
index 08a966fe4061..ba3e0444baa3 100644
--- a/sd/source/ui/toolpanel/makefile.mk
+++ b/sd/source/ui/toolpanel/makefile.mk
@@ -50,12 +50,16 @@ SLOFILES = \
$(SLO)$/TitleBar.obj \
$(SLO)$/TitleToolBox.obj \
$(SLO)$/TitledControl.obj \
- $(SLO)$/ToolPanel.obj \
$(SLO)$/TaskPaneControlFactory.obj \
$(SLO)$/TaskPaneFocusManager.obj \
$(SLO)$/TaskPaneShellManager.obj \
$(SLO)$/TaskPaneTreeNode.obj \
- $(SLO)$/TaskPaneViewShell.obj \
+ $(SLO)$/ToolPanelViewShell.obj \
+ $(SLO)$/ToolPanelDeck.obj \
+ $(SLO)$/ToolPanelDrawer.obj \
+ $(SLO)$/TaskPaneToolPanel.obj \
+ $(SLO)$/CustomToolPanel.obj \
+ $(SLO)$/StandardToolPanel.obj \
\
$(SLO)$/EmptyWindow.obj \
$(SLO)$/LayoutMenu.obj \
diff --git a/sd/source/ui/tools/ConfigurationAccess.cxx b/sd/source/ui/tools/ConfigurationAccess.cxx
index 94ada78461ec..bf4fbc6e6ebe 100644
--- a/sd/source/ui/tools/ConfigurationAccess.cxx
+++ b/sd/source/ui/tools/ConfigurationAccess.cxx
@@ -33,6 +33,7 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -113,11 +114,9 @@ void ConfigurationAccess::Initialize (
sAccessService,
aCreationArguments);
}
- catch (Exception& rException)
+ catch (Exception&)
{
- OSL_TRACE ("caught exception while opening configuration: %s",
- ::rtl::OUStringToOString(rException.Message,
- RTL_TEXTENCODING_UTF8).getStr());
+ DBG_UNHANDLED_EXCEPTION();
}
}
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index b791454bd10a..c416e689efcf 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -42,6 +42,7 @@
#include <editeng/editstat.hxx>
#include <tools/link.hxx>
#include <vcl/svapp.hxx>
+#include <tools/diagnose_ex.h>
namespace sd {
@@ -131,7 +132,7 @@ Image PreviewRenderer::RenderPage (
}
catch (const com::sun::star::uno::Exception&)
{
- OSL_TRACE("PreviewRenderer::RenderPage: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -193,7 +194,7 @@ Image PreviewRenderer::RenderSubstitution (
}
catch (const com::sun::star::uno::Exception&)
{
- OSL_TRACE("PreviewRenderer::RenderPage: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
return aPreview;
@@ -302,7 +303,7 @@ void PreviewRenderer::PaintPage (const SdPage* pPage)
}
catch (const ::com::sun::star::uno::Exception&)
{
- OSL_TRACE("PreviewRenderer::PaintPage: caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
// Restore the previous online spelling and redlining states.
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 5314f6dbe768..a7c9786dd160 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -57,6 +57,8 @@
#include <vcl/metric.hxx>
#include <sfx2/viewfrm.hxx>
#include <svtools/langtab.hxx>
+#include <tools/diagnose_ex.h>
+
#include "strings.hrc"
#include "sdstring.hrc"
#include "eetext.hxx"
@@ -974,7 +976,7 @@ void Outliner::ProvideNextTextObject (void)
}
catch (::com::sun::star::uno::Exception e)
{
- OSL_TRACE ("Outliner %p: caught exception while ending text edit mode", this);
+ DBG_UNHANDLED_EXCEPTION();
}
SetUpdateMode(FALSE);
OutlinerView* pOutlinerView = mpImpl->GetOutlinerView();
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 6640d2455c20..643025b2b80b 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -64,9 +64,9 @@
#include "OutlineViewShell.hxx"
#include "SlideSorterViewShell.hxx"
#include "PresentationViewShell.hxx"
-#include "TaskPaneViewShell.hxx"
#include "FormShellManager.hxx"
#include "ToolBarManager.hxx"
+#include "taskpane/PanelId.hxx"
#include "Window.hxx"
#include "framework/ConfigurationController.hxx"
#include "DocumentRenderer.hxx"
@@ -91,6 +91,7 @@
#include <svl/whiter.hxx>
#include <comphelper/processfactory.hxx>
#include <vcl/msgbox.hxx>
+#include <tools/diagnose_ex.h>
#include "fubullet.hxx"
@@ -1487,9 +1488,9 @@ void ViewShellBase::Implementation::SetPaneVisibility (
xConfigurationController->requestResourceDeactivation(
xPaneId);
}
- catch (RuntimeException&)
+ catch (const Exception &)
{
- DBG_ASSERT(false, "ViewShellBase::Implementation::SetPaneVisibility(): caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1625,7 +1626,7 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false, "ViewShellBase::Implementation::GetSlotState(): caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -1638,8 +1639,8 @@ void ViewShellBase::Implementation::ProcessTaskPaneSlot (SfxRequest& rRequest)
// Set the visibility state of the toolpanel and one of its top
// level panels.
BOOL bShowToolPanel = TRUE;
- toolpanel::TaskPaneViewShell::PanelId nPanelId (
- toolpanel::TaskPaneViewShell::PID_UNKNOWN);
+ toolpanel::PanelId nPanelId (
+ toolpanel::PID_UNKNOWN);
bool bPanelIdGiven = false;
// Extract the given arguments.
@@ -1660,7 +1661,7 @@ void ViewShellBase::Implementation::ProcessTaskPaneSlot (SfxRequest& rRequest)
if (pPanelId != NULL)
{
nPanelId = static_cast<
- toolpanel::TaskPaneViewShell::PanelId>(
+ toolpanel::PanelId>(
pPanelId->GetValue());
bPanelIdGiven = true;
}
@@ -1670,7 +1671,7 @@ void ViewShellBase::Implementation::ProcessTaskPaneSlot (SfxRequest& rRequest)
// Ignore the request for some combinations of panels and view
// shell types.
if (bPanelIdGiven
- && ! (nPanelId==toolpanel::TaskPaneViewShell::PID_LAYOUT
+ && ! (nPanelId==toolpanel::PID_LAYOUT
&& mrBase.GetMainViewShell()!=NULL
&& mrBase.GetMainViewShell()->GetShellType()==ViewShell::ST_OUTLINE))
{
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index 8193ae3004d2..be30956dd5f4 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -47,11 +47,11 @@
#include "DrawController.hxx"
#include "FactoryIds.hxx"
#include "slideshow.hxx"
-#include "TaskPaneViewShell.hxx"
#include "ViewShellBase.hxx"
#include "FrameView.hxx"
#include "DrawViewShell.hxx"
#include "ViewShellHint.hxx"
+#include "taskpane/PanelId.hxx"
#include "framework/FrameworkHelper.hxx"
#include <sfx2/bindings.hxx>
@@ -195,7 +195,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot (
// Make the layout menu visible in the tool pane.
SfxBoolItem aMakeToolPaneVisible (ID_VAL_ISVISIBLE, TRUE);
SfxUInt32Item aPanelId (ID_VAL_PANEL_INDEX,
- ::sd::toolpanel::TaskPaneViewShell::PID_LAYOUT);
+ ::sd::toolpanel::PID_LAYOUT);
SfxViewFrame* pFrame = mrViewShell.GetViewFrame();
if (pFrame!=NULL && pFrame->GetDispatcher()!=NULL)
{
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 280252a61621..a12412bf7f7d 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/processfactory.hxx>
+#include <tools/diagnose_ex.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -472,7 +473,7 @@ bool ViewTabBar::ActivatePage (void)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false,"ViewTabBar::ActivatePage(): caught exception");
+ DBG_UNHANDLED_EXCEPTION();
}
return false;
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 852e56096a76..28f8d909031b 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -90,6 +90,7 @@
#include "DrawDocShell.hxx"
#include "sdabstdlg.hxx"
#include <sfx2/ipclient.hxx>
+#include <tools/diagnose_ex.h>
#include "ViewShellBase.hxx"
#include "FormShellManager.hxx"
#include "LayerTabBar.hxx"
@@ -413,7 +414,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq)
}
catch (RuntimeException&)
{
- DBG_ASSERT(false, "caught exception while handline SID_RELOAD");
+ DBG_UNHANDLED_EXCEPTION();
}
// We have to return immediately to avoid accessing this object.
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index 4dd3c61556e1..c4c6b20f8ca8 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -81,7 +81,6 @@
#include "FrameView.hxx"
#include "Window.hxx"
#include "DrawDocShell.hxx"
-#include "TaskPaneViewShell.hxx"
#include "framework/FrameworkHelper.hxx"
namespace sd {
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 7cae5d452a1b..5ae673b8769f 100644..100755
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -36,7 +36,6 @@
#include <svx/svxids.hrc>
#include <editeng/outliner.hxx>
-
#include <editeng/editview.hxx>
#include "app.hrc"
diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx
index 4ec163d813ca..ddeaf3d9027c 100644
--- a/sd/source/ui/view/viewshe3.cxx
+++ b/sd/source/ui/view/viewshe3.cxx
@@ -69,7 +69,6 @@
#endif
#include "DrawViewShell.hxx"
#include "OutlineViewShell.hxx"
-#include "TaskPaneViewShell.hxx"
#include "drawview.hxx"
#include "sdattr.hxx"
@@ -80,6 +79,7 @@
#include "Window.hxx"
#include "DrawDocShell.hxx"
#include "FrameView.hxx"
+#include "framework/FrameworkHelper.hxx"
#include "optsitem.hxx"
#include "sdresid.hxx"
@@ -253,7 +253,7 @@ SdPage* ViewShell::CreateOrDuplicatePage (
&& rBase.GetMainViewShell()->GetShellType()!=ViewShell::ST_DRAW)
{
framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
- framework::FrameworkHelper::msLayoutTaskPanelURL);
+ framework::FrameworkHelper::msLayoutTaskPanelURL);
}
// AutoLayouts muessen fertig sein
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index c1dacd33e0c0..5b79fdd1f098 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -100,7 +100,7 @@
</menu:menu>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:RightPane"/>
- <menu:menuitem menu:id=".uno:LeftPaneImpress"/>
+ <menu:menuitem menu:id=".uno:LeftPaneImpress"/>
<menu:menuitem menu:id=".uno:AvailableToolbars"/>
<menu:menuitem menu:id=".uno:StatusBarVisible"/>
<menu:menuitem menu:id=".uno:ShowImeStatusWindow"/>
diff --git a/sd/workben/custompanel/Impress.xcu b/sd/workben/custompanel/Impress.xcu
new file mode 100644
index 000000000000..6f8ced4924f3
--- /dev/null
+++ b/sd/workben/custompanel/Impress.xcu
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
+<oor:component-data oor:name="Impress" oor:package="org.openoffice.Office" xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <node oor:name="MultiPaneGUI">
+ <node oor:name="ToolPanel">
+ <node oor:name="CustomPanels">
+ <node oor:name="org.openoffice.example.colorpanel.SingleColorPanel" oor:op="replace">
+ <prop oor:name="ResourceURL" oor:type="xs:string">
+ <value>private:resource/toolpanel/SingleColorView</value>
+ </prop>
+ <prop oor:name="DisplayTitle" oor:type="xs:string">
+ <value>Single Color Panel</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ <node oor:name="Framework">
+ <node oor:name="ResourceFactories">
+ <node oor:name="org.openoffice.example.colorpanel.1" oor:op="replace">
+ <prop oor:name="ServiceName">
+ <value>org.openoffice.example.colorpanel.ResourceFactory</value>
+ </prop>
+ <node oor:name="ResourceList">
+ <node oor:name="SingleColorView" oor:op="replace">
+ <prop oor:name="URL">
+ <value>private:resource/toolpanel/SingleColorView</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/sd/workben/custompanel/colorpanel.map b/sd/workben/custompanel/colorpanel.map
new file mode 100644
index 000000000000..f4ed78b9e970
--- /dev/null
+++ b/sd/workben/custompanel/colorpanel.map
@@ -0,0 +1,8 @@
+UDK_3_0_0 {
+ global:
+ component_getImplementationEnvironment;
+ component_writeInfo;
+ component_getFactory;
+ local:
+ *;
+};
diff --git a/sd/workben/custompanel/ctp_factory.cxx b/sd/workben/custompanel/ctp_factory.cxx
new file mode 100644
index 000000000000..f63e487fdc3e
--- /dev/null
+++ b/sd/workben/custompanel/ctp_factory.cxx
@@ -0,0 +1,195 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "ctp_factory.hxx"
+#include "ctp_panel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/NotInitializedException.hpp>
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/drawing/framework/XResourceFactoryManager.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+/** === end UNO includes === **/
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::uno::XComponentContext;
+ using ::com::sun::star::drawing::framework::XResourceId;
+ using ::com::sun::star::drawing::framework::XResource;
+ using ::com::sun::star::lang::NotInitializedException;
+ using ::com::sun::star::lang::IllegalArgumentException;
+ using ::com::sun::star::drawing::framework::XResourceFactoryManager;
+ using ::com::sun::star::lang::WrappedTargetException;
+ using ::com::sun::star::lang::XComponent;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= helper
+ //==================================================================================================================
+ namespace
+ {
+ const ::rtl::OUString& lcl_getSingleColorViewURL()
+ {
+ static ::rtl::OUString s_sSingleColorViewURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolpanel/SingleColorView" ) );
+ return s_sSingleColorViewURL;
+ }
+ }
+
+ //==================================================================================================================
+ //= ResourceFactory
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ ResourceFactory::ResourceFactory( const Reference< XComponentContext >& i_rContext )
+ :m_xContext( i_rContext )
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ResourceFactory::~ResourceFactory()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XResource > SAL_CALL ResourceFactory::createResource( const Reference< XResourceId >& i_rResourceId ) throw (RuntimeException, IllegalArgumentException, WrappedTargetException)
+ {
+ FactoryGuard aGuard( *this );
+ if ( !i_rResourceId.is() )
+ throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "illegal resource ID" ), *this, 1 );
+
+ const ::rtl::OUString sResourceURL( i_rResourceId->getResourceURL() );
+ if ( sResourceURL != lcl_getSingleColorViewURL() )
+ throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "unsupported resource URL" ), *this, 1 );
+
+ return new SingleColorPanel( m_xContext, m_xControllerManager->getConfigurationController(), i_rResourceId );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ResourceFactory::releaseResource( const Reference< XResource >& i_rResource ) throw (RuntimeException)
+ {
+ FactoryGuard aGuard( *this );
+
+ // here, we could decide to actually not destroy the resource, but cache it. In this case, we would need
+ // to re-parent the VCL window to another, temporary window, or *at least* hide it.
+
+ // However, for the simplicity of this example, we will simply dispose the component here, which will destroy
+ // all associated resources, including the VCL window.
+ Reference< XComponent > xComponent( i_rResource, UNO_QUERY_THROW );
+ xComponent->dispose();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ResourceFactory::getImplementationName( ) throw (RuntimeException)
+ {
+ return getImplementationName_static();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::rtl::OUString SAL_CALL ResourceFactory::getImplementationName_static( ) throw (RuntimeException)
+ {
+ return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.comp.example.colorpanel.ResourceFactory" ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL ResourceFactory::supportsService( const ::rtl::OUString& i_rServiceName ) throw (RuntimeException)
+ {
+ const Sequence< ::rtl::OUString > aServiceNames( getSupportedServiceNames() );
+ for ( const ::rtl::OUString* serviceName = aServiceNames.getConstArray();
+ serviceName != aServiceNames.getConstArray() + aServiceNames.getLength();
+ ++serviceName
+ )
+ {
+ if ( i_rServiceName == *serviceName )
+ return sal_True;
+ }
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL ResourceFactory::getSupportedServiceNames() throw (RuntimeException)
+ {
+ return getSupportedServiceNames_static();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Sequence< ::rtl::OUString > SAL_CALL ResourceFactory::getSupportedServiceNames_static() throw (RuntimeException)
+ {
+ Sequence< ::rtl::OUString > aServiceNames(1);
+ aServiceNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.example.colorpanel.ResourceFactory" ) );
+ return aServiceNames;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XInterface > SAL_CALL ResourceFactory::Create( const Reference< XComponentContext >& i_rContext ) throw (RuntimeException)
+ {
+ return *( new ResourceFactory( i_rContext ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ResourceFactory::checkInitialized( GuardAccess ) const
+ {
+ if ( !m_xControllerManager.is() )
+ throw NotInitializedException( ::rtl::OUString(), *const_cast< ResourceFactory* >( this ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void ResourceFactory::checkDisposed( GuardAccess ) const
+ {
+ // cannot be disposed currently ...
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL ResourceFactory::initialize( const Sequence< Any >& i_rArguments ) throw (Exception, RuntimeException)
+ {
+ if ( !i_rArguments.getLength() )
+ throw IllegalArgumentException();
+
+ FactoryGuard aGuard( *this, false );
+ m_xControllerManager.set( i_rArguments[0], UNO_QUERY_THROW );
+
+ Reference< XResourceFactoryManager > xFactoryManager( m_xControllerManager->getConfigurationController(), UNO_QUERY_THROW );
+ xFactoryManager->addResourceFactory( lcl_getSingleColorViewURL(), this );
+ }
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
diff --git a/sd/workben/custompanel/ctp_factory.hxx b/sd/workben/custompanel/ctp_factory.hxx
new file mode 100644
index 000000000000..ab6cb3f6a9db
--- /dev/null
+++ b/sd/workben/custompanel/ctp_factory.hxx
@@ -0,0 +1,114 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_WORKBENCH_CTP_FACTORY_HXX
+#define SD_WORKBENCH_CTP_FACTORY_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/drawing/framework/XResourceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/drawing/framework/XControllerManager.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ class FactoryGuard;
+
+ //==================================================================================================================
+ //= ResourceFactory
+ //==================================================================================================================
+ typedef ::cppu::WeakImplHelper3 < ::com::sun::star::drawing::framework::XResourceFactory
+ , ::com::sun::star::lang::XServiceInfo
+ , ::com::sun::star::lang::XInitialization
+ > ResourceFactory_Base;
+ class ResourceFactory :public ::cppu::BaseMutex
+ ,public ResourceFactory_Base
+ {
+ public:
+ ResourceFactory(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext
+ );
+ ~ResourceFactory();
+
+ // XResourceFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResource > SAL_CALL createResource( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& xResourceId ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException);
+ virtual void SAL_CALL releaseResource( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResource >& xResource ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo - static versions
+ static ::rtl::OUString SAL_CALL getImplementationName_static( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static( ) throw (::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ public:
+ struct GuardAccess { friend class FactoryGuard; private: GuardAccess() { } };
+
+ void checkInitialized( GuardAccess ) const;
+ void checkDisposed( GuardAccess ) const;
+ ::osl::Mutex& getMutex( GuardAccess ) { return m_aMutex; }
+
+ private:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XControllerManager >
+ m_xControllerManager;
+ };
+
+ class FactoryGuard
+ {
+ public:
+ FactoryGuard( ResourceFactory& i_rFactory, const bool i_bNeedInit = true )
+ :m_aGuard( i_rFactory.getMutex( ResourceFactory::GuardAccess() ) )
+ {
+ i_rFactory.checkDisposed( ResourceFactory::GuardAccess() );
+ if ( i_bNeedInit )
+ i_rFactory.checkInitialized( ResourceFactory::GuardAccess() );
+ }
+
+ protected:
+ ::osl::MutexGuard m_aGuard;
+ };
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
+
+#endif // SD_WORKBENCH_CTP_FACTORY_HXX
diff --git a/sd/workben/custompanel/ctp_panel.cxx b/sd/workben/custompanel/ctp_panel.cxx
new file mode 100644
index 000000000000..7fb8ed8aeabe
--- /dev/null
+++ b/sd/workben/custompanel/ctp_panel.cxx
@@ -0,0 +1,239 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "ctp_panel.hxx"
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/XPane.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/WindowClass.hpp>
+#include <com/sun/star/awt/WindowAttribute.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/awt/XGraphics.hpp>
+/** === end UNO includes === **/
+
+#include <tools/diagnose_ex.h>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::drawing::framework::XConfigurationController;
+ using ::com::sun::star::drawing::framework::XResourceId;
+ using ::com::sun::star::uno::XComponentContext;
+ using ::com::sun::star::drawing::framework::XPane;
+ using ::com::sun::star::awt::XWindow;
+ using ::com::sun::star::rendering::XCanvas;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::awt::XWindowPeer;
+ using ::com::sun::star::lang::XMultiComponentFactory;
+ using ::com::sun::star::awt::XToolkit;
+ using ::com::sun::star::awt::WindowDescriptor;
+ using ::com::sun::star::awt::WindowClass_SIMPLE;
+ using ::com::sun::star::awt::Rectangle;
+ using ::com::sun::star::awt::PaintEvent;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::XDevice;
+ using ::com::sun::star::awt::XGraphics;
+ /** === end UNO using === **/
+ namespace WindowAttribute = ::com::sun::star::awt::WindowAttribute;
+ namespace PosSize = ::com::sun::star::awt::PosSize;
+
+ //==================================================================================================================
+ //= helpers
+ //==================================================================================================================
+ namespace
+ {
+ Reference< XWindow > lcl_createPlainWindow_nothrow( const Reference< XComponentContext >& i_rContext,
+ const Reference< XWindowPeer >& i_rParentWindow )
+ {
+ try
+ {
+ ENSURE_OR_THROW( i_rContext.is(), "illegal component context" );
+ Reference< XMultiComponentFactory > xFactory( i_rContext->getServiceManager(), UNO_SET_THROW );
+ Reference< XToolkit > xToolkit( xFactory->createInstanceWithContext(
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ),
+ i_rContext
+ ), UNO_QUERY_THROW );
+
+ WindowDescriptor aWindow;
+ aWindow.Type = WindowClass_SIMPLE;
+ aWindow.WindowServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "window" ) );
+ aWindow.Parent = i_rParentWindow;
+ aWindow.WindowAttributes = WindowAttribute::BORDER;
+
+ Reference< XWindowPeer > xWindow( xToolkit->createWindow( aWindow ), UNO_SET_THROW );
+ return Reference< XWindow >( xWindow, UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return NULL;
+ }
+ }
+ //==================================================================================================================
+ //= class SingleColorPanel
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ SingleColorPanel::SingleColorPanel( const Reference< XComponentContext >& i_rContext,
+ const Reference< XConfigurationController >& i_rConfigController, const Reference< XResourceId >& i_rResourceId )
+ :SingleColorPanel_Base( m_aMutex )
+ ,m_xContext( i_rContext )
+ ,m_xResourceId( i_rResourceId )
+ ,m_xWindow()
+ {
+ ENSURE_OR_THROW( i_rConfigController.is(), "invalid configuration controller" );
+ ENSURE_OR_THROW( m_xResourceId.is(), "invalid resource id" );
+
+ // retrieve the parent window for our to-be-created pane window
+ Reference< XWindow > xParentWindow;
+ Reference< XWindowPeer > xParentPeer;
+ try
+ {
+ Reference< XResource > xAnchor( i_rConfigController->getResource( m_xResourceId->getAnchor() ), UNO_SET_THROW );
+ Reference< XPane > xAnchorPane( xAnchor, UNO_QUERY_THROW );
+ xParentWindow.set( xAnchorPane->getWindow(), UNO_SET_THROW );
+ xParentPeer.set( xParentWindow, UNO_QUERY_THROW );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ osl_incrementInterlockedCount( &m_refCount );
+ if ( xParentWindow.is() )
+ {
+ m_xWindow = lcl_createPlainWindow_nothrow( m_xContext, xParentPeer );
+ m_xWindow->addPaintListener( this );
+ if ( m_xWindow.is() )
+ {
+ const Rectangle aPanelAnchorSize( xParentWindow->getPosSize() );
+ m_xWindow->setPosSize( 0, 0, aPanelAnchorSize.Width, aPanelAnchorSize.Height, PosSize::POSSIZE );
+ m_xWindow->setVisible( sal_True );
+ }
+ }
+ osl_decrementInterlockedCount( &m_refCount );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ SingleColorPanel::~SingleColorPanel()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XWindow > SAL_CALL SingleColorPanel::getWindow( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.get() )
+ throw DisposedException( ::rtl::OUString(), *this );
+ return m_xWindow;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ Reference< XResourceId > SAL_CALL SingleColorPanel::getResourceId( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ throw DisposedException( ::rtl::OUString(), *this );
+ return m_xResourceId;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL SingleColorPanel::isAnchorOnly( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ throw DisposedException( ::rtl::OUString(), *this );
+ return sal_False;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SingleColorPanel::windowPaint( const PaintEvent& i_rEvent ) throw (RuntimeException)
+ {
+ try
+ {
+ const Reference< XDevice > xDevice( i_rEvent.Source, UNO_QUERY_THROW );
+ const Reference< XGraphics > xGraphics( xDevice->createGraphics(), UNO_SET_THROW );
+ xGraphics->setFillColor( 0x80 << 8 );
+ xGraphics->setLineColor( 0x80 << 16 );
+
+ const Reference< XWindow > xWindow( i_rEvent.Source, UNO_QUERY_THROW );
+ const Rectangle aWindowRect( xWindow->getPosSize() );
+ xGraphics->drawRect( 0, 0, aWindowRect.Width - 1, aWindowRect.Height - 1 );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SingleColorPanel::disposing( const EventObject& i_rSource ) throw (RuntimeException)
+ {
+ (void)i_rSource;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL SingleColorPanel::disposing()
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_xWindow.is() )
+ // already disposed
+ return;
+ m_xWindow->removePaintListener( this );
+ try
+ {
+ Reference< XComponent > xWindowComp( m_xWindow, UNO_QUERY_THROW );
+ xWindowComp->dispose();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ m_xWindow.clear();
+ }
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
diff --git a/sd/workben/custompanel/ctp_panel.hxx b/sd/workben/custompanel/ctp_panel.hxx
new file mode 100644
index 000000000000..f991cc80516c
--- /dev/null
+++ b/sd/workben/custompanel/ctp_panel.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#ifndef SD_WORKBENCH_CTP_PANEL_HXX
+#define SD_WORKBENCH_CTP_PANEL_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/drawing/framework/XView.hpp>
+#include <com/sun/star/view/XToolPanel.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/drawing/framework/XConfigurationController.hpp>
+#include <com/sun/star/drawing/framework/XResourceId.hpp>
+#include <com/sun/star/awt/XPaintListener.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/compbase3.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= class SingleColorPanel
+ //==================================================================================================================
+ typedef ::cppu::WeakComponentImplHelper3 < ::com::sun::star::drawing::framework::XView
+ , ::com::sun::star::view::XToolPanel
+ , ::com::sun::star::awt::XPaintListener
+ > SingleColorPanel_Base;
+ class SingleColorPanel :public ::cppu::BaseMutex
+ ,public SingleColorPanel_Base
+ {
+ public:
+ SingleColorPanel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& i_rContext,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XConfigurationController >& i_rConfigController,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId >& i_rResourceId
+ );
+
+ // XToolPanel
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > SAL_CALL getWindow( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XView
+ // (no methods)
+
+ // XResource
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId > SAL_CALL getResourceId( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL isAnchorOnly( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XPaintListener
+ virtual void SAL_CALL windowPaint( const ::com::sun::star::awt::PaintEvent& e ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XComponent equivalents
+ virtual void SAL_CALL disposing();
+
+ protected:
+ ~SingleColorPanel();
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XResourceId > m_xResourceId;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xWindow;
+ };
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
+
+#endif // SD_WORKBENCH_CTP_PANEL_HXX
diff --git a/sd/workben/custompanel/ctp_services.cxx b/sd/workben/custompanel/ctp_services.cxx
new file mode 100644
index 000000000000..67fd5af14c7b
--- /dev/null
+++ b/sd/workben/custompanel/ctp_services.cxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * 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.
+ *
+ * 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).
+ *
+ * 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.
+ *
+************************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "ctp_factory.hxx"
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <cppuhelper/implementationentry.hxx>
+
+//......................................................................................................................
+namespace sd { namespace colortoolpanel
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= descriptors for the services implemented in this component
+ //==================================================================================================================
+ static struct ::cppu::ImplementationEntry s_aServiceEntries[] =
+ {
+ {
+ ResourceFactory::Create,
+ ResourceFactory::getImplementationName_static,
+ ResourceFactory::getSupportedServiceNames_static,
+ ::cppu::createSingleComponentFactory, NULL, 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+ };
+
+//......................................................................................................................
+} } // namespace sd::colortoolpanel
+//......................................................................................................................
+
+extern "C"
+{
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ sal_Bool SAL_CALL component_writeInfo( void * pServiceManager, void * pRegistryKey )
+ {
+ return ::cppu::component_writeInfoHelper( pServiceManager, pRegistryKey, ::sd::colortoolpanel::s_aServiceEntries );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
+ {
+ return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries );
+ }
+}
diff --git a/sd/workben/custompanel/delzip b/sd/workben/custompanel/delzip
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sd/workben/custompanel/delzip
diff --git a/sd/workben/custompanel/description.xml b/sd/workben/custompanel/description.xml
new file mode 100644
index 000000000000..a1dbdf4f125d
--- /dev/null
+++ b/sd/workben/custompanel/description.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<description
+ xmlns="http://openoffice.org/extensions/description/2006"
+ xmlns:d="http://openoffice.org/extensions/description/2006"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <identifier value="UPDATED_IDENTIFIER"/>
+ <version value="0.1" />
+ <platform value="UPDATED_SUPPORTED_PLATFORM" />
+ <display-name>
+ <name lang="en-US">Custom Tool Panel Example</name>
+ </display-name>
+ <dependencies>
+ <OpenOffice.org-minimal-version value="3.2" d:name="OpenOffice.org 3.2"/>
+ </dependencies>
+</description>
diff --git a/sd/workben/custompanel/makefile.mk b/sd/workben/custompanel/makefile.mk
new file mode 100644
index 000000000000..6df3190892f8
--- /dev/null
+++ b/sd/workben/custompanel/makefile.mk
@@ -0,0 +1,93 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# 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.
+#
+# 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).
+#
+# 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.
+#
+#*************************************************************************
+
+PRJ=../..
+PRJNAME=sd
+
+TARGET=colorpanel
+ENABLE_EXCEPTIONS=TRUE
+LIBTARGET=NO
+EXTENSIONNAME:=colored-tool-panel
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#-------------------------------------------------------------------
+
+#---- extension version
+EXTENSION_VERSION_BASE=0.1
+.IF ( "$(CWS_WORK_STAMP)" == "" ) || ( "$(UPDATER)" == "YES" )
+ EXTENSION_VERSION=$(EXTENSION_VERSION_BASE)
+.ELSE
+ EXTENSION_VERSION=$(EXTENSION_VERSION_BASE).cws.$(CWS_WORK_STAMP)
+.ENDIF
+
+#---- extension title package name
+EXTENSION_TITLE=Custom Tool Panel Example
+EXTENSION_ZIPNAME=$(EXTENSIONNAME)-$(EXTENSION_VERSION_BASE)-$(RTL_OS:l)-$(RTL_ARCH:l)
+
+#--------------------------------------------------
+
+SHL1DLLPRE=
+SHL1TARGET=$(TARGET).uno
+LIB1TARGET=$(SLB)/$(SHL1TARGET).lib
+LIB1OBJFILES= \
+ $(SLO)/ctp_factory.obj \
+ $(SLO)/ctp_services.obj \
+ $(SLO)/ctp_panel.obj
+
+SHL1STDLIBS= \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(SALHELPERLIB) \
+ $(CPPUHELPERLIB)
+
+SHL1VERSIONMAP=$(TARGET).map
+SHL1LIBS= $(LIB1TARGET)
+SHL1DEF= $(MISC)/$(SHL1TARGET).def
+SHL1RPATH= OXT
+DEF1NAME= $(SHL1TARGET)
+
+# create Extension -----------------------------
+
+COMPONENT_CONFIGDEST=.
+
+COMPONENT_XCU = \
+ $(EXTENSIONDIR)/Impress.xcu
+
+COMPONENT_LIBRARIES = \
+ $(EXTENSIONDIR)$/$(SHL1TARGET)$(DLLPOST)
+
+# ........ dependencies for packaging the extension ........
+EXTENSION_PACKDEPS=makefile.mk
+
+# --- Targets ------------------------------------------------------
+.INCLUDE : extension_pre.mk
+.INCLUDE : target.mk
+.INCLUDE : extension_post.mk
+
diff --git a/sd/workben/custompanel/manifest.xml b/sd/workben/custompanel/manifest.xml
new file mode 100644
index 000000000000..96f62afe4e27
--- /dev/null
+++ b/sd/workben/custompanel/manifest.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=native"
+ manifest:full-path="colorpanel.unoSHARED_EXTENSION"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+ manifest:full-path="Impress.xcu"/>
+</manifest:manifest>