diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2013-04-10 08:20:16 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:10 +0100 |
commit | d02f75a8c36705924ddd6a5921fe3012fafce812 (patch) | |
tree | 40da9f25714a77f5e9e17ef7bee81c33a1a11b4b /include/sfx2 | |
parent | d8d55787b81cdc955b73c8befa4ab608f46e32aa (diff) |
Resolves: #i121420# merge sidebar feature
(cherry picked from commit 0a0a9b32aa5bf1ce2554ad37cbba3c7a105db2b5)
Conflicts:
chart2/source/controller/dialogs/dlg_View3D.cxx
chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
chart2/source/controller/inc/ViewElementListProvider.hxx
chart2/source/controller/inc/dlg_View3D.hxx
chart2/source/controller/main/ShapeController.cxx
chart2/source/inc/chartview/DrawModelWrapper.hxx
chart2/source/view/main/DrawModelWrapper.cxx
cui/source/inc/border.hxx
cui/source/inc/cuitabarea.hxx
cui/source/inc/cuitabline.hxx
cui/source/inc/sdrcelldlg.hxx
cui/source/inc/treeopt.hxx
cui/source/options/optchart.cxx
cui/source/options/optchart.hxx
cui/source/options/optcolor.cxx
cui/source/options/treeopt.cxx
cui/source/tabpages/backgrnd.cxx
cui/source/tabpages/border.cxx
cui/source/tabpages/chardlg.cxx
cui/source/tabpages/numpages.cxx
cui/source/tabpages/tpcolor.cxx
cui/source/tabpages/tplneend.cxx
editeng/inc/editeng/outliner.hxx
extensions/source/propctrlr/standardcontrol.cxx
framework/source/register/registerservices.cxx
offapi/com/sun/star/ui/makefile.mk
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
officecfg/registry/data/org/openoffice/Office/UI/makefile.mk
officecfg/registry/schema/org/openoffice/Office/UI/makefile.mk
postprocess/packregistry/makefile.mk
reportdesign/source/ui/dlg/Condition.cxx
reportdesign/source/ui/misc/UITools.cxx
sc/inc/document.hxx
sc/inc/helpids.h
sc/inc/sc.hrc
sc/prj/build.lst
sc/sdi/scalc.sdi
sc/source/core/data/documen9.cxx
sc/source/core/data/drwlayer.cxx
sc/source/ui/app/scdll.cxx
sc/source/ui/app/typemap.cxx
sc/source/ui/dbgui/scendlg.cxx
sc/source/ui/docshell/docsh2.cxx
sc/source/ui/docshell/docsh4.cxx
sc/source/ui/drawfunc/chartsh.cxx
sc/source/ui/drawfunc/drawsh.cxx
sc/source/ui/drawfunc/drawsh2.cxx
sc/source/ui/drawfunc/drawsh4.cxx
sc/source/ui/drawfunc/drformsh.cxx
sc/source/ui/drawfunc/drtxtob.cxx
sc/source/ui/drawfunc/drtxtob1.cxx
sc/source/ui/drawfunc/drtxtob2.cxx
sc/source/ui/drawfunc/graphsh.cxx
sc/source/ui/drawfunc/oleobjsh.cxx
sc/source/ui/inc/chartsh.hxx
sc/source/ui/inc/formatsh.hxx
sc/source/ui/miscdlgs/tabbgcolordlg.cxx
sc/source/ui/navipi/navipi.cxx
sc/source/ui/optdlg/opredlin.cxx
sc/source/ui/optdlg/tpview.cxx
sc/source/ui/sidebar/makefile.mk
sc/source/ui/view/auditsh.cxx
sc/source/ui/view/cellsh.cxx
sc/source/ui/view/editsh.cxx
sc/source/ui/view/formatsh.cxx
sc/source/ui/view/pivotsh.cxx
sc/source/ui/view/tabvwsh.cxx
sc/util/makefile.mk
sd/inc/sdabstdlg.hxx
sd/prj/build.lst
sd/sdi/ToolPanelViewShell.sdi
sd/sdi/makefile.mk
sd/source/ui/accessibility/makefile.mk
sd/source/ui/animations/CustomAnimationDialog.cxx
sd/source/ui/dlg/PaneChildWindows.cxx
sd/source/ui/dlg/PaneShells.cxx
sd/source/ui/dlg/copydlg.cxx
sd/source/ui/dlg/navigatr.cxx
sd/source/ui/dlg/sddlgfact.cxx
sd/source/ui/dlg/sddlgfact.hxx
sd/source/ui/docshell/docshel3.cxx
sd/source/ui/framework/configuration/ConfigurationControllerResourceManager.cxx
sd/source/ui/framework/factories/TaskPanelFactory.cxx
sd/source/ui/framework/factories/TaskPanelFactory.hxx
sd/source/ui/framework/factories/ViewShellWrapper.cxx
sd/source/ui/framework/factories/makefile.mk
sd/source/ui/framework/module/ImpressModule.cxx
sd/source/ui/framework/module/ToolPanelModule.cxx
sd/source/ui/framework/tools/FrameworkHelper.cxx
sd/source/ui/func/fuolbull.cxx
sd/source/ui/inc/DrawViewShell.hxx
sd/source/ui/inc/PaneChildWindows.hxx
sd/source/ui/inc/celltempl.hxx
sd/source/ui/inc/copydlg.hxx
sd/source/ui/inc/dlgpage.hxx
sd/source/ui/inc/framework/FrameworkHelper.hxx
sd/source/ui/inc/prltempl.hxx
sd/source/ui/inc/tabtempl.hxx
sd/source/ui/inc/taskpane/ILayoutableWindow.hxx
sd/source/ui/inc/taskpane/PanelId.hxx
sd/source/ui/inc/tpaction.hxx
sd/source/ui/sidebar/AllMasterPagesSelector.cxx
sd/source/ui/sidebar/AllMasterPagesSelector.hxx
sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
sd/source/ui/sidebar/DocumentHelper.cxx
sd/source/ui/sidebar/DocumentHelper.hxx
sd/source/ui/sidebar/LayoutMenu.cxx
sd/source/ui/sidebar/LayoutMenu.hxx
sd/source/ui/sidebar/MasterPageContainer.cxx
sd/source/ui/sidebar/MasterPageContainer.hxx
sd/source/ui/sidebar/MasterPageContainerFiller.cxx
sd/source/ui/sidebar/MasterPageContainerFiller.hxx
sd/source/ui/sidebar/MasterPageContainerProviders.cxx
sd/source/ui/sidebar/MasterPageContainerProviders.hxx
sd/source/ui/sidebar/MasterPageContainerQueue.cxx
sd/source/ui/sidebar/MasterPageContainerQueue.hxx
sd/source/ui/sidebar/MasterPageDescriptor.cxx
sd/source/ui/sidebar/MasterPageDescriptor.hxx
sd/source/ui/sidebar/MasterPageObserver.cxx
sd/source/ui/sidebar/MasterPagesSelector.cxx
sd/source/ui/sidebar/MasterPagesSelector.hxx
sd/source/ui/sidebar/PreviewValueSet.cxx
sd/source/ui/sidebar/PreviewValueSet.hxx
sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
sd/source/ui/sidebar/SidebarShellManager.cxx
sd/source/ui/sidebar/SlideTransitionPanel.hxx
sd/source/ui/sidebar/makefile.mk
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
sd/source/ui/table/TableDesignPane.hxx
sd/source/ui/toolpanel/ControlContainer.cxx
sd/source/ui/toolpanel/ControlContainerDescriptor.hxx
sd/source/ui/toolpanel/MethodGuard.hxx
sd/source/ui/toolpanel/ScrollPanel.cxx
sd/source/ui/toolpanel/SlideSorterCacheDisplay.cxx
sd/source/ui/toolpanel/SubToolPanel.cxx
sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
sd/source/ui/toolpanel/TaskPaneTreeNode.cxx
sd/source/ui/toolpanel/TitleBar.cxx
sd/source/ui/toolpanel/TitledControl.cxx
sd/source/ui/toolpanel/ToolPanel.cxx
sd/source/ui/toolpanel/ToolPanel.hxx
sd/source/ui/toolpanel/ToolPanelFactory.cxx
sd/source/ui/toolpanel/ToolPanelUIElement.cxx
sd/source/ui/toolpanel/ToolPanelUIElement.hxx
sd/source/ui/toolpanel/ToolPanelViewShell.cxx
sd/source/ui/toolpanel/controls/CustomAnimationPanel.cxx
sd/source/ui/toolpanel/controls/CustomAnimationPanel.hxx
sd/source/ui/toolpanel/controls/MasterPagesPanel.cxx
sd/source/ui/toolpanel/controls/MasterPagesPanel.hxx
sd/source/ui/toolpanel/controls/SlideTransitionPanel.cxx
sd/source/ui/toolpanel/controls/SlideTransitionPanel.hxx
sd/source/ui/toolpanel/controls/TableDesignPanel.cxx
sd/source/ui/toolpanel/controls/TableDesignPanel.hxx
sd/source/ui/unoidl/UnoDocumentSettings.cxx
sd/source/ui/view/ViewShellBase.cxx
sd/source/ui/view/drtxtob.cxx
sd/source/ui/view/drviews3.cxx
sd/source/ui/view/drviews7.cxx
sd/source/ui/view/drviewsa.cxx
sd/source/ui/view/drviewsf.cxx
sd/source/ui/view/outlnvsh.cxx
sd/source/ui/view/sdview.cxx
sd/source/ui/view/viewshel.cxx
sd/uiconfig/sdraw/menubar/menubar.xml
sd/util/makefile.mk
sfx2/Package_inc.mk
sfx2/inc/sfx2/sfx.hrc
sfx2/inc/sfx2/sfxsids.hrc
sfx2/source/control/bindings.cxx
sfx2/source/dialog/templdlg.cxx
sfx2/source/inc/templdgi.hxx
svx/AllLangResTarget_svx.mk
svx/Package_inc.mk
svx/inc/svx/XPropertyTable.hxx
svx/inc/svx/bmpmask.hxx
svx/inc/svx/colrctrl.hxx
svx/inc/svx/dialogs.hrc
svx/inc/svx/dlgctrl.hxx
svx/inc/svx/dlgutil.hxx
svx/inc/svx/drawitem.hxx
svx/inc/svx/fontwork.hxx
svx/inc/svx/galbrws.hxx
svx/inc/svx/sdr/table/tablecontroller.hxx
svx/inc/svx/svdmodel.hxx
svx/inc/svx/svdstr.hrc
svx/inc/svx/svxids.hrc
svx/inc/svx/svxitems.hrc
svx/inc/svx/xattr.hxx
svx/inc/svx/xflgrit.hxx
svx/inc/svx/xflhtit.hxx
svx/inc/svx/xit.hxx
svx/inc/svx/xlineit.hxx
svx/inc/svx/xlndsit.hxx
svx/inc/svx/xlnedit.hxx
svx/inc/svx/xlnstit.hxx
svx/inc/svx/xtable.hxx
svx/sdi/svx.sdi
svx/source/dialog/_bmpmask.cxx
svx/source/dialog/dialcontrol.cxx
svx/source/dialog/dlgctrl.cxx
svx/source/dialog/dlgutil.cxx
svx/source/dialog/fontwork.cxx
svx/source/gallery2/galbrws.cxx
svx/source/gallery2/galbrws1.cxx
svx/source/gallery2/gallery1.cxx
svx/source/items/drawitem.cxx
svx/source/items/svxitems.src
svx/source/sdr/attribute/sdrformtextattribute.cxx
svx/source/sidebar/ColorPanel.hxx
svx/source/sidebar/EmptyPanel.hrc
svx/source/sidebar/EmptyPanel.hxx
svx/source/sidebar/gallery/GalleryPanel.hxx
svx/source/svdraw/svdedtv1.cxx
svx/source/svdraw/svdmodel.cxx
svx/source/svdraw/svdogrp.cxx
svx/source/svdraw/svdstr.src
svx/source/tbxctrls/tbcontrl.cxx
svx/source/unodraw/XPropertyTable.cxx
svx/source/unodraw/unoctabl.cxx
svx/source/xoutdev/XPropertyEntry.cxx
svx/source/xoutdev/xattr.cxx
svx/source/xoutdev/xattr2.cxx
svx/source/xoutdev/xtabbtmp.cxx
svx/source/xoutdev/xtabcolr.cxx
svx/source/xoutdev/xtabdash.cxx
svx/source/xoutdev/xtabgrdt.cxx
svx/source/xoutdev/xtabhtch.cxx
svx/source/xoutdev/xtable.cxx
svx/source/xoutdev/xtablend.cxx
svx/util/svx.component
sw/inc/cmdid.h
sw/inc/docsh.hxx
sw/inc/editsh.hxx
sw/inc/helpid.h
sw/inc/rcid.hrc
sw/inc/swabstdlg.hxx
sw/inc/swcommands.h
sw/sdi/swriter.sdi
sw/source/core/doc/docdesc.cxx
sw/source/core/draw/drawdoc.cxx
sw/source/ui/app/docsh2.cxx
sw/source/ui/app/docshdrw.cxx
sw/source/ui/app/docshini.cxx
sw/source/ui/app/docst.cxx
sw/source/ui/config/optpage.cxx
sw/source/ui/dialog/swdlgfact.cxx
sw/source/ui/dialog/swdlgfact.hxx
sw/source/ui/fmtui/tmpdlg.cxx
sw/source/ui/inc/tmpdlg.hxx
sw/source/ui/misc/pggrid.cxx
sw/source/ui/shells/annotsh.cxx
sw/source/ui/shells/basesh.cxx
sw/source/ui/shells/beziersh.cxx
sw/source/ui/shells/drawdlg.cxx
sw/source/ui/shells/drawsh.cxx
sw/source/ui/shells/drformsh.cxx
sw/source/ui/shells/drwbassh.cxx
sw/source/ui/shells/drwtxtex.cxx
sw/source/ui/shells/drwtxtsh.cxx
sw/source/ui/shells/frmsh.cxx
sw/source/ui/shells/grfsh.cxx
sw/source/ui/shells/olesh.cxx
sw/source/ui/shells/tabsh.cxx
sw/source/ui/shells/textsh.cxx
sw/source/ui/shells/textsh1.cxx
sw/source/ui/shells/txtnum.cxx
sw/source/ui/uiview/viewtab.cxx
sw/source/ui/uno/unofreg.cxx
sw/source/ui/utlui/navipi.cxx
sw/util/sw.component
vcl/inc/vcl/split.hxx
vcl/inc/vcl/window.hxx
vcl/inc/window.h
vcl/source/window/split.cxx
vcl/source/window/window.cxx
vcl/source/window/window4.cxx
Change-Id: Idebaff59f9d60e4e93290cefefdda4c5a1e9215e
Resolves: #i122194# Adapted license text in propertypanel.hrc
then renamed it to ResourceDefinitions.hrc
(cherry picked from commit e952d1401c1adc41934118ba7f542611ef9da11b)
Conflicts:
sfx2/Package_inc.mk
sfx2/source/sidebar/SidebarChildWindow.cxx
svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
svx/source/sidebar/line/LinePropertyPanel.cxx
svx/source/sidebar/possize/PosSizePropertyPanel.cxx
sw/source/ui/sidebar/PagePropertyPanel.src
sw/source/ui/sidebar/WrapPropertyPanel.src
Change-Id: Ie009056a78ab108556717a501399c83b477b3548
Resolves: #i122194# finally I got the correct file name
Change-Id: If7a075af8c9a829f6f0a69f883c5c6d4ac97ba2a
More merge changes for optional sidebar:
revert toolpanel removal, restore and re-enable task pane
remove apparently un-used SidebarFactory module
add extra visibility annotation to ItemReceiverUpdate
Diffstat (limited to 'include/sfx2')
-rw-r--r-- | include/sfx2/navigat.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/sfx.hrc | 1 | ||||
-rw-r--r-- | include/sfx2/sfxsids.hrc | 1 | ||||
-rw-r--r-- | include/sfx2/shell.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/sidebar/ContextChangeBroadcaster.hxx | 58 | ||||
-rw-r--r-- | include/sfx2/sidebar/ControlFactory.hxx | 46 | ||||
-rw-r--r-- | include/sfx2/sidebar/ControllerItem.hxx | 55 | ||||
-rw-r--r-- | include/sfx2/sidebar/EnumContext.hxx | 169 | ||||
-rw-r--r-- | include/sfx2/sidebar/IContextChangeReceiver.hxx | 37 | ||||
-rw-r--r-- | include/sfx2/sidebar/ILayoutableWindow.hxx | 44 | ||||
-rw-r--r-- | include/sfx2/sidebar/PopupContainer.hxx | 37 | ||||
-rw-r--r-- | include/sfx2/sidebar/ResourceDefinitions.hrc | 141 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarChildWindow.hxx | 48 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarPanelBase.hxx | 124 | ||||
-rw-r--r-- | include/sfx2/sidebar/Theme.hxx | 278 | ||||
-rw-r--r-- | include/sfx2/styfitem.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/templdlg.hxx | 26 |
17 files changed, 1067 insertions, 5 deletions
diff --git a/include/sfx2/navigat.hxx b/include/sfx2/navigat.hxx index b1cada954d2b..7f0dc928818e 100644 --- a/include/sfx2/navigat.hxx +++ b/include/sfx2/navigat.hxx @@ -35,7 +35,7 @@ public: SFX_DECL_CHILDWINDOW(SfxNavigatorWrapper); }; -class SfxNavigator : public SfxDockingWindow +class SFX2_DLLPUBLIC SfxNavigator : public SfxDockingWindow { SfxChildWindow* pWrapper; diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc index b018a73b212d..7d1fc0a4a286 100644 --- a/include/sfx2/sfx.hrc +++ b/include/sfx2/sfx.hrc @@ -98,6 +98,7 @@ #define RID_SFX_SFXLOCAL_START (RID_SFX_START + 3082) #define RID_SFX_VIEW_START (RID_SFX_START + 4096) +#define RID_SFX_SIDEBAR_START (RID_SFX_START + 4150) // RID_CNT_START2 (RID_SFX_START + 4500) // RID_SFX_CHAOSDOC_START (RID_SFX_START + 5120) // RID_SFX_TPLCOMPONENT_START (RID_SFX_START + 6800) diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index cd25c9ea05b7..c838c32b6f82 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -596,6 +596,7 @@ #define SID_SEARCH_OPTIONS (SID_SVX_START + 281) #define SID_ZOOM (SID_SVX_START + 289) #define SID_SEARCH_ITEM (SID_SVX_START + 291) +#define SID_SIDEBAR (SID_SVX_START + 336) #define SID_HYPERLINK_GETLINK (SID_SVX_START + 361) #define SID_HYPERLINK_SETLINK (SID_SVX_START + 362) #define SID_INFOBARCONTAINER (SID_SVX_START + 365) diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx index cba6efaf8e36..cb5b149714df 100644 --- a/include/sfx2/shell.hxx +++ b/include/sfx2/shell.hxx @@ -238,6 +238,8 @@ public: virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ); virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ); + void SetContextName (const ::rtl::OUString& rsContextName); + #ifndef _SFXSH_HXX SAL_DLLPRIVATE bool CanExecuteSlot_Impl( const SfxSlot &rSlot ); SAL_DLLPRIVATE void DoActivate_Impl( SfxViewFrame *pFrame, sal_Bool bMDI); diff --git a/include/sfx2/sidebar/ContextChangeBroadcaster.hxx b/include/sfx2/sidebar/ContextChangeBroadcaster.hxx new file mode 100644 index 000000000000..08696316430d --- /dev/null +++ b/include/sfx2/sidebar/ContextChangeBroadcaster.hxx @@ -0,0 +1,58 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_CONTEXT_CHANGE_BROADCASTER_HXX +#define SFX_SIDEBAR_CONTEXT_CHANGE_BROADCASTER_HXX + +#include <com/sun/star/frame/XFrame.hpp> + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + +namespace sfx2 { namespace sidebar { + + +/** This class is a helper for broadcasting context changes that are + tied to shells being activated or deactivated. +*/ +class ContextChangeBroadcaster +{ +public: + ContextChangeBroadcaster (void); + ~ContextChangeBroadcaster (void); + + void Initialize (const ::rtl::OUString& rsContextName); + + void Activate (const cssu::Reference<css::frame::XFrame>& rxFrame); + void Deactivate (const cssu::Reference<css::frame::XFrame>& rxFrame); + +private: + rtl::OUString msContextName; + bool mbIsContextActive; + + void BroadcastContextChange ( + const cssu::Reference<css::frame::XFrame>& rxFrame, + const ::rtl::OUString& rsModuleName, + const ::rtl::OUString& rsContextName); + ::rtl::OUString GetModuleName ( + const cssu::Reference<css::frame::XFrame>& rxFrame); +}; + + +} } // end of namespace ::sd::sidebar + +#endif diff --git a/include/sfx2/sidebar/ControlFactory.hxx b/include/sfx2/sidebar/ControlFactory.hxx new file mode 100644 index 000000000000..594c36c5fd91 --- /dev/null +++ b/include/sfx2/sidebar/ControlFactory.hxx @@ -0,0 +1,46 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_CONTROL_FACTORY_HXX +#define SFX_SIDEBAR_CONTROL_FACTORY_HXX + +#include <sfx2/dllapi.h> +#include <vcl/button.hxx> + +class ToolBox; + +namespace sfx2 { namespace sidebar { + +class ToolBoxBackground; + + +class SFX2_DLLPUBLIC ControlFactory +{ +public: + static CheckBox* CreateMenuButton (Window* pParentWindow); + static ImageRadioButton* CreateTabItem (Window* pParentWindow); + static ToolBox* CreateToolBox (Window* pParentWindow, const ResId& rResId); + static Window* CreateToolBoxBackground (Window* pParentWindow); + static ImageRadioButton* CreateCustomImageRadionButton( + Window* pParentWindow, + const ResId& rResId ); +}; + + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/sidebar/ControllerItem.hxx b/include/sfx2/sidebar/ControllerItem.hxx new file mode 100644 index 000000000000..3e7cd83fb75a --- /dev/null +++ b/include/sfx2/sidebar/ControllerItem.hxx @@ -0,0 +1,55 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SVX_SIDEBAR_CONTROLLER_ITEM_HXX +#define SVX_SIDEBAR_CONTROLLER_ITEM_HXX + +#include <sfx2/ctrlitem.hxx> + +#include <boost/function.hpp> + + +namespace sfx2 { namespace sidebar { + +class SFX2_DLLPUBLIC ControllerItem + : public SfxControllerItem +{ +public: + class SFX2_DLLPUBLIC ItemUpdateReceiverInterface + { + public: + virtual void NotifyItemUpdate( + const sal_uInt16 nSId, + const SfxItemState eState, + const SfxPoolItem* pState) = 0; + virtual ~ItemUpdateReceiverInterface(); + }; + ControllerItem ( + const sal_uInt16 nId, + SfxBindings &rBindings, + ItemUpdateReceiverInterface& rItemUpdateReceiver); + virtual ~ControllerItem(); + + virtual void StateChanged (sal_uInt16 nSId, SfxItemState eState, const SfxPoolItem* pState); + +private: + ItemUpdateReceiverInterface& mrItemUpdateReceiver; +}; + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/sidebar/EnumContext.hxx b/include/sfx2/sidebar/EnumContext.hxx new file mode 100644 index 000000000000..54b07e016783 --- /dev/null +++ b/include/sfx2/sidebar/EnumContext.hxx @@ -0,0 +1,169 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_ENUM_CONTEXT_HXX +#define SFX_SIDEBAR_ENUM_CONTEXT_HXX + +#include "sfx2/dllapi.h" + +#include <rtl/ustring.hxx> + +#include <vector> + + +namespace sfx2 { namespace sidebar { + +class SFX2_DLLPUBLIC EnumContext +{ +public: + enum Application + { + Application_Writer, + Application_WriterWeb, + Application_Calc, + Application_Draw, + Application_Impress, + + // For your convenience to avoid duplicate code in the common + // case that Draw and Impress use identical context configurations. + Application_DrawImpress, + + // Also for your convenience for either Writer or WriterWeb. + Application_WriterAndWeb, + + // Used only by deck or panel descriptors. Matches any + // application. + Application_Any, + + // Use this only in special circumstances. One might be the + // wish to disable a deck or panel during debugging. + Application_None, + + __LastApplicationEnum = Application_None + }; + enum Context + { + Context_3DObject, + Context_Annotation, + Context_Auditing, + Context_Cell, + Context_Chart, + Context_Draw, + Context_DrawPage, + Context_DrawText, + Context_EditCell, + Context_Form, + Context_Frame, + Context_Graphic, + Context_HandoutPage, + Context_MasterPage, + Context_Media, + Context_MultiObject, + Context_NotesPage, + Context_OLE, + Context_OutlineText, + Context_Pivot, + Context_SlidesorterPage, + Context_Table, + Context_Text, + Context_TextObject, + + // Default context of an application. Do we need this? + Context_Default, + + // Used only by deck or panel descriptors. Matches any context. + Context_Any, + + // Special context name that is only used when a deck would + // otherwise be empty. + Context_Empty, + + Context_Unknown, + + __LastContextEnum = Context_Unknown + }; + + EnumContext (void); + EnumContext ( + const Application eApplication, + const Context eContext); + EnumContext ( + const ::rtl::OUString& rsApplicationName, + const ::rtl::OUString& rsContextName); + + /** Return a number that encodes both the application and context + enums. + Use the CombinedEnumContext macro in switch() statements and comparisons. + */ + sal_Int32 GetCombinedContext(void) const; + + /** This variant of the GetCombinedContext() method treats some + application names as identical to each other. Replacements + made are: + Draw or Impress -> DrawImpress + Writer or WriterWeb -> WriterAndWeb + Use the Application_DrawImpress or Application_WriterAndWeb values in the CombinedEnumContext macro. + */ + sal_Int32 GetCombinedContext_DI(void) const; + + const ::rtl::OUString& GetApplicationName (void) const; + const ::rtl::OUString& GetContextName (void) const; + + bool operator == (const EnumContext aOther); + bool operator != (const EnumContext aOther); + + /** When two contexts are matched against each other then + application or context name may have the wildcard value 'any'. + In order to prefer matches without wildcards over matches with + wildcards we introduce a integer evaluation for matches. + */ + const static sal_Int32 NoMatch; + const static sal_Int32 OptimalMatch; + + /** Return the numeric value that describes how good the match + between two contexts is. + Smaller values represent better matches. + */ + sal_Int32 EvaluateMatch (const EnumContext& rOther) const; + + /** Return the best match against the given list of contexts. + */ + sal_Int32 EvaluateMatch (const ::std::vector<EnumContext>& rOthers) const; + + static Application GetApplicationEnum (const ::rtl::OUString& rsApplicationName); + static const ::rtl::OUString& GetApplicationName (const Application eApplication); + + static Context GetContextEnum (const ::rtl::OUString& rsContextName); + static const ::rtl::OUString& GetContextName (const Context eContext); + +private: + Application meApplication; + Context meContext; + + static void ProvideApplicationContainers (void); + static void ProvideContextContainers (void); + static void AddEntry (const ::rtl::OUString& rsName, const Application eApplication); + static void AddEntry (const ::rtl::OUString& rsName, const Context eContext); +}; + + +#define CombinedEnumContext(a,e) ((static_cast<sal_uInt16>(::sfx2::sidebar::EnumContext::a)<<16)\ + | static_cast<sal_uInt16>(::sfx2::sidebar::EnumContext::e)) + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/sidebar/IContextChangeReceiver.hxx b/include/sfx2/sidebar/IContextChangeReceiver.hxx new file mode 100644 index 000000000000..2b9d57cb1473 --- /dev/null +++ b/include/sfx2/sidebar/IContextChangeReceiver.hxx @@ -0,0 +1,37 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_CONTEXT_CHANGE_RECEIVER_INTERFACE_HXX +#define SFX_SIDEBAR_CONTEXT_CHANGE_RECEIVER_INTERFACE_HXX + +#include "EnumContext.hxx" + + +namespace sfx2 { namespace sidebar { + + +class SFX2_DLLPUBLIC IContextChangeReceiver +{ +public: + virtual void HandleContextChange ( + const EnumContext aContext) = 0; + virtual ~IContextChangeReceiver(); +}; + +} } // end of namespace ::sd::sidebar + +#endif diff --git a/include/sfx2/sidebar/ILayoutableWindow.hxx b/include/sfx2/sidebar/ILayoutableWindow.hxx new file mode 100644 index 000000000000..8dc67457e966 --- /dev/null +++ b/include/sfx2/sidebar/ILayoutableWindow.hxx @@ -0,0 +1,44 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX +#define SFX_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX + +#include <tools/gen.hxx> +#include <sal/types.h> +#include <sfx2/dllapi.h> +#include <com/sun/star/ui/LayoutSize.hpp> + +class Window; + +namespace sfx2 { namespace sidebar { + + +class SFX2_DLLPUBLIC ILayoutableWindow +{ +public: + /** Return the preferred height with the constraint, that the + window will be set to the given width. + */ + virtual ::com::sun::star::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) = 0; + virtual ~ILayoutableWindow(); +}; + + +} } // end of namespace ::sd::sidebar + +#endif diff --git a/include/sfx2/sidebar/PopupContainer.hxx b/include/sfx2/sidebar/PopupContainer.hxx new file mode 100644 index 000000000000..f2b8cfaa048c --- /dev/null +++ b/include/sfx2/sidebar/PopupContainer.hxx @@ -0,0 +1,37 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_POPUP_CONTAINER_HXX +#define SFX_SIDEBAR_POPUP_CONTAINER_HXX + +#include "sfx2/dllapi.h" +#include <vcl/floatwin.hxx> + +namespace sfx2 { namespace sidebar { + +class SFX2_DLLPUBLIC PopupContainer : public FloatingWindow +{ +public: + PopupContainer (Window* pParent); + virtual ~PopupContainer (void); + + virtual long Notify (NotifyEvent& rNEvt); +}; + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/sidebar/ResourceDefinitions.hrc b/include/sfx2/sidebar/ResourceDefinitions.hrc new file mode 100644 index 000000000000..b45e398dedf1 --- /dev/null +++ b/include/sfx2/sidebar/ResourceDefinitions.hrc @@ -0,0 +1,141 @@ +/************************************************************** +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +* +*************************************************************/ + +#ifndef _SFX_PROPERTYPANEL_HRC +#define _SFX_PROPERTYPANEL_HRC + +#include <sfx2/sfx.hrc> + +//section page RID +#define RC_PROPERTYPANEL_START RID_SFX_PROPERTYPANEL_START +#define DLG_PROPERTY_DOCKING_WINDOW ( RC_PROPERTYPANEL_START + 0 ) +#define BMP_PROPERTYPANEL_EXPAND ( RC_PROPERTYPANEL_START + 1 ) +#define BMP_PROPERTYPANEL_COLLAPSE ( RC_PROPERTYPANEL_START + 2 ) +#define BMP_PROPERTYPANEL_MOREPROPERTY ( RC_PROPERTYPANEL_START + 5 ) +#define FT_PROPERTYPANEL_NOTSUPPORT_DESC ( RC_PROPERTYPANEL_START + 7 ) + +#define RID_PROPERTYPANEL_TEXTPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 8 ) +#define RID_PROPERTYPANEL_PARAGRAPHPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 9 ) +#define RID_PROPERTYPANEL_AREAPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 10 ) +#define RID_PROPERTYPANEL_TBLDESIGNPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 11 ) +#define RID_PROPERTYPANEL_LINEPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 12 ) +#define RID_PROPERTYPANEL_POSIZEPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 13 ) +#define RID_PROPERTYPANEL_GRAPHICPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 14 ) +#define RID_PROPERTYPANEL_CELLAPPEARPAGE_TITLEBAR ( RC_PROPERTYPANEL_START + 15 ) +#define RID_PROPERTYPANEL_SWPAGE_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 16) +#define RID_PROPERTYPANEL_SWOBJWRAP_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 17) +#define RID_PROPERTYPANEL_SCCELL_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 18) +#define RID_PROPERTYPANEL_SCALIGNMENT_PAGE_TITLEBAR (RC_PROPERTYPANEL_START + 19) +#define RID_PROPERTYPANEL_SD_PAGELAYOUT_TITLEBAR (RC_PROPERTYPANEL_START+20) +#define RID_PROPERTYPANEL_SD_PAGEPROPERTY_TITLEBAR (RC_PROPERTYPANEL_START+21) +#define RID_PROPERTYPANEL_SD_TABLEDESIGN_TITLEBAR (RC_PROPERTYPANEL_START+22) +#define RID_PROPERTYPANEL_NUMFORMAT_PAGE_TITLEBAR (RC_PROPERTYPANEL_START+23) + +#define RID_PANELDOCK_WINDOW ( RC_PROPERTYPANEL_START + 24 ) +#define STR_TITLE_DISCRIPTION ( RC_PROPERTYPANEL_START + 25 ) // + +#ifndef STD_MASKCOLOR +#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } +#endif + +//unit pixel +//panel common +#define PROPERTYPAGE_WIDTH 109 + +//about titlebar + +#define FI_EXPANSION_INDICATOR 1 +#define FT_TITLE 2 +#define STR_MOREPROPERTY_QUICKHELP 3 + +#define TITLEBAR_WIDTH PROPERTYPAGE_WIDTH +#define TITLEBAR_HEIGHT 13 + +#define TITLEBAR_MARGIN_HORIZONTAL 3 +#define TITLEBAR_CONTROL_SPACING_HORIZONTAL 3 + +#define FI_EXPANSION_INDICATOR_WIDTH 6 +#define FI_EXPANSION_INDICATOR_HEIGTH 6 +#define FI_EXPANSION_INDICATOR_X TITLEBAR_MARGIN_HORIZONTAL +#define FI_EXPANSION_INDICATOR_Y (TITLEBAR_HEIGHT - FI_EXPANSION_INDICATOR_HEIGTH)/2 + +#define FT_TITLE_WIDTH 85 +#define FT_TITLE_HEIGHT 10 +#define FT_TITLE_X FI_EXPANSION_INDICATOR_X + FI_EXPANSION_INDICATOR_WIDTH + TITLEBAR_CONTROL_SPACING_HORIZONTAL +#define FT_TITLE_Y (TITLEBAR_HEIGHT - FT_TITLE_HEIGHT)/2 + 1 + + +//about section page +#define SECTIONPAGE_MARGIN_VERTICAL 12 +#define SECTIONPAGE_MARGIN_VERTICAL_TOP 1 +#define SECTIONPAGE_MARGIN_VERTICAL_BOT 5 +#define SECTIONPAGE_MARGIN_HORIZONTAL 3 +#define CONTROL_SPACING_VERTICAL 5 +#define CONTROL_SPACING_HORIZONTAL 3 +#define TEXT_CONTROL_SPACING_VERTICAL 2 + +#define TEXT_HEIGHT 8 +#define CBOX_HEIGHT 12 +#define MBOX_HEIGHT 12 + +#define TBX_OUT_BORDER_OFFSET_X 2 +#define TBX_OUT_BORDER_OFFSET_Y 1 + +//for 16*16 pixel bmp +#define TOOLBOX_ITEM_HEIGHT 15 +#define TOOLBOX_ITEM_WIDTH 13 +#define TOOLBOX_ITEM_DD_WIDTH 19 + +//for 24*16 pixel bmp +#define TOOLBOX_24_16_ITEM_HEIGHT 15 +#define TOOLBOX_24_16_ITEM_DD_WIDTH 23 + +//for 24*24 pixel bmp +#define TOOLBOX_24_24_ITEM_HEIGHT 18 +#define TOOLBOX_24_24_ITEM_DD_WIDTH 24 + +//about popup panel +#define POPUPPANEL_MARGIN_VERTICAL 7 +#define POPUPPANEL_MARGIN_HORIZONTAL 7 + +//for 42*42 pixel bmp +#define TOOLBOX_42_42_ITEM_HEIGHT 30 +#define TOOLBOX_42_42_ITEM_DD_WIDTH 27 +#define TB_BORDER 2 + +#define POPUPPANEL_SEP_VERTICAL_1 10 +#define POPUPPANEL_SEP_VERTICAL_2 6 +#define POPUPPANEL_SEP_HEIGHT 1 + +#define POPUP_BORDER_WIDTH 2 +#define POPUP_BORDER_HEIGHT 3 +#define OFFSET_X 1 +#define OFFSET_Y 1 + +#define POPUP_TOP_GRADIENT_HEIGHT 4 +#define POPUP_BOT_GRADIENT_HEIGHT 6 + +#define POPUP_COLOR_PICKER_WIDTH 97 +#define POPUP_COLOR_PICKER_HEIGHT 114 +//new +#define POPUPPANEL_MARGIN_SMALL 2 +#define POPUPPANEL_MARGIN_LARGE 5 +#endif diff --git a/include/sfx2/sidebar/SidebarChildWindow.hxx b/include/sfx2/sidebar/SidebarChildWindow.hxx new file mode 100644 index 000000000000..23f9194dba32 --- /dev/null +++ b/include/sfx2/sidebar/SidebarChildWindow.hxx @@ -0,0 +1,48 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_CHILD_WINDOW_HXX +#define SFX_SIDEBAR_CHILD_WINDOW_HXX + +#include "sfx2/childwin.hxx" + + +namespace sfx2 { namespace sidebar { + +/** Outer container of the sidbar window. + + Has to be registered for every application via the + RegisterChildWindow() method from the RegisterControllers() method + of the applications DLL. +*/ +class SFX2_DLLPUBLIC SidebarChildWindow + : public SfxChildWindow +{ +public: + SidebarChildWindow( + Window* pParent, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo); + + SFX_DECL_CHILDWINDOW_WITHID(SidebarChildWindow); +}; + + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx new file mode 100644 index 000000000000..7117505ad710 --- /dev/null +++ b/include/sfx2/sidebar/SidebarPanelBase.hxx @@ -0,0 +1,124 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_PANEL_BASE_HXX +#define SFX_SIDEBAR_PANEL_BASE_HXX + +#include "EnumContext.hxx" + +#include <cppuhelper/compbase4.hxx> +#include <cppuhelper/basemutex.hxx> + +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/ui/XContextChangeEventListener.hpp> +#include <com/sun/star/ui/XUIElement.hpp> +#include <com/sun/star/ui/XToolPanel.hpp> +#include <com/sun/star/ui/XSidebarPanel.hpp> + +#include <boost/noncopyable.hpp> +#include <boost/function.hpp> + + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + + +class Window; + +namespace sfx2 { namespace sidebar { + +namespace +{ + typedef ::cppu::WeakComponentImplHelper4 < + css::ui::XContextChangeEventListener, + css::ui::XUIElement, + css::ui::XToolPanel, + css::ui::XSidebarPanel + > SidebarPanelBaseInterfaceBase; +} + +/** Base class for sidebar panels that provides some convenience + functionality. +*/ +class SFX2_DLLPUBLIC SidebarPanelBase + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public SidebarPanelBaseInterfaceBase +{ +public: + static cssu::Reference<css::ui::XUIElement> Create ( + const ::rtl::OUString& rsResourceURL, + const cssu::Reference<css::frame::XFrame>& rxFrame, + Window* mpWindow, + const css::ui::LayoutSize& rLayoutSize); + + // XContextChangeEventListener + virtual void SAL_CALL notifyContextChangeEvent ( + const css::ui::ContextChangeEventObject& rEvent) + throw (cssu::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing ( + const css::lang::EventObject& rEvent) + throw (cssu::RuntimeException); + + // XUIElement + virtual cssu::Reference<css::frame::XFrame> SAL_CALL getFrame (void) + throw(cssu::RuntimeException); + virtual ::rtl::OUString SAL_CALL getResourceURL (void) + throw(cssu::RuntimeException); + virtual sal_Int16 SAL_CALL getType (void) + throw(cssu::RuntimeException); + virtual cssu::Reference<cssu::XInterface> SAL_CALL getRealInterface (void) + throw(cssu::RuntimeException); + + // XToolPanel + virtual cssu::Reference<css::accessibility::XAccessible> SAL_CALL createAccessible ( + const cssu::Reference<css::accessibility::XAccessible>& rxParentAccessible) + throw(cssu::RuntimeException); + virtual cssu::Reference<css::awt::XWindow> SAL_CALL getWindow (void) + throw(cssu::RuntimeException); + + // XSidebarPanel + virtual css::ui::LayoutSize SAL_CALL getHeightForWidth (sal_Int32 nWidth) + throw(cssu::RuntimeException); + +protected: + cssu::Reference<css::frame::XFrame> mxFrame; + + SidebarPanelBase ( + const ::rtl::OUString& rsResourceURL, + const cssu::Reference<css::frame::XFrame>& rxFrame, + Window* pWindow, + const css::ui::LayoutSize& rLayoutSize); + virtual ~SidebarPanelBase (void); + + virtual void SAL_CALL disposing (void) + throw (cssu::RuntimeException); + + void SetControl (::Window* pControl); + ::Window* GetControl (void) const; + +private: + Window* mpControl; + const ::rtl::OUString msResourceURL; + const css::ui::LayoutSize maLayoutSize; +}; + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/sidebar/Theme.hxx b/include/sfx2/sidebar/Theme.hxx new file mode 100644 index 000000000000..d34866b7b179 --- /dev/null +++ b/include/sfx2/sidebar/Theme.hxx @@ -0,0 +1,278 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef SFX_SIDEBAR_THEME_HXX +#define SFX_SIDEBAR_THEME_HXX + +#include "sfx2/dllapi.h" + +#include <tools/color.hxx> +#include <vcl/image.hxx> +#include <cppuhelper/compbase2.hxx> +#include <cppuhelper/basemutex.hxx> +#include <tools/gen.hxx> +#include <rtl/ref.hxx> +#include <vcl/wall.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> + +#include <boost/unordered_map.hpp> +#include <map> +#include <boost/optional.hpp> + + +class SvBorder; + +namespace css = ::com::sun::star; +namespace cssu = ::com::sun::star::uno; + + +namespace sfx2 { namespace sidebar { + + +namespace +{ + typedef ::cppu::WeakComponentImplHelper2 < + css::beans::XPropertySet, + css::beans::XPropertySetInfo + > ThemeInterfaceBase; +} + +class Paint; + +/** Simple collection of colors, gradients, fonts that define the + look of the sidebar and its controls. +*/ +class SFX2_DLLPUBLIC Theme + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public ThemeInterfaceBase +{ +public: + enum ThemeItem + { + __Begin, + __Pre_Image = __Begin, + + __AnyItem = __Pre_Image, + + Image_Grip, + Image_Expand, + Image_Collapse, + Image_TabBarMenu, + Image_PanelMenu, + Image_ToolBoxItemSeparator, + Image_Closer, + + __Image_Color, + + Color_DeckTitleFont, + Color_PanelTitleFont, + Color_TabMenuSeparator, + Color_TabItemBorder, + Color_DropDownBorder, + Color_Highlight, + Color_HighlightText, + + __Color_Paint, + + Paint_DeckBackground, + Paint_DeckTitleBarBackground, + Paint_PanelBackground, + Paint_PanelTitleBarBackground, + Paint_TabBarBackground, + Paint_TabItemBackgroundNormal, + Paint_TabItemBackgroundHighlight, + Paint_HorizontalBorder, + Paint_VerticalBorder, + Paint_ToolBoxBackground, + Paint_ToolBoxBorderTopLeft, + Paint_ToolBoxBorderCenterCorners, + Paint_ToolBoxBorderBottomRight, + Paint_DropDownBackground, + + __Paint_Int, + + Int_DeckTitleBarHeight, + Int_DeckBorderSize, + Int_DeckSeparatorHeight, + Int_PanelTitleBarHeight, + Int_TabMenuPadding, + Int_TabMenuSeparatorPadding, + Int_TabItemWidth, + Int_TabItemHeight, + Int_DeckLeftPadding, + Int_DeckTopPadding, + Int_DeckRightPadding, + Int_DeckBottomPadding, + Int_TabBarLeftPadding, + Int_TabBarTopPadding, + Int_TabBarRightPadding, + Int_TabBarBottomPadding, + Int_ButtonCornerRadius, + + __Int_Bool, + + Bool_UseSymphonyIcons, + Bool_UseSystemColors, + Bool_UseToolBoxItemSeparator, + Bool_IsHighContrastModeActive, + + __Bool_Rect, + + Rect_ToolBoxPadding, + Rect_ToolBoxBorder, + + __Post_Rect, + __End=__Post_Rect + }; + + static Image GetImage (const ThemeItem eItem); + static Color GetColor (const ThemeItem eItem); + static const Paint& GetPaint (const ThemeItem eItem); + static const Wallpaper GetWallpaper (const ThemeItem eItem); + static sal_Int32 GetInteger (const ThemeItem eItem); + static bool GetBoolean (const ThemeItem eItem); + static Rectangle GetRectangle (const ThemeItem eItem); + + static bool IsHighContrastMode (void); + + static void HandleDataChange (void); + + Theme (void); + virtual ~Theme (void); + + virtual void SAL_CALL disposing (void); + + static cssu::Reference<css::beans::XPropertySet> GetPropertySet (void); + + // beans::XPropertySet + virtual cssu::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo (void) + throw(cssu::RuntimeException); + virtual void SAL_CALL setPropertyValue ( + const ::rtl::OUString& rsPropertyName, + const cssu::Any& rValue) + throw(cssu::RuntimeException); + virtual cssu::Any SAL_CALL getPropertyValue ( + const ::rtl::OUString& rsPropertyName) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rsPropertyName, + const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) + throw(css::beans::UnknownPropertyException, + css::lang::WrappedTargetException, + cssu::RuntimeException); + + // beans::XPropertySetInfo + virtual cssu::Sequence<css::beans::Property> SAL_CALL getProperties (void) + throw(cssu::RuntimeException); + virtual css::beans::Property SAL_CALL getPropertyByName (const ::rtl::OUString& rsName) + throw(css::beans::UnknownPropertyException, + cssu::RuntimeException); + virtual sal_Bool SAL_CALL hasPropertyByName (const ::rtl::OUString& rsName) + throw(cssu::RuntimeException); + +private: + static ::rtl::Reference<Theme> mpInstance; + static Theme& GetCurrentTheme (void); + + ::std::vector<Image> maImages; + ::std::vector<Color> maColors; + ::std::vector<Paint> maPaints; + ::std::vector<sal_Int32> maIntegers; + ::std::vector<bool> maBooleans; + ::std::vector<Rectangle> maRectangles; + bool mbIsHighContrastMode; + bool mbIsHighContrastModeSetManually; + + typedef ::boost::unordered_map<rtl::OUString,ThemeItem, rtl::OUStringHash> PropertyNameToIdMap; + PropertyNameToIdMap maPropertyNameToIdMap; + typedef ::std::vector<rtl::OUString> PropertyIdToNameMap; + PropertyIdToNameMap maPropertyIdToNameMap; + typedef ::std::vector<cssu::Any> RawValueContainer; + RawValueContainer maRawValues; + + typedef ::std::vector<cssu::Reference<css::beans::XPropertyChangeListener> > ChangeListenerContainer; + typedef ::std::map<ThemeItem,ChangeListenerContainer> ChangeListeners; + ChangeListeners maChangeListeners; + typedef ::std::vector<cssu::Reference<css::beans::XVetoableChangeListener> > VetoableListenerContainer; + typedef ::std::map<ThemeItem,VetoableListenerContainer> VetoableListeners; + VetoableListeners maVetoableListeners; + + enum PropertyType + { + PT_Image, + PT_Color, + PT_Paint, + PT_Integer, + PT_Boolean, + PT_Rectangle, + PT_Invalid + }; + + void SetupPropertyMaps (void); + void InitializeTheme (void); + void UpdateTheme (void); + static PropertyType GetPropertyType (const ThemeItem eItem); + static cssu::Type GetCppuType (const PropertyType eType); + static sal_Int32 GetIndex ( + const ThemeItem eItem, + const PropertyType eType); + + VetoableListenerContainer* GetVetoableListeners ( + const ThemeItem eItem, + const bool bCreate); + ChangeListenerContainer* GetChangeListeners ( + const ThemeItem eItem, + const bool bCreate); + bool DoVetoableListenersVeto ( + const VetoableListenerContainer* pListeners, + const css::beans::PropertyChangeEvent& rEvent) const; + void BroadcastPropertyChange ( + const ChangeListenerContainer* pListeners, + const css::beans::PropertyChangeEvent& rEvent) const; + void ProcessNewValue ( + const cssu::Any& rValue, + const ThemeItem eItem, + const PropertyType eType); +}; + + + +} } // end of namespace sfx2::sidebar + +#endif diff --git a/include/sfx2/styfitem.hxx b/include/sfx2/styfitem.hxx index b728be448a49..b4c88340b935 100644 --- a/include/sfx2/styfitem.hxx +++ b/include/sfx2/styfitem.hxx @@ -68,9 +68,6 @@ class SFX2_DLLPUBLIC SfxStyleFamilies: public Resource SfxStyleFamilyList aEntryList; public: - /** ctor - <p>Will automatically call updateImages with BMP_COLOR_NORMAL.</p> - */ SfxStyleFamilies( const ResId &); SfxStyleFamilies( ) {}; ~SfxStyleFamilies(); diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx index e9fb3a5e4c51..9c57455bc57d 100644 --- a/include/sfx2/templdlg.hxx +++ b/include/sfx2/templdlg.hxx @@ -21,7 +21,7 @@ #include "sal/config.h" #include "sfx2/dllapi.h" - +#include <vcl/ctrl.hxx> #include <rsc/rscsfx.hxx> #include <sfx2/dockwin.hxx> @@ -79,6 +79,30 @@ public: void SetParagraphFamily(); }; +// class SfxTemplatePanelControl ----------------------------------------- + +class SFX2_DLLPUBLIC SfxTemplatePanelControl : public DockingWindow +{ +public: + SfxTemplatePanelControl (SfxBindings* pBindings, Window* pParentWindow); + ~SfxTemplatePanelControl (void); + + virtual void Update(); + virtual void DataChanged( const DataChangedEvent& _rDCEvt ); + virtual void Resize(); + virtual SfxChildAlignment CheckAlignment( SfxChildAlignment, SfxChildAlignment ); + virtual void StateChanged( StateChangedType nStateChange ); + virtual void FreeResource (void); + + ISfxTemplateCommon* GetISfxTemplateCommon(); + void SetParagraphFamily(); + +private: + SfxTemplateDialog_Impl* pImpl; + SfxBindings* mpBindings; +}; + + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |