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/fixed.hxx>
23 #include <vcl/field.hxx>
24 #include <vcl/layout.hxx>
25 #include <memory>
26 #include <svl/poolitem.hxx>
28 #include <svx/xtable.hxx>
30 #include <svx/svxdllapi.h>
31 
32 
33 class XLineStyleItem;
34 class XLineDashItem;
35 class XLineStartItem;
36 class XLineWidthItem;
37 class XLineEndItem;
38 class XLineEndList;
39 class XLineJointItem;
40 class XLineCapItem;
42 class XDashList;
43 class ListBox;
44 class ToolBox;
45 class FloatingWindow;
46 
47 #define SIDEBAR_LINE_WIDTH_GLOBAL_VALUE "PopupPanel_LineWidth"
48 
49 namespace sfx2 { namespace sidebar {
50 
51 class SidebarToolBox;
52 
53 } }
54 
55 namespace svx
56 {
57 namespace sidebar
58 {
59 
61 {
62 public:
63  virtual ~LinePropertyPanelBase() override;
64  virtual void dispose() override;
65 
66  virtual void DataChanged(
67  const DataChangedEvent& rEvent) override;
68 
69  void SetWidth(long nWidth);
70  void SetWidthIcon(int n);
71  void SetWidthIcon();
72 
73  // constructor/destructor
75  vcl::Window* pParent,
76  const css::uno::Reference<css::frame::XFrame>& rxFrame);
77 
78  virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
79 
80 protected:
81 
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;
89 
90 
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);
99 
100  void FillLineEndList();
101  void FillLineStyleList();
102  void SelectEndStyle(bool bStart);
103  void SelectLineStyle();
104  void ActivateControls();
105 
106  void setMapUnit(MapUnit eMapUnit);
107 
108  void disableArrowHead();
109 
110 protected:
111 
113 
114 private:
115  //ui controls
129 
130  std::unique_ptr<XLineStyleItem> mpStyleItem;
131  std::unique_ptr<XLineDashItem> mpDashItem;
132 
133  sal_uInt16 mnTrans;
135  sal_Int32 mnWidthCoreValue;
138  std::unique_ptr<XLineStartItem> mpStartItem;
139  std::unique_ptr<XLineEndItem> mpEndItem;
140 
141  //popup windows
143 
144  // images from resource
146 
147  // multi-images
148  std::unique_ptr<Image[]> mpIMGWidthIcon;
149 
150  bool mbWidthValuable : 1;
152 
153  void Initialize();
154 
155  DECL_LINK(ChangeLineStyleHdl, ListBox&, void);
156  DECL_LINK(ToolboxWidthSelectHdl, ToolBox*, void);
157  DECL_LINK(ChangeTransparentHdl, Edit&, void );
158  DECL_LINK(ChangeStartHdl, ListBox&, void);
159  DECL_LINK(ChangeEndHdl, ListBox&, void);
160  DECL_LINK(ChangeEdgeStyleHdl, ListBox&, void);
161  DECL_LINK(ChangeCapStyleHdl, ListBox&, void);
162 };
163 
164 } } // end of namespace svx::sidebar
165 
166 #endif
167 
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< XLineStyleItem > mpStyleItem
This class is the base for the Widget Layout-based sidebar panels.
Definition: PanelLayout.hxx:24
sal_Int64 n
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
std::unique_ptr< XLineStartItem > mpStartItem
std::unique_ptr< XLineEndItem > mpEndItem
std::unique_ptr< XLineDashItem > mpDashItem
MapUnit
VclPtr< sfx2::sidebar::SidebarToolBox > mpTBColor
void dispose()