1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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>
41 class XLineTransparenceItem
;
47 #define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE "PopupPanel_LineWidth"
49 namespace sfx2
{ namespace sidebar
{
60 class SVX_DLLPUBLIC LinePropertyPanelBase
: public PanelLayout
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
);
73 // constructor/destructor
74 LinePropertyPanelBase(
76 const css::uno::Reference
<css::frame::XFrame
>& rxFrame
);
78 virtual void setLineWidth(const XLineWidthItem
& rItem
) = 0;
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();
113 VclPtr
<sfx2::sidebar::SidebarToolBox
> mpTBColor
;
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
;
136 sal_Int32 mnWidthCoreValue
;
137 XLineEndListRef mxLineEndList
;
138 XDashListRef mxLineStyleList
;
139 std::unique_ptr
<XLineStartItem
> mpStartItem
;
140 std::unique_ptr
<XLineEndItem
> mpEndItem
;
143 VclPtr
<LineWidthPopup
> mxLineWidthPopup
;
145 // images from resource
146 Image
const maIMGNone
;
149 std::unique_ptr
<Image
[]> mpIMGWidthIcon
;
151 bool mbWidthValuable
: 1;
152 bool mbArrowSupported
;
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
169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */