diff options
author | Susobhan Ghosh <susobhang70@gmail.com> | 2016-06-29 19:13:53 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-07-08 20:10:02 +0000 |
commit | ab9708e179762f97bd1a0ee4c0d4b439f1dabfd5 (patch) | |
tree | daae95a1a288f72285341dd19ca8a32a99d61698 | |
parent | 94a001bc62abc4e561e99fdd82c7eee46579fe4e (diff) |
tdf#87643: Default Shapes Panel for Shapes Deck
Change-Id: Ib3d4a32e70b6dc2ae0898846a27d3ffcb43c2a75
Reviewed-on: https://gerrit.libreoffice.org/26770
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu | 49 | ||||
-rw-r--r-- | sd/source/ui/sidebar/PanelFactory.cxx | 2 | ||||
-rw-r--r-- | svx/Library_svx.mk | 2 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 3 | ||||
-rw-r--r-- | svx/source/sidebar/PanelFactory.cxx | 5 | ||||
-rw-r--r-- | svx/source/sidebar/shapes/DefaultShapesPanel.cxx | 141 | ||||
-rw-r--r-- | svx/source/sidebar/shapes/DefaultShapesPanel.hxx | 77 | ||||
-rw-r--r-- | svx/source/sidebar/shapes/ShapesUtil.cxx | 212 | ||||
-rw-r--r-- | svx/source/sidebar/shapes/ShapesUtil.hxx | 38 | ||||
-rw-r--r-- | svx/uiconfig/ui/defaultshapespanel.ui | 423 |
10 files changed, 950 insertions, 2 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu index 2f2a032fda3a..50eb1053a44a 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu @@ -60,6 +60,28 @@ <value>100</value> </prop> </node> + + <node oor:name="ShapesDeck" oor:op="replace"> + <prop oor:name="Title" oor:type="xs:string"> + <value xml:lang="en-US">Shapes</value> + </prop> + <prop oor:name="Id" oor:type="xs:string"> + <value>ShapesDeck</value> + </prop> + <prop oor:name="IconURL" oor:type="xs:string"> + <value>private:graphicrepository/cmd/lc_basicshapes.png</value> + </prop> + <prop oor:name="ContextList"> + <value oor:separator=";"> + DrawImpress, any, visible ; + </value> + </prop> + <prop oor:name="OrderIndex" oor:type="xs:int"> + <value>200</value> + </prop> + </node> + + <node oor:name="GalleryDeck" oor:op="replace"> <prop oor:name="Title" oor:type="xs:string"> <value xml:lang="en-US">Gallery</value> @@ -690,6 +712,33 @@ </prop> </node> + <node oor:name="DefaultShapesPanel" oor:op="replace"> + <prop oor:name="Title" oor:type="xs:string"> + <value xml:lang="en-US">Default</value> + </prop> + <prop oor:name="Id" oor:type="xs:string"> + <value>DefaultShapesPanel</value> + </prop> + <prop oor:name="DeckId" oor:type="xs:string"> + <value>ShapesDeck</value> + </prop> + <prop oor:name="ContextList"> + <value oor:separator=";"> + DrawImpress, DrawPage, visible ; + DrawImpress, default, visible ; + DrawImpress, HandoutPage, visible ; + DrawImpress, NotesPage, visible ; + DrawImpress, SlidesorterPage, visible ; + </value> + </prop> + <prop oor:name="ImplementationURL" oor:type="xs:string"> + <value>private:resource/toolpanel/SvxPanelFactory/DefaultShapesPanel</value> + </prop> + <prop oor:name="OrderIndex" oor:type="xs:int"> + <value>100</value> + </prop> + </node> + <node oor:name="SlideBackgroundPanel" oor:op="replace"> <prop oor:name="Title" oor:type="xs:string"> <value xml:lang="en-US">Slide</value> diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx index 12b629b27fd3..af4695dba76f 100644 --- a/sd/source/ui/sidebar/PanelFactory.cxx +++ b/sd/source/ui/sidebar/PanelFactory.cxx @@ -30,7 +30,7 @@ #include "NavigatorWrapper.hxx" #include "SlideTransitionPanel.hxx" #include "TableDesignPanel.hxx" -#include <SlideBackground.hxx> +#include "SlideBackground.hxx" #include <sfx2/viewfrm.hxx> #include <sfx2/sidebar/SidebarPanelBase.hxx> diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index 359e231fd6f7..919f721c480e 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -202,6 +202,8 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/sidebar/line/LineWidthPopup \ svx/source/sidebar/possize/PosSizePropertyPanel \ svx/source/sidebar/possize/SidebarDialControl \ + svx/source/sidebar/shapes/DefaultShapesPanel \ + svx/source/sidebar/shapes/ShapesUtil \ svx/source/sidebar/tools/PopupControl \ svx/source/sidebar/tools/PopupContainer \ svx/source/sidebar/tools/Popup \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index 9202248d2e18..bb1bda38d500 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -24,6 +24,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/compressgraphicdialog \ svx/uiconfig/ui/crashreportdlg \ svx/uiconfig/ui/datanavigator \ + svx/uiconfig/ui/defaultshapespanel \ svx/uiconfig/ui/deleteheaderdialog \ svx/uiconfig/ui/deletefooterdialog \ svx/uiconfig/ui/docking3deffects \ @@ -63,7 +64,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/redlineviewpage \ svx/uiconfig/ui/savemodifieddialog \ svx/uiconfig/ui/sidebararea \ - svx/uiconfig/ui/sidebarshadow \ + svx/uiconfig/ui/sidebarshadow \ svx/uiconfig/ui/sidebargraphic \ svx/uiconfig/ui/sidebarline \ svx/uiconfig/ui/sidebarparagraph \ diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx index ceb4f68f0ec3..d64ee5c4c9f0 100644 --- a/svx/source/sidebar/PanelFactory.cxx +++ b/svx/source/sidebar/PanelFactory.cxx @@ -25,6 +25,7 @@ #include "graphic/GraphicPropertyPanel.hxx" #include "line/LinePropertyPanel.hxx" #include "possize/PosSizePropertyPanel.hxx" +#include "shapes/DefaultShapesPanel.hxx" #include "GalleryControl.hxx" #include "EmptyPanel.hxx" #include <sfx2/sidebar/SidebarPanelBase.hxx> @@ -167,6 +168,10 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement ( { pControl = PosSizePropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar); } + else if (rsResourceURL.endsWith("/DefaultShapesPanel")) + { + pControl = DefaultShapesPanel::Create(pParentWindow, xFrame); + } else if (rsResourceURL.endsWith("/GalleryPanel")) { pControl.reset(VclPtr<GalleryControl>::Create(pBindings, pParentWindow)); diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx new file mode 100644 index 000000000000..66f1189ab48b --- /dev/null +++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ +#include "DefaultShapesPanel.hxx" + +#include <sfx2/imagemgr.hxx> +#include <comphelper/dispatchcommand.hxx> +#include <vcl/outdev.hxx> +#include <vcl/commandinfoprovider.hxx> + +using ::rtl::OUString; + +namespace svx { namespace sidebar { + +DefaultShapesPanel::DefaultShapesPanel ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame) + : PanelLayout(pParent, "DefaultShapesPanel", "svx/ui/defaultshapespanel.ui", rxFrame), + SvxShapeCommandsMap(), + mxFrame(rxFrame) +{ + get(mpScrollWindow, "scrolledwindow1"); + get(mpLineArrowSet, "LinesArrows"); + get(mpCurveSet, "Curves"); + get(mpConnectorSet, "Connectors"); + get(mpBasicShapeSet, "BasicShapes"); + get(mpSymbolShapeSet, "SymbolShapes"); + get(mpBlockArrowSet, "BlockArrows"); + get(mpFlowchartSet, "Flowcharts"); + get(mpCalloutSet, "Callouts"); + get(mpStarSet, "Stars"); + get(mp3DObjectSet, "3DObjects"); + Initialize(); +} + +VclPtr< vcl::Window > DefaultShapesPanel::Create( + vcl::Window* pParent, + const Reference< XFrame >& rxFrame) +{ + if (pParent == nullptr) + throw lang::IllegalArgumentException("no parent Window given to DefaultShapesPanel::Create", nullptr, 0); + if ( ! rxFrame.is()) + throw lang::IllegalArgumentException("no XFrame given to DefaultShapesPanel::Create", nullptr, 1); + + return VclPtr<DefaultShapesPanel>::Create( + pParent, + rxFrame); +} + +DefaultShapesPanel::~DefaultShapesPanel() +{ + disposeOnce(); +} + +void DefaultShapesPanel::Initialize() +{ + mpShapesSetMap = decltype(mpShapesSetMap){ + { mpLineArrowSet, mpLineShapes }, + { mpCurveSet, mpCurveShapes }, + { mpConnectorSet, mpConnectorShapes }, + { mpBasicShapeSet, mpBasicShapes }, + { mpSymbolShapeSet, mpSymbolShapes }, + { mpBlockArrowSet, mpBlockArrowShapes }, + { mpFlowchartSet, mpFlowchartShapes }, + { mpCalloutSet, mpCalloutShapes }, + { mpStarSet, mpStarShapes }, + { mp3DObjectSet, mp3DShapes } + }; + populateShapes(); + for(auto& aSetMap: mpShapesSetMap) + { + aSetMap.first->SetColor(GetSettings().GetStyleSettings().GetMenuColor()); + aSetMap.first->SetSelectHdl(LINK(this, DefaultShapesPanel, ShapeSelectHdl)); + } +} + +void DefaultShapesPanel::dispose() +{ + mpScrollWindow.clear(); + mpLineArrowSet.clear(); + mpCurveSet.clear(); + mpConnectorSet.clear(); + mpBasicShapeSet.clear(); + mpSymbolShapeSet.clear(); + mpBlockArrowSet.clear(); + mpFlowchartSet.clear(); + mpCalloutSet.clear(); + mpStarSet.clear(); + mp3DObjectSet.clear(); + PanelLayout::dispose(); +} + +IMPL_LINK_TYPED(DefaultShapesPanel, ShapeSelectHdl, ValueSet*, rValueSet, void) +{ + for(auto& aSetMap : mpShapesSetMap) + { + if(rValueSet == aSetMap.first) + { + int aSelection = aSetMap.first->GetSelectItemId(); + comphelper::dispatchCommand(aSetMap.second[aSelection], {}); + } + else + aSetMap.first->SetNoSelection(); + } +} + +void DefaultShapesPanel::populateShapes() +{ + OUString sSlotStr, sLabel; + Image aSlotImage; + for(auto& aSet : mpShapesSetMap) + { + aSet.first->SetColCount(6); + for(sal_uInt16 i = 0; i < aSet.second.size(); i++) + { + sSlotStr = aSet.second[i]; + aSlotImage = ::GetImage(mxFrame, sSlotStr, false); + sLabel = vcl::CommandInfoProvider::Instance().GetTooltipForCommand(sSlotStr, mxFrame); + aSet.first->InsertItem(i, aSlotImage, sLabel); + } + } +} + +} } // end of namespace sd::sidebar + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.hxx b/svx/source/sidebar/shapes/DefaultShapesPanel.hxx new file mode 100644 index 000000000000..5da2f184a845 --- /dev/null +++ b/svx/source/sidebar/shapes/DefaultShapesPanel.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 INCLUDED_SD_SOURCE_SIDEBAR_INSERT_DEFAULTSHAPESPANEL_HXX +#define INCLUDED_SD_SOURCE_SIDEBAR_INSERT_DEFAULTSHAPESPANEL_HXX + +#include <vcl/ctrl.hxx> +#include <com/sun/star/frame/XFrame.hpp> + +#include <map> +#include <svx/sidebar/PanelLayout.hxx> +#include <vcl/layout.hxx> +#include <svtools/valueset.hxx> +#include "ShapesUtil.hxx" + +using namespace css; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::frame; + +namespace svx { namespace sidebar { + +/** This panel provides buttons for inserting shapes into a document. +*/ +class DefaultShapesPanel + : public PanelLayout, public SvxShapeCommandsMap +{ +public: + DefaultShapesPanel ( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame); + static VclPtr<vcl::Window> Create( + vcl::Window* pParent, + const css::uno::Reference<css::frame::XFrame>& rxFrame); + virtual ~DefaultShapesPanel(); + virtual void dispose() override; + +private: + VclPtr<ValueSet> mpLineArrowSet; + VclPtr<ValueSet> mpCurveSet; + VclPtr<ValueSet> mpConnectorSet; + VclPtr<ValueSet> mpBasicShapeSet; + VclPtr<ValueSet> mpSymbolShapeSet; + VclPtr<ValueSet> mpBlockArrowSet; + VclPtr<ValueSet> mpFlowchartSet; + VclPtr<ValueSet> mpCalloutSet; + VclPtr<ValueSet> mpStarSet; + VclPtr<ValueSet> mp3DObjectSet; + VclPtr<VclScrolledWindow> mpScrollWindow; + Reference< XFrame > mxFrame; + std::map<VclPtr<ValueSet>, std::map<sal_uInt16, rtl::OUString>> mpShapesSetMap; + + void populateShapes(); + void Initialize(); + DECL_LINK_TYPED( ShapeSelectHdl, ValueSet*, void ); +}; + + +} } // end of namespace sd::sidebar + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/svx/source/sidebar/shapes/ShapesUtil.cxx b/svx/source/sidebar/shapes/ShapesUtil.cxx new file mode 100644 index 000000000000..c17972756727 --- /dev/null +++ b/svx/source/sidebar/shapes/ShapesUtil.cxx @@ -0,0 +1,212 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#include "ShapesUtil.hxx" +#include <map> +#include <rtl/ustring.hxx> + +namespace svx{ namespace sidebar{ +SvxShapeCommandsMap::SvxShapeCommandsMap() +{ + mpLineShapes = decltype(mpLineShapes){ + {0, ".uno:Line"}, + {1, ".uno:LineArrowEnd"}, + {2, ".uno:LineCircleArrow"}, + {3, ".uno:LineSquareArrow"}, + {4, ".uno:LineArrows"}, + {5, ".uno:LineArrowStart"}, + {6, ".uno:LineArrowCircle"}, + {7, ".uno:LineArrowSquare"}, + {8, ".uno:MeasureLine"}, + {9, ".uno:Line_Diagonal"} + }; + + mpCurveShapes = decltype(mpCurveShapes){ + {0, ".uno:Freeline_Unfilled"}, + {1, ".uno:Bezier_Unfilled"}, + {2, ".uno:Polygon_Unfilled"}, + {3, ".uno:Polygon_Diagonal_Unfilled"}, + {4, ".uno:Freeline"}, + {5, ".uno:BezierFill"}, + {6, ".uno:Polygon"}, + {7, ".uno:Polygon_Diagonal"} + }; + + mpConnectorShapes = decltype(mpConnectorShapes){ + {0, ".uno:ConnectorArrowEnd"}, + {1, ".uno:ConnectorLineArrowEnd"}, + {2, ".uno:ConnectorCurveArrowEnd"}, + {3, ".uno:ConnectorLinesArrowEnd"}, + {4, ".uno:Connector"}, + {5, ".uno:ConnectorLine"}, + {6, ".uno:ConnectorCurve"}, + {7, ".uno:ConnectorLines"}, + {8, ".uno:ConnectorArrows"}, + {9, ".uno:ConnectorLineArrows"}, + {10, ".uno:ConnectorCurveArrows"}, + {11, ".uno:ConnectorLinesArrows"} + }; + + mpBasicShapes = decltype(mpBasicShapes){ + {0, ".uno:BasicShapes.rectangle"}, + {1, ".uno:BasicShapes.round-rectangle"}, + {2, ".uno:BasicShapes.quadrat"}, + {3, ".uno:BasicShapes.round-quadrat"}, + {4, ".uno:BasicShapes.parallelogram"}, + {5, ".uno:BasicShapes.trapezoid"}, + {6, ".uno:BasicShapes.ellipse"}, + {7, ".uno:BasicShapes.circle"}, + {8, ".uno:BasicShapes.circle-pie"}, + {9, ".uno:CircleCut"}, + {10, ".uno:Arc"}, + {11, ".uno:BasicShapes.block-arc"}, + {12, ".uno:BasicShapes.isosceles-triangle"}, + {13, ".uno:BasicShapes.right-triangle"}, + {14, ".uno:BasicShapes.diamond"}, + {15, ".uno:BasicShapes.pentagon"}, + {16, ".uno:BasicShapes.hexagon"}, + {17, ".uno:BasicShapes.octagon"}, + {18, ".uno:BasicShapes.cross"}, + {19, ".uno:BasicShapes.can"}, + {20, ".uno:BasicShapes.cube"}, + {21, ".uno:BasicShapes.paper"}, + {22, ".uno:BasicShapes.frame"}, + {23, ".uno:BasicShapes.ring"} + }; + + mpSymbolShapes = decltype(mpSymbolShapes){ + {0, ".uno:SymbolShapes.smiley"}, + {1, ".uno:SymbolShapes.sun"}, + {2, ".uno:SymbolShapes.moon"}, + {3, ".uno:SymbolShapes.lightning"}, + {4, ".uno:SymbolShapes.heart"}, + {5, ".uno:SymbolShapes.flower"}, + {6, ".uno:SymbolShapes.cloud"}, + {7, ".uno:SymbolShapes.forbidden"}, + {8, ".uno:SymbolShapes.puzzle"}, + {9, ".uno:SymbolShapes.bracket-pair"}, + {10, ".uno:SymbolShapes.left-bracket"}, + {11, ".uno:SymbolShapes.right-bracket"}, + {12, ".uno:SymbolShapes.brace-pair"}, + {13, ".uno:SymbolShapes.left-brace"}, + {14, ".uno:SymbolShapes.right-brace"}, + {15, ".uno:SymbolShapes.quad-bevel"}, + {16, ".uno:SymbolShapes.octagon-bevel"}, + {17, ".uno:SymbolShapes.diamond-bevel"} + }; + + mpBlockArrowShapes = decltype(mpBlockArrowShapes){ + {0, ".uno:ArrowShapes.left-arrow"}, + {1, ".uno:ArrowShapes.right-arrow"}, + {2, ".uno:ArrowShapes.up-arrow"}, + {3, ".uno:ArrowShapes.down-arrow"}, + {4, ".uno:ArrowShapes.left-right-arrow"}, + {5, ".uno:ArrowShapes.up-down-arrow"}, + {6, ".uno:ArrowShapes.up-right-arrow"}, + {7, ".uno:ArrowShapes.up-right-down-arrow"}, + {8, ".uno:ArrowShapes.quad-arrow"}, + {9, ".uno:ArrowShapes.corner-right-arrow"}, + {10, ".uno:ArrowShapes.split-arrow"}, + {11, ".uno:ArrowShapes.striped-right-arrow"}, + {12, ".uno:ArrowShapes.notched-right-arrow"}, + {13, ".uno:ArrowShapes.pentagon-right"}, + {14, ".uno:ArrowShapes.chevron"}, + {15, ".uno:ArrowShapes.right-arrow-callout"}, + {16, ".uno:ArrowShapes.left-arrow-callout"}, + {17, ".uno:ArrowShapes.up-arrow-callout"}, + {18, ".uno:ArrowShapes.left-right-arrow-callout"}, + {19, ".uno:ArrowShapes.up-down-arrow-callout"}, + {20, ".uno:ArrowShapes.up-right-arrow-callout"}, + {21, ".uno:ArrowShapes.quad-arrow-callout"}, + {22, ".uno:ArrowShapes.circular-arrow"}, + {23, ".uno:ArrowShapes.down-arrow-callout"}, + {24, ".uno:ArrowShapes.split-round-arrow"}, + {25, ".uno:ArrowShapes.s-sharped-arrow"} + }; + + mpFlowchartShapes = decltype(mpFlowchartShapes){ + {0, ".uno:FlowChartShapes.flowchart-process"}, + {1, ".uno:FlowChartShapes.flowchart-alternate-process"}, + {2, ".uno:FlowChartShapes.flowchart-decision"}, + {3, ".uno:FlowChartShapes.flowchart-data"}, + {4, ".uno:FlowChartShapes.flowchart-predefined-process"}, + {5, ".uno:FlowChartShapes.flowchart-internal-storage"}, + {6, ".uno:FlowChartShapes.flowchart-document"}, + {7, ".uno:FlowChartShapes.flowchart-multidocument"}, + {8, ".uno:FlowChartShapes.flowchart-terminator"}, + {9, ".uno:FlowChartShapes.flowchart-preparation"}, + {10, ".uno:FlowChartShapes.flowchart-manual-input"}, + {11, ".uno:FlowChartShapes.flowchart-manual-operation"}, + {12, ".uno:FlowChartShapes.flowchart-connector"}, + {13, ".uno:FlowChartShapes.flowchart-off-page-connector"}, + {14, ".uno:FlowChartShapes.flowchart-card"}, + {15, ".uno:FlowChartShapes.flowchart-punched-tape"}, + {16, ".uno:FlowChartShapes.flowchart-summing-junction"}, + {17, ".uno:FlowChartShapes.flowchart-or"}, + {18, ".uno:FlowChartShapes.flowchart-collate"}, + {19, ".uno:FlowChartShapes.flowchart-sort"}, + {20, ".uno:FlowChartShapes.flowchart-extract"}, + {21, ".uno:FlowChartShapes.flowchart-merge"}, + {22, ".uno:FlowChartShapes.flowchart-stored-data"}, + {23, ".uno:FlowChartShapes.flowchart-delay"}, + {24, ".uno:FlowChartShapes.flowchart-sequential-access"}, + {25, ".uno:FlowChartShapes.flowchart-magnetic-disk"}, + {26, ".uno:FlowChartShapes.flowchart-direct-access-storage"}, + {27, ".uno:FlowChartShapes.flowchart-display"} + }; + + mpCalloutShapes = decltype(mpCalloutShapes){ + {0, ".uno:CalloutShapes.rectangular-callout"}, + {1, ".uno:CalloutShapes.round-rectangular-callout"}, + {2, ".uno:CalloutShapes.round-callout"}, + {3, ".uno:CalloutShapes.cloud-callout"}, + {4, ".uno:CalloutShapes.line-callout-1"}, + {5, ".uno:CalloutShapes.line-callout-2"}, + {6, ".uno:CalloutShapes.line-callout-3"} + }; + + mpStarShapes = decltype(mpStarShapes){ + {0, ".uno:StarShapes.star4"}, + {1, ".uno:StarShapes.star5"}, + {2, ".uno:StarShapes.star6"}, + {3, ".uno:StarShapes.star8"}, + {4, ".uno:StarShapes.star12"}, + {5, ".uno:StarShapes.star24"}, + {6, ".uno:StarShapes.bang"}, + {7, ".uno:StarShapes.vertical-scroll"}, + {8, ".uno:StarShapes.horizontal-scroll"}, + {9, ".uno:StarShapes.signet"}, + {10, ".uno:StarShapes.doorplate"}, + {11, ".uno:StarShapes.concave-star6"} + }; + + mp3DShapes = decltype(mp3DShapes){ + {0, ".uno:Cube"}, + {1, ".uno:Sphere"}, + {2, ".uno:Cylinder"}, + {3, ".uno:Cone"}, + {4, ".uno:Cyramid"}, + {5, ".uno:Torus"}, + {6, ".uno:Shell3D"}, + {7, ".uno:HalfSphere"} + }; +} +}} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/svx/source/sidebar/shapes/ShapesUtil.hxx b/svx/source/sidebar/shapes/ShapesUtil.hxx new file mode 100644 index 000000000000..0ac33f574b45 --- /dev/null +++ b/svx/source/sidebar/shapes/ShapesUtil.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 INCLUDED_SVX_SOURCE_SIDEBAR_SHAPES_SHAPESUTIL_HXX +#define INCLUDED_SVX_SOURCE_SIDEBAR_SHAPES_SHAPESUTIL_HXX +#include <map> +#include <rtl/ustring.hxx> + +namespace svx{ namespace sidebar { + +class SvxShapeCommandsMap +{ +public: + SvxShapeCommandsMap(); + std::map<sal_uInt16, rtl::OUString> mpLineShapes, mpCurveShapes, + mpConnectorShapes, mpBasicShapes, mpSymbolShapes, + mpBlockArrowShapes, mpFlowchartShapes, + mpCalloutShapes, mpStarShapes, mp3DShapes; +}; +}} + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/svx/uiconfig/ui/defaultshapespanel.ui b/svx/uiconfig/ui/defaultshapespanel.ui new file mode 100644 index 000000000000..43db7be7dc65 --- /dev/null +++ b/svx/uiconfig/ui/defaultshapespanel.ui @@ -0,0 +1,423 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> +<interface> + <requires lib="gtk+" version="3.10"/> + <!-- interface-requires LibreOffice 1.0 --> + <object class="GtkGrid" id="DefaultShapesPanel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="row_homogeneous">True</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkBox" id="box1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child> + <object class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="height_request">300</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkViewport" id="viewport1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkBox" id="box2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkFrame" id="LinesFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="LinesArrows"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Lines & Arrows</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="CurveFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="Curves"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Curve</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="ConnectorFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="Connectors"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Connectors</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="BasicShapesFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="BasicShapes"> + <property name="height_request">100</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Basic Shapes</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="Symbols"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="SymbolShapes"> + <property name="height_request">75</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Symbols</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="BlockArrowFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="BlockArrows"> + <property name="height_request">125</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Block Arrows</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">5</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="FlowchartFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="Flowcharts"> + <property name="height_request">125</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Flowchart</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">6</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="CalloutFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="Callouts"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Callouts</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">7</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="StarsFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="Stars"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Stars</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">8</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="3DObjectsFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="svtlo-ValueSet" id="3DObjects"> + <property name="height_request">50</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label10"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">3D Objects</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">9</property> + </packing> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + <property name="width">1</property> + <property name="height">1</property> + </packing> + </child> + </object> +</interface> |