cid#1636693 COPY_INSTEAD_OF_MOVE
[LibreOffice.git] / include / svx / sidebar / LinePropertyPanelBase.hxx
blobf15f0de9fc2be08b2a55e2c0cb82ce21f7386ade
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>
28 #include <com/sun/star/frame/XFrame.hpp>
30 class ToolbarUnoDispatcher;
31 class XLineStyleItem;
32 class XLineDashItem;
33 class XLineStartItem;
34 class XLineWidthItem;
35 class XLineEndItem;
36 class XLineEndList;
37 class XLineTransparenceItem;
38 class XDashList;
40 namespace svx::sidebar
42 class LineStyleNoneChange;
44 class UNLESS_MERGELIBS(SVX_DLLPUBLIC) LinePropertyPanelBase : public PanelLayout
46 public:
47 virtual ~LinePropertyPanelBase() override;
49 void SetWidth(tools::Long nWidth);
50 void SetWidthIcon(int n);
51 void SetWidthIcon();
53 void EndLineWidthPopup();
55 // constructor/destructor
56 LinePropertyPanelBase(weld::Widget* pParent,
57 const css::uno::Reference<css::frame::XFrame>& rxFrame);
59 virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
61 void SetNoneLineStyle(bool bNoneLineStyle)
63 if (bNoneLineStyle != mbNoneLineStyle)
65 mbNoneLineStyle = bNoneLineStyle;
66 ActivateControls();
70 protected:
71 void ActivateControls();
73 virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
75 void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
76 virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
78 void setMapUnit(MapUnit eMapUnit);
80 void enableArrowHead();
81 void disableArrowHead();
83 protected:
84 std::unique_ptr<weld::Toolbar> mxTBColor;
85 std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
87 std::unique_ptr<weld::Toolbar> mxLineStyleTB;
88 std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
90 sal_Int32 mnWidthCoreValue;
92 private:
93 //ui controls
94 std::unique_ptr<weld::Label> mxFTWidth;
95 std::unique_ptr<weld::Toolbar> mxTBWidth;
96 std::unique_ptr<weld::Label> mxFTTransparency;
97 std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
98 std::unique_ptr<weld::Label> mxArrowHeadStyleFT;
99 std::unique_ptr<weld::Toolbar> mxArrowHeadStyleTB;
100 std::unique_ptr<ToolbarUnoDispatcher> mxArrowHeadStyleDispatch;
101 //popup windows
102 std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
104 std::unique_ptr<LineStyleNoneChange> mxLineStyleNoneChange;
106 sal_uInt16 mnTrans;
107 MapUnit meMapUnit;
109 // images from resource
110 OUString maIMGNone;
112 // multi-images
113 BitmapEx maIMGWidthIcon[8];
115 bool mbWidthValuable : 1;
116 bool mbArrowSupported;
117 bool mbNoneLineStyle;
119 void Initialize();
121 DECL_DLLPRIVATE_LINK(ToolboxWidthSelectHdl, const OUString&, void);
122 DECL_DLLPRIVATE_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void);
125 } // end of namespace svx::sidebar
127 #endif
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */