nss: upgrade to release 3.73
[LibreOffice.git] / include / svx / sidebar / LinePropertyPanelBase.hxx
blobcd924e6b8a8fb778c4e44b2bd1ad7c3ed2a8e48b
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/weld.hxx>
23 #include <memory>
24 #include <svl/poolitem.hxx>
25 #include <sfx2/sidebar/PanelLayout.hxx>
26 #include <svx/sidebar/LineWidthPopup.hxx>
27 #include <svx/svxdllapi.h>
29 class ToolbarUnoDispatcher;
30 class XLineStyleItem;
31 class XLineDashItem;
32 class XLineStartItem;
33 class XLineWidthItem;
34 class XLineEndItem;
35 class XLineEndList;
36 class XLineJointItem;
37 class XLineCapItem;
38 class XLineTransparenceItem;
39 class XDashList;
41 namespace svx::sidebar
43 class LineStyleNoneChange;
45 class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout
47 public:
48 virtual ~LinePropertyPanelBase() override;
49 virtual void dispose() override;
51 void SetWidth(tools::Long nWidth);
52 void SetWidthIcon(int n);
53 void SetWidthIcon();
55 void EndLineWidthPopup();
57 // constructor/destructor
58 LinePropertyPanelBase(vcl::Window* pParent,
59 const css::uno::Reference<css::frame::XFrame>& rxFrame);
61 virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
63 void SetNoneLineStyle(bool bNoneLineStyle)
65 if (bNoneLineStyle != mbNoneLineStyle)
67 mbNoneLineStyle = bNoneLineStyle;
68 ActivateControls();
72 protected:
73 void ActivateControls();
75 virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
76 virtual void setLineJoint(const XLineJointItem* pItem) = 0;
77 virtual void setLineCap(const XLineCapItem* pItem) = 0;
79 void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
80 void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
81 void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
82 void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
84 void setMapUnit(MapUnit eMapUnit);
86 void enableArrowHead();
87 void disableArrowHead();
89 protected:
90 std::unique_ptr<weld::Toolbar> mxTBColor;
91 std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
93 std::unique_ptr<weld::Toolbar> mxLineStyleTB;
94 std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
96 private:
97 //ui controls
98 std::unique_ptr<weld::Label> mxFTWidth;
99 std::unique_ptr<weld::Toolbar> mxTBWidth;
100 std::unique_ptr<weld::Label> mxFTTransparency;
101 std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
102 std::unique_ptr<weld::Label> mxFTEdgeStyle;
103 std::unique_ptr<weld::ComboBox> mxLBEdgeStyle;
104 std::unique_ptr<weld::Label> mxFTCapStyle;
105 std::unique_ptr<weld::ComboBox> mxLBCapStyle;
106 std::unique_ptr<weld::Widget> mxGridLineProps;
107 std::unique_ptr<weld::Widget> mxBoxArrowProps;
108 //popup windows
109 std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
111 std::unique_ptr<LineStyleNoneChange> mxLineStyleNoneChange;
113 sal_uInt16 mnTrans;
114 MapUnit meMapUnit;
115 sal_Int32 mnWidthCoreValue;
117 // images from resource
118 OUString maIMGNone;
120 // multi-images
121 OUString maIMGWidthIcon[8];
123 bool mbWidthValuable : 1;
124 bool mbArrowSupported;
125 bool mbNoneLineStyle;
127 void Initialize();
129 DECL_LINK(ToolboxWidthSelectHdl, const OString&, void);
130 DECL_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void);
131 DECL_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void);
132 DECL_LINK(ChangeCapStyleHdl, weld::ComboBox&, void);
135 } // end of namespace svx::sidebar
137 #endif
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */