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>
25 #include <svx/dlgctrl.hxx>
27 #include <svx/xtable.hxx>
29 #include <svx/svxdllapi.h>
30 
32 class XLineStyleItem;
33 class XLineDashItem;
34 class XLineStartItem;
35 class XLineWidthItem;
36 class XLineEndItem;
37 class XLineEndList;
38 class XLineJointItem;
39 class XLineCapItem;
41 class XDashList;
42 
43 namespace svx
44 {
45 namespace sidebar
46 {
47 
49 {
50 public:
51  virtual ~LinePropertyPanelBase() override;
52  virtual void dispose() override;
53 
54  virtual void DataChanged(
55  const DataChangedEvent& rEvent) override;
56 
57  void SetWidth(long nWidth);
58  void SetWidthIcon(int n);
59  void SetWidthIcon();
60 
61  void EndLineWidthPopup();
62 
63  // constructor/destructor
65  vcl::Window* pParent,
66  const css::uno::Reference<css::frame::XFrame>& rxFrame);
67 
68  virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
69 
70 protected:
71 
72  virtual void setLineStyle(const XLineStyleItem& rItem) = 0;
73  virtual void setLineDash(const XLineDashItem& rItem) = 0;
74  virtual void setLineEndStyle(const XLineEndItem* pItem) = 0;
75  virtual void setLineStartStyle(const XLineStartItem* pItem) = 0;
76  virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
77  virtual void setLineJoint(const XLineJointItem* pItem) = 0;
78  virtual void setLineCap(const XLineCapItem* pItem) = 0;
79 
80 
81  void updateLineStyle(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
82  void updateLineDash(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
83  void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
84  void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
85  void updateLineStart(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
86  void updateLineEnd(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
87  void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
88  void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
89 
90  void FillLineEndList();
91  void FillLineStyleList();
92  void SelectEndStyle(bool bStart);
93  void SelectLineStyle();
94  void ActivateControls();
95 
96  void setMapUnit(MapUnit eMapUnit);
97 
98  void enableArrowHead();
99  void disableArrowHead();
100 
101 protected:
102 
103  std::unique_ptr<weld::Toolbar> mxTBColor;
104  std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
105 
106 private:
107  //ui controls
108  std::unique_ptr<weld::Label> mxFTWidth;
109  std::unique_ptr<weld::Toolbar> mxTBWidth;
110  std::unique_ptr<SvxLineLB> mxLBStyle;
111  std::unique_ptr<weld::Label> mxFTTransparency;
112  std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
113  std::unique_ptr<SvxLineEndLB> mxLBStart;
114  std::unique_ptr<SvxLineEndLB> mxLBEnd;
115  std::unique_ptr<weld::Label> mxFTEdgeStyle;
116  std::unique_ptr<weld::ComboBox> mxLBEdgeStyle;
117  std::unique_ptr<weld::Label> mxFTCapStyle;
118  std::unique_ptr<weld::ComboBox> mxLBCapStyle;
119  std::unique_ptr<weld::Widget> mxGridLineProps;
120  std::unique_ptr<weld::Widget> mxBoxArrowProps;
121  //popup windows
122  std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
123 
124  std::unique_ptr<XLineStyleItem> mpStyleItem;
125  std::unique_ptr<XLineDashItem> mpDashItem;
126 
127  sal_uInt16 mnTrans;
129  sal_Int32 mnWidthCoreValue;
132  std::unique_ptr<XLineStartItem> mpStartItem;
133  std::unique_ptr<XLineEndItem> mpEndItem;
134 
135  // images from resource
136  OUString maIMGNone;
137 
138  // multi-images
139  OUString maIMGWidthIcon[8];
140 
141  bool mbWidthValuable : 1;
143 
144  void Initialize();
145 
146  DECL_LINK(ChangeLineStyleHdl, weld::ComboBox&, void);
147  DECL_LINK(ToolboxWidthSelectHdl, const OString&, void);
148  DECL_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void );
149  DECL_LINK(ChangeStartHdl, weld::ComboBox&, void);
150  DECL_LINK(ChangeEndHdl, weld::ComboBox&, void);
151  DECL_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void);
152  DECL_LINK(ChangeCapStyleHdl, weld::ComboBox&, void);
153 };
154 
155 } } // end of namespace svx::sidebar
156 
157 #endif
158 
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > mxFTTransparency
std::unique_ptr< XLineStyleItem > mpStyleItem
This class is the base for the Widget Layout-based sidebar panels.
Definition: PanelLayout.hxx:25
std::unique_ptr< weld::ComboBox > mxLBCapStyle
std::unique_ptr< weld::Toolbar > mxTBColor
sal_Int64 n
std::unique_ptr< weld::Widget > mxGridLineProps
std::unique_ptr< ToolbarUnoDispatcher > mxColorDispatch
std::unique_ptr< weld::Label > mxFTEdgeStyle
std::unique_ptr< weld::Label > mxFTCapStyle
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
std::unique_ptr< weld::Widget > mxBoxArrowProps
std::unique_ptr< SvxLineEndLB > mxLBStart
std::unique_ptr< XLineStartItem > mpStartItem
std::unique_ptr< XLineEndItem > mpEndItem
std::unique_ptr< SvxLineEndLB > mxLBEnd
std::unique_ptr< SvxLineLB > mxLBStyle
std::unique_ptr< weld::ComboBox > mxLBEdgeStyle
std::unique_ptr< XLineDashItem > mpDashItem
MapUnit
std::unique_ptr< weld::Toolbar > mxTBWidth
std::unique_ptr< LineWidthPopup > mxLineWidthPopup
void dispose()
std::unique_ptr< weld::Label > mxFTWidth
std::unique_ptr< weld::MetricSpinButton > mxMFTransparent