/src/libreoffice/include/svx/sidebar/LinePropertyPanelBase.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | #pragma once |
20 | | |
21 | | #include <vcl/weld/MetricSpinButton.hxx> |
22 | | #include <vcl/weld/Toolbar.hxx> |
23 | | #include <vcl/weld/weld.hxx> |
24 | | #include <memory> |
25 | | #include <svl/poolitem.hxx> |
26 | | #include <sfx2/sidebar/PanelLayout.hxx> |
27 | | #include <svx/sidebar/LineWidthPopup.hxx> |
28 | | #include <svx/svxdllapi.h> |
29 | | #include <com/sun/star/frame/XFrame.hpp> |
30 | | |
31 | | class ToolbarUnoDispatcher; |
32 | | class XLineWidthItem; |
33 | | class XLineTransparenceItem; |
34 | | |
35 | | namespace svx::sidebar |
36 | | { |
37 | | class LineStyleNoneChange; |
38 | | |
39 | | class UNLESS_MERGELIBS(SVX_DLLPUBLIC) LinePropertyPanelBase : public PanelLayout |
40 | | { |
41 | | public: |
42 | | virtual ~LinePropertyPanelBase() override; |
43 | | |
44 | | void SetWidth(tools::Long nWidth); |
45 | | void SetWidthIcon(int n); |
46 | | void SetWidthIcon(); |
47 | | |
48 | | void EndLineWidthPopup(); |
49 | | |
50 | | // constructor/destructor |
51 | | LinePropertyPanelBase(weld::Widget* pParent, |
52 | | const css::uno::Reference<css::frame::XFrame>& rxFrame); |
53 | | |
54 | | virtual void setLineWidth(const XLineWidthItem& rItem) = 0; |
55 | | |
56 | | void SetNoneLineStyle(bool bNoneLineStyle) |
57 | 0 | { |
58 | 0 | if (bNoneLineStyle != mbNoneLineStyle) |
59 | 0 | { |
60 | 0 | mbNoneLineStyle = bNoneLineStyle; |
61 | 0 | ActivateControls(); |
62 | 0 | } |
63 | 0 | } |
64 | | |
65 | | protected: |
66 | | void ActivateControls(); |
67 | | |
68 | | virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0; |
69 | | |
70 | | void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); |
71 | | virtual void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem); |
72 | | |
73 | | void setMapUnit(MapUnit eMapUnit); |
74 | | |
75 | | void enableArrowHead(); |
76 | | void disableArrowHead(); |
77 | | |
78 | | protected: |
79 | | std::unique_ptr<weld::Toolbar> mxTBColor; |
80 | | std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch; |
81 | | |
82 | | std::unique_ptr<weld::Toolbar> mxLineStyleTB; |
83 | | std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch; |
84 | | |
85 | | sal_Int32 mnWidthCoreValue; |
86 | | |
87 | | private: |
88 | | //ui controls |
89 | | std::unique_ptr<weld::Label> mxFTWidth; |
90 | | std::unique_ptr<weld::Toolbar> mxTBWidth; |
91 | | std::unique_ptr<weld::Label> mxFTTransparency; |
92 | | std::unique_ptr<weld::MetricSpinButton> mxMFTransparent; |
93 | | std::unique_ptr<weld::Label> mxArrowHeadStyleFT; |
94 | | std::unique_ptr<weld::Toolbar> mxArrowHeadStyleTB; |
95 | | std::unique_ptr<ToolbarUnoDispatcher> mxArrowHeadStyleDispatch; |
96 | | //popup windows |
97 | | std::unique_ptr<LineWidthPopup> mxLineWidthPopup; |
98 | | |
99 | | std::unique_ptr<LineStyleNoneChange> mxLineStyleNoneChange; |
100 | | |
101 | | sal_uInt16 mnTrans; |
102 | | MapUnit meMapUnit; |
103 | | |
104 | | // images from resource |
105 | | OUString maIMGNone; |
106 | | |
107 | | // multi-images |
108 | | Bitmap maIMGWidthIcon[8]; |
109 | | |
110 | | bool mbWidthValuable : 1; |
111 | | bool mbArrowSupported; |
112 | | bool mbNoneLineStyle; |
113 | | |
114 | | void Initialize(); |
115 | | |
116 | | DECL_DLLPRIVATE_LINK(ToolboxWidthSelectHdl, const OUString&, void); |
117 | | DECL_DLLPRIVATE_LINK(ToolboxWidthToggleMenuHdl, const OUString&, void); |
118 | | DECL_DLLPRIVATE_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void); |
119 | | }; |
120 | | |
121 | | } // end of namespace svx::sidebar |
122 | | |
123 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |