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 
30 class XLineStyleItem;
31 class XLineDashItem;
32 class XLineStartItem;
33 class XLineWidthItem;
34 class XLineEndItem;
35 class XLineEndList;
36 class XLineJointItem;
37 class XLineCapItem;
39 class XDashList;
40 
41 namespace svx::sidebar
42 {
43 
44 class DisableArrowsWrapper;
45 
47 {
48 public:
49  virtual ~LinePropertyPanelBase() override;
50  virtual void dispose() override;
51 
52  void SetWidth(long nWidth);
53  void SetWidthIcon(int n);
54  void SetWidthIcon();
55 
56  void EndLineWidthPopup();
57 
58  // constructor/destructor
60  vcl::Window* pParent,
61  const css::uno::Reference<css::frame::XFrame>& rxFrame);
62 
63  virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
64 
65  void SetNoneLineStyle(bool bNoneLineStyle)
66  {
67  if (bNoneLineStyle != mbNoneLineStyle)
68  {
69  mbNoneLineStyle = bNoneLineStyle;
70  ActivateControls();
71  }
72  }
73 
74 protected:
75 
76  void ActivateControls();
77 
78  virtual void setLineTransparency(const XLineTransparenceItem& rItem) = 0;
79  virtual void setLineJoint(const XLineJointItem* pItem) = 0;
80  virtual void setLineCap(const XLineCapItem* pItem) = 0;
81 
82  void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
83  void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
84  void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
85  void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
86 
87  void setMapUnit(MapUnit eMapUnit);
88 
89  void enableArrowHead();
90  void disableArrowHead();
91 
92 protected:
93 
94  std::unique_ptr<weld::Toolbar> mxTBColor;
95  std::unique_ptr<ToolbarUnoDispatcher> mxColorDispatch;
96 
97  std::unique_ptr<weld::Toolbar> mxLineStyleTB;
98  std::unique_ptr<ToolbarUnoDispatcher> mxLineStyleDispatch;
99 
100 private:
101  //ui controls
102  std::unique_ptr<weld::Label> mxFTWidth;
103  std::unique_ptr<weld::Toolbar> mxTBWidth;
104  std::unique_ptr<weld::Label> mxFTTransparency;
105  std::unique_ptr<weld::MetricSpinButton> mxMFTransparent;
106  std::unique_ptr<weld::Label> mxFTEdgeStyle;
107  std::unique_ptr<weld::ComboBox> mxLBEdgeStyle;
108  std::unique_ptr<weld::Label> mxFTCapStyle;
109  std::unique_ptr<weld::ComboBox> mxLBCapStyle;
110  std::unique_ptr<weld::Widget> mxGridLineProps;
111  std::unique_ptr<weld::Widget> mxBoxArrowProps;
112  //popup windows
113  std::unique_ptr<LineWidthPopup> mxLineWidthPopup;
114 
115  std::unique_ptr<DisableArrowsWrapper> mxDisableArrowsWrapper;
116 
117  sal_uInt16 mnTrans;
119  sal_Int32 mnWidthCoreValue;
120 
121  // images from resource
122  OUString maIMGNone;
123 
124  // multi-images
125  OUString maIMGWidthIcon[8];
126 
127  bool mbWidthValuable : 1;
130 
131  void Initialize();
132 
133  DECL_LINK(ToolboxWidthSelectHdl, const OString&, void);
134  DECL_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void );
135  DECL_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void);
136  DECL_LINK(ChangeCapStyleHdl, weld::ComboBox&, void);
137 };
138 
139 } // end of namespace svx::sidebar
140 
141 #endif
142 
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Label > mxFTTransparency
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< ToolbarUnoDispatcher > mxLineStyleDispatch
void SetNoneLineStyle(bool bNoneLineStyle)
std::unique_ptr< weld::Widget > mxBoxArrowProps
std::unique_ptr< weld::Toolbar > mxLineStyleTB
std::unique_ptr< weld::ComboBox > mxLBEdgeStyle
std::unique_ptr< DisableArrowsWrapper > mxDisableArrowsWrapper
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