Bump version to 6.4-15
[LibreOffice.git] / include / svx / sidebar / LinePropertyPanelBase.hxx
blobe94513781fb638ca21fdcb034f98b3b1ddb93b73
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
20 #define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
22 #include <vcl/fixed.hxx>
23 #include <vcl/field.hxx>
24 #include <vcl/layout.hxx>
25 #include <memory>
26 #include <svl/poolitem.hxx>
27 #include <svx/sidebar/PanelLayout.hxx>
28 #include <svx/xtable.hxx>
29 #include <svx/sidebar/LineWidthPopup.hxx>
30 #include <svx/svxdllapi.h>
33 class XLineStyleItem;
34 class XLineDashItem;
35 class XLineStartItem;
36 class XLineWidthItem;
37 class XLineEndItem;
38 class XLineEndList;
39 class XLineJointItem;
40 class XLineCapItem;
41 class XLineTransparenceItem;
42 class XDashList;
43 class ListBox;
44 class ToolBox;
45 class FloatingWindow;
47 #define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE "PopupPanel_LineWidth"
49 namespace sfx2 { namespace sidebar {
51 class SidebarToolBox;
53 } }
55 namespace svx
57 namespace sidebar
60 class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout
62 public:
63 virtual ~LinePropertyPanelBase() override;
64 virtual void dispose() override;
66 virtual void DataChanged(
67 const DataChangedEvent& rEvent) override;
69 void SetWidth(long nWidth);
70 void SetWidthIcon(int n);
71 void SetWidthIcon();
73 // constructor/destructor
74 LinePropertyPanelBase(
75 vcl::Window* pParent,
76 const css::uno::Reference<css::frame::XFrame>& rxFrame);
78 virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
80 protected:
82 virtual void setLineStyle(const XLineStyleItem& rItem) = 0;
83 virtual void setLineDash(const XLineDashItem& rItem) = 0;
84 virtual void setLineEndStyle(const XLineEndItem* pItem) = 0;
85 virtual void setLineStartStyle(const XLineStartItem* pItem) = 0;
86 virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
87 virtual void setLineJoint(const XLineJointItem* pItem) = 0;
88 virtual void setLineCap(const XLineCapItem* pItem) = 0;
91 void updateLineStyle(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
92 void updateLineDash(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
93 void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
94 void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
95 void updateLineStart(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
96 void updateLineEnd(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
97 void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
98 void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
100 void FillLineEndList();
101 void FillLineStyleList();
102 void SelectEndStyle(bool bStart);
103 void SelectLineStyle();
104 void ActivateControls();
106 void setMapUnit(MapUnit eMapUnit);
108 void enableArrowHead();
109 void disableArrowHead();
111 protected:
113 VclPtr<sfx2::sidebar::SidebarToolBox> mpTBColor;
115 private:
116 //ui controls
117 VclPtr<FixedText> mpFTWidth;
118 VclPtr<ToolBox> mpTBWidth;
119 VclPtr<ListBox> mpLBStyle;
120 VclPtr<FixedText> mpFTTransparency;
121 VclPtr<MetricField> mpMFTransparent;
122 VclPtr<ListBox> mpLBStart;
123 VclPtr<ListBox> mpLBEnd;
124 VclPtr<FixedText> mpFTEdgeStyle;
125 VclPtr<ListBox> mpLBEdgeStyle;
126 VclPtr<FixedText> mpFTCapStyle;
127 VclPtr<ListBox> mpLBCapStyle;
128 VclPtr<VclGrid> mpGridLineProps;
129 VclPtr<VclVBox> mpBoxArrowProps;
131 std::unique_ptr<XLineStyleItem> mpStyleItem;
132 std::unique_ptr<XLineDashItem> mpDashItem;
134 sal_uInt16 mnTrans;
135 MapUnit meMapUnit;
136 sal_Int32 mnWidthCoreValue;
137 XLineEndListRef mxLineEndList;
138 XDashListRef mxLineStyleList;
139 std::unique_ptr<XLineStartItem> mpStartItem;
140 std::unique_ptr<XLineEndItem> mpEndItem;
142 //popup windows
143 VclPtr<LineWidthPopup> mxLineWidthPopup;
145 // images from resource
146 Image const maIMGNone;
148 // multi-images
149 std::unique_ptr<Image[]> mpIMGWidthIcon;
151 bool mbWidthValuable : 1;
152 bool mbArrowSupported;
154 void Initialize();
156 DECL_LINK(ChangeLineStyleHdl, ListBox&, void);
157 DECL_LINK(ToolboxWidthSelectHdl, ToolBox*, void);
158 DECL_LINK(ChangeTransparentHdl, Edit&, void );
159 DECL_LINK(ChangeStartHdl, ListBox&, void);
160 DECL_LINK(ChangeEndHdl, ListBox&, void);
161 DECL_LINK(ChangeEdgeStyleHdl, ListBox&, void);
162 DECL_LINK(ChangeCapStyleHdl, ListBox&, void);
165 } } // end of namespace svx::sidebar
167 #endif
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */