summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-29 02:46:50 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-30 05:45:22 +0200
commit57dcf78e6b17777f499fd7e7c2ee8d129bf0f79b (patch)
tree9a555967efb2810cd156a66291c331ad63eb2956 /include
parentfee180f13d48c1fa97a3ecde4b2067e5b0f13fc2 (diff)
provide structure for chart line panel
Change-Id: I75204a012e4bc59f40a06db814bb9057a1cf8598
Diffstat (limited to 'include')
-rw-r--r--include/svx/sidebar/LinePropertyPanelBase.hxx173
-rw-r--r--include/svx/sidebar/LineWidthPopup.hxx50
2 files changed, 223 insertions, 0 deletions
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
new file mode 100644
index 000000000000..6133061ee79f
--- /dev/null
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -0,0 +1,173 @@
+/* -*- 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_LINE_LINEPROPERTYPANELBASE_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
+
+#include <svx/xdash.hxx>
+#include <vcl/ctrl.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/layout.hxx>
+#include <memory>
+#include <svx/sidebar/PanelLayout.hxx>
+#include <svx/xtable.hxx>
+#include "LineWidthPopup.hxx"
+#include <svx/svxdllapi.h>
+
+
+class XLineStyleItem;
+class XLineDashItem;
+class XLineStartItem;
+class XLineWidthItem;
+class XLineEndItem;
+class XLineEndList;
+class XLineJointItem;
+class XLineCapItem;
+class XLineTransparenceItem;
+class XDashList;
+class ListBox;
+class ToolBox;
+class FloatingWindow;
+
+namespace
+{
+
+#define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE "PopupPanel_LineWidth"
+
+} //end of anonymous namespace
+
+namespace svx
+{
+namespace sidebar
+{
+
+class PopupContainer;
+class LineWidthControl;
+
+class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout
+{
+public:
+ virtual ~LinePropertyPanelBase();
+ virtual void dispose() SAL_OVERRIDE;
+
+ virtual void DataChanged(
+ const DataChangedEvent& rEvent) SAL_OVERRIDE;
+
+ void SetWidth(long nWidth);
+ void SetWidthIcon(int n);
+ void SetWidthIcon();
+
+ void EndLineWidthPopupMode();
+
+ // constructor/destuctor
+ LinePropertyPanelBase(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame);
+
+ virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
+
+protected:
+
+ virtual void setLineStyle(const XLineStyleItem& rItem) = 0;
+ virtual void setLineDash(const XLineDashItem& rItem) = 0;
+ virtual void setLineEndStyle(const XLineEndItem* pItem) = 0;
+ virtual void setLineStartStyle(const XLineStartItem* pItem) = 0;
+ virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
+ virtual void setLineJoint(const XLineJointItem* pItem) = 0;
+ virtual void setLineCap(const XLineCapItem* pItem) = 0;
+
+
+ void updateLineStyle(bool bDisabled, bool bSetOrDefault, const XLineStyleItem* pItem);
+ void updateLineDash(bool bDisabled, bool bSetOrDefault, const XLineDashItem* pItem);
+ void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const XLineTransparenceItem* pItem);
+ void updateLineWidth(bool bDisabled, bool bSetOrDefault, const XLineWidthItem* pItem);
+ void updateLineStart(bool bDisabled, bool bSetOrDefault, const XLineStartItem* pItem);
+ void updateLineEnd(bool bDisabled, bool bSetOrDefault, const XLineEndItem* pItem);
+ void updateLineJoint(bool bDisabled, bool bSetOrDefault, const XLineJointItem* pItem);
+ void updateLineCap(bool bDisabled, bool bSetOrDefault, const XLineCapItem* pItem);
+
+ void FillLineEndList();
+ void FillLineStyleList();
+ void SelectEndStyle(bool bStart);
+ void SelectLineStyle();
+ void ActivateControls();
+
+private:
+ //ui controls
+ VclPtr<FixedText> mpFTWidth;
+ VclPtr<ToolBox> mpTBWidth;
+ VclPtr<FixedText> mpFTStyle;
+ VclPtr<ListBox> mpLBStyle;
+ VclPtr<FixedText> mpFTTransparency;
+ VclPtr<MetricField> mpMFTransparent;
+ VclPtr<FixedText> mpFTArrow;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<ListBox> mpLBEnd;
+ VclPtr<FixedText> mpFTEdgeStyle;
+ VclPtr<ListBox> mpLBEdgeStyle;
+ VclPtr<FixedText> mpFTCapStyle;
+ VclPtr<ListBox> mpLBCapStyle;
+ VclPtr<VclGrid> mpGridLineProps;
+ VclPtr<VclVBox> mpBoxArrowProps;
+
+ std::unique_ptr<XLineStyleItem> mpStyleItem;
+ std::unique_ptr<XLineDashItem> mpDashItem;
+
+ sal_uInt16 mnTrans;
+ SfxMapUnit meMapUnit;
+ sal_Int32 mnWidthCoreValue;
+ XLineEndListRef mxLineEndList;
+ XDashListRef mxLineStyleList;
+ std::unique_ptr<XLineStartItem> mpStartItem;
+ std::unique_ptr<XLineEndItem> mpEndItem;
+
+ //popup windows
+ LineWidthPopup maLineWidthPopup;
+
+ // images from resource
+ Image maIMGNone;
+
+ // multi-images
+ std::unique_ptr<Image[]> mpIMGWidthIcon;
+
+ css::uno::Reference<css::frame::XFrame> mxFrame;
+
+ /// bitfield
+ bool mbWidthValuable : 1;
+
+ void Initialize();
+
+ DECL_LINK(ChangeLineStyleHdl, void*);
+ DECL_LINK_TYPED(ToolboxWidthSelectHdl, ToolBox*, void);
+ DECL_LINK(ChangeTransparentHdl , void *);
+ DECL_LINK(ChangeStartHdl, void *);
+ DECL_LINK(ChangeEndHdl, void *);
+ DECL_LINK(ChangeEdgeStyleHdl, void *);
+ DECL_LINK(ChangeCapStyleHdl, void *);
+
+ VclPtr<PopupControl> CreateLineWidthPopupControl (PopupContainer* pParent);
+};
+
+} } // end of namespace svx::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sidebar/LineWidthPopup.hxx b/include/svx/sidebar/LineWidthPopup.hxx
new file mode 100644
index 000000000000..772934fb07b3
--- /dev/null
+++ b/include/svx/sidebar/LineWidthPopup.hxx
@@ -0,0 +1,50 @@
+/* -*- 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_LINE_LINEWIDTHPOPUP_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX
+
+#include "svx/sidebar/Popup.hxx"
+
+#include <svl/poolitem.hxx>
+
+#include <boost/function.hpp>
+
+
+namespace svx { namespace sidebar {
+
+class LineWidthPopup
+ : public Popup
+{
+public:
+ LineWidthPopup (
+ vcl::Window* pParent,
+ const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator);
+ virtual ~LineWidthPopup();
+
+ void SetWidthSelect (long lValue, bool bValuable, SfxMapUnit eMapUnit);
+
+private:
+ void PopupModeEndCallback();
+};
+
+} } // end of namespace svx::sidebar
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */