LibreOffice Module svx (master) 1
LinePropertyPanelBase.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
20#define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX
21
22#include <vcl/weld.hxx>
23#include <memory>
24#include <svl/poolitem.hxx>
27#include <svx/svxdllapi.h>
28#include <com/sun/star/frame/XFrame.hpp>
29
31class XLineStyleItem;
32class XLineDashItem;
33class XLineStartItem;
34class XLineWidthItem;
35class XLineEndItem;
36class XLineEndList;
37class XLineJointItem;
38class XLineCapItem;
40class XDashList;
41
42namespace svx::sidebar
43{
44class LineStyleNoneChange;
45
47{
48public:
49 virtual ~LinePropertyPanelBase() override;
50
51 void SetWidth(tools::Long nWidth);
52 void SetWidthIcon(int n);
53 void SetWidthIcon();
54
55 void EndLineWidthPopup();
56
57 // constructor/destructor
59 const css::uno::Reference<css::frame::XFrame>& rxFrame);
60
61 virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
62
63 void SetNoneLineStyle(bool bNoneLineStyle)
64 {
65 if (bNoneLineStyle != mbNoneLineStyle)
66 {
67 mbNoneLineStyle = bNoneLineStyle;
68 ActivateControls();
69 }
70 }
71
72protected:
73 void ActivateControls();
74
75 virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
76 virtual void setLineJoint(const XLineJointItem* pItem) = 0;
77 virtual void setLineCap(const XLineCapItem* pItem) = 0;
78
79 void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
80 virtual 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);
83
84 void setMapUnit(MapUnit eMapUnit);
85
86 void enableArrowHead();
87 void disableArrowHead();
88
89protected:
90 std::unique_ptr<weld::Toolbar> mxTBColor;
91 std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
92
93 std::unique_ptr<weld::Toolbar> mxLineStyleTB;
94 std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
95
97
98private:
99 //ui controls
100 std::unique_ptr<weld::Label> mxFTWidth;
101 std::unique_ptr<weld::Toolbar> mxTBWidth;
102 std::unique_ptr<weld::Label> mxFTTransparency;
103 std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
104 std::unique_ptr<weld::Label> mxFTEdgeStyle;
105 std::unique_ptr<weld::ComboBox> mxLBEdgeStyle;
106 std::unique_ptr<weld::Label> mxFTCapStyle;
107 std::unique_ptr<weld::ComboBox> mxLBCapStyle;
108 std::unique_ptr<weld::Widget> mxGridLineProps;
109 std::unique_ptr<weld::Widget> mxBoxArrowProps;
110 //popup windows
111 std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
112
113 std::unique_ptr<LineStyleNoneChange> mxLineStyleNoneChange;
114
115 sal_uInt16 mnTrans;
117
118 // images from resource
119 OUString maIMGNone;
120
121 // multi-images
122 BitmapEx maIMGWidthIcon[8];
123
127
128 void Initialize();
129
130 DECL_DLLPRIVATE_LINK(ToolboxWidthSelectHdl, const OUString&, void);
131 DECL_DLLPRIVATE_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void);
132 DECL_DLLPRIVATE_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void);
133 DECL_DLLPRIVATE_LINK(ChangeCapStyleHdl, weld::ComboBox&, void);
134};
135
136} // end of namespace svx::sidebar
137
138#endif
139
140/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > mxFTCapStyle
std::unique_ptr< weld::Label > mxFTTransparency
DECL_DLLPRIVATE_LINK(ChangeTransparentHdl, weld::MetricSpinButton &, void)
std::unique_ptr< LineStyleNoneChange > mxLineStyleNoneChange
virtual void setLineCap(const XLineCapItem *pItem)=0
std::unique_ptr< ToolbarUnoDispatcher > mxLineStyleDispatch
DECL_DLLPRIVATE_LINK(ChangeCapStyleHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Toolbar > mxLineStyleTB
std::unique_ptr< weld::Label > mxFTEdgeStyle
std::unique_ptr< weld::ComboBox > mxLBCapStyle
virtual void setLineJoint(const XLineJointItem *pItem)=0
std::unique_ptr< LineWidthPopup > mxLineWidthPopup
virtual void setLineWidth(const XLineWidthItem &rItem)=0
void SetNoneLineStyle(bool bNoneLineStyle)
virtual void setLineTransparency(const XLineTransparenceItem &rItem)=0
std::unique_ptr< weld::MetricSpinButton > mxMFTransparent
std::unique_ptr< weld::Widget > mxGridLineProps
std::unique_ptr< weld::Toolbar > mxTBColor
std::unique_ptr< ToolbarUnoDispatcher > mxColorDispatch
std::unique_ptr< weld::ComboBox > mxLBEdgeStyle
std::unique_ptr< weld::Widget > mxBoxArrowProps
std::unique_ptr< weld::Label > mxFTWidth
DECL_DLLPRIVATE_LINK(ChangeEdgeStyleHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Toolbar > mxTBWidth
DECL_DLLPRIVATE_LINK(ToolboxWidthSelectHdl, const OUString &, void)
sal_Int64 n
MapUnit
long Long
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28