LibreOffice Module cui (master)  1
border.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_CUI_SOURCE_INC_BORDER_HXX
20 #define INCLUDED_CUI_SOURCE_INC_BORDER_HXX
21 
22 #include <editeng/shaditem.hxx>
23 #include <svtools/ctrlbox.hxx>
24 #include <vcl/weld.hxx>
25 #include <svtools/valueset.hxx>
26 #include <sfx2/tabdlg.hxx>
27 #include <svx/algitem.hxx>
28 #include <svx/colorbox.hxx>
29 #include <svx/frmsel.hxx>
30 #include <svx/flagsdef.hxx>
31 
32 #include <set>
33 
34 // forward ---------------------------------------------------------------
35 
36 namespace editeng
37 {
38  class SvxBorderLine;
39 }
40 
42 {
43 public:
44  explicit ShadowControlsWrapper(SvtValueSet& rVsPos, weld::MetricSpinButton& rMfSize, ColorListBox& rLbColor);
45 
46  SvxShadowItem GetControlValue(const SvxShadowItem& rItem) const;
47  void SetControlValue(const SvxShadowItem& rItem);
48  void SetControlDontKnow();
49 
50  bool get_value_changed_from_saved() const;
51 
52 private:
56 };
57 
59 {
60 public:
63 
64  SvxMarginItem GetControlValue(const SvxMarginItem& rItem) const;
65  void SetControlValue(const SvxMarginItem& rItem);
66  void SetControlDontKnow();
67 
68  bool get_value_changed_from_saved() const;
69 
70 private:
75 };
76 
78 {
79  friend class VclPtr<SvxBorderTabPage>;
81 
82  static const sal_uInt16 pRanges[];
83 
84 public:
85  virtual ~SvxBorderTabPage() override;
86  virtual void dispose() override;
87  static VclPtr<SfxTabPage> Create( TabPageParent pParent,
88  const SfxItemSet* rAttrSet);
89  static const sal_uInt16* GetRanges() { return pRanges; }
90 
91  virtual bool FillItemSet( SfxItemSet* rCoreAttrs ) override;
92  virtual void Reset( const SfxItemSet* ) override;
93  virtual void ChangesApplied() override;
94 
95  void HideShadowControls();
96  virtual void PageCreated(const SfxAllItemSet& aSet) override;
97  void SetTableMode();
98 protected:
99  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
100  virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
101 
102 private:
103  SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
104 
105  std::vector<Image> m_aShadowImgVec;
106  std::vector<Image> m_aBorderImgVec;
107 
108  long nMinValue;
110  sal_uInt16 mnBoxSlot;
111  sal_uInt16 mnShadowSlot;
112 
122  bool mbSync;
125 
126  std::set<SvxBorderLineStyle> maUsedBorderStyles;
127 
128  // Controls
130  std::unique_ptr<SvtValueSet> m_xWndPresets;
131  std::unique_ptr<weld::CustomWeld> m_xWndPresetsWin;
132  std::unique_ptr<weld::Label> m_xUserDefFT;
133  std::unique_ptr<weld::CustomWeld> m_xFrameSelWin;
134 
135  std::unique_ptr<SvtLineListBox> m_xLbLineStyle;
136  std::unique_ptr<ColorListBox> m_xLbLineColor;
137  std::unique_ptr<weld::MetricSpinButton> m_xLineWidthMF;
138 
139  std::unique_ptr<weld::Container> m_xSpacingFrame;
140  std::unique_ptr<weld::Label> m_xLeftFT;
141  std::unique_ptr<weld::MetricSpinButton> m_xLeftMF;
142  std::unique_ptr<weld::Label> m_xRightFT;
143  std::unique_ptr<weld::MetricSpinButton> m_xRightMF;
144  std::unique_ptr<weld::Label> m_xTopFT;
145  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
146  std::unique_ptr<weld::Label> m_xBottomFT;
147  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
148  std::unique_ptr<weld::CheckButton> m_xSynchronizeCB;
149 
150  std::unique_ptr<weld::Container> m_xShadowFrame;
151  std::unique_ptr<SvtValueSet> m_xWndShadows;
152  std::unique_ptr<weld::CustomWeld> m_xWndShadowsWin;
153  std::unique_ptr<weld::Label> m_xFtShadowSize;
154  std::unique_ptr<weld::MetricSpinButton> m_xEdShadowSize;
155  std::unique_ptr<weld::Label> m_xFtShadowColor;
156  std::unique_ptr<ColorListBox> m_xLbShadowColor;
157 
158  std::unique_ptr<weld::Container> m_xPropertiesFrame;
159  std::unique_ptr<weld::CheckButton> m_xMergeWithNextCB;
160  // #i29550#
161  std::unique_ptr<weld::CheckButton> m_xMergeAdjacentBordersCB;
162  std::unique_ptr<weld::CheckButton> m_xRemoveAdjcentCellBordersCB;
163  std::unique_ptr<weld::Label> m_xRemoveAdjcentCellBordersFT;
164  std::unique_ptr<ShadowControlsWrapper> m_xShadowControls;
165  std::unique_ptr<MarginControlsWrapper> m_xMarginControls;
166 
167  // Handler
168  DECL_LINK(SelStyleHdl_Impl, SvtLineListBox&, void);
169  DECL_LINK(SelColHdl_Impl, ColorListBox&, void);
170  DECL_LINK(SelPreHdl_Impl, SvtValueSet*, void);
171  DECL_LINK(SelSdwHdl_Impl, SvtValueSet*, void);
172  DECL_LINK(LinesChanged_Impl, LinkParamNone*, void);
173  DECL_LINK(ModifyDistanceHdl_Impl, weld::MetricSpinButton&, void);
174  DECL_LINK(ModifyWidthHdl_Impl, weld::MetricSpinButton&, void);
175  DECL_LINK(SyncHdl_Impl, weld::ToggleButton&, void);
176  DECL_LINK(RemoveAdjacentCellBorderHdl_Impl, weld::ToggleButton&, void);
177 
178  sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const;
179  const char* GetPresetStringId(sal_uInt16 nValueSetIdx) const;
180 
181  void FillPresetVS();
182  void FillShadowVS();
183  void FillValueSets();
184 
185  // Filler
186  void FillLineListBox_Impl();
187 
190  const editeng::SvxBorderLine* pCurLine,
191  bool bValid );
192 
193  bool IsBorderLineStyleAllowed( SvxBorderLineStyle nStyle ) const;
194  void UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset );
195 };
196 
197 
198 #endif
199 
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 mnShadowSlot
Definition: border.hxx:111
virtual ~SvxBorderTabPage() override
Definition: border.cxx:542
std::unique_ptr< SvtValueSet > m_xWndShadows
Definition: border.hxx:151
bool mbHorEnabled
true = Inner horizontal border enabled.
Definition: border.hxx:113
std::unique_ptr< ShadowControlsWrapper > m_xShadowControls
Definition: border.hxx:164
bool mbUseMarginItem
Definition: border.hxx:117
static const sal_uInt16 pRanges[]
Definition: border.hxx:82
std::unique_ptr< weld::Label > m_xRemoveAdjcentCellBordersFT
Definition: border.hxx:163
bool get_value_changed_from_saved() const
Definition: border.cxx:208
std::unique_ptr< weld::CheckButton > m_xMergeWithNextCB
Definition: border.hxx:159
bool mbLeftModified
Definition: border.hxx:118
weld::MetricSpinButton & mrRightWrp
Definition: border.hxx:72
const SfxItemSet * pSet
bool mbRemoveAdjacentCellBorders
Definition: border.hxx:123
SvtValueSet & mrVsPos
Definition: border.hxx:53
std::unique_ptr< weld::Label > m_xTopFT
Definition: border.hxx:144
virtual void ChangesApplied() override
Definition: border.cxx:835
sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1195
std::unique_ptr< weld::Container > m_xSpacingFrame
Definition: border.hxx:139
virtual void Reset(const SfxItemSet *) override
Definition: border.cxx:586
bool mbBottomModified
Definition: border.hxx:121
std::unique_ptr< ColorListBox > m_xLbLineColor
Definition: border.hxx:136
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: border.cxx:1509
sal_uInt16 mnBoxSlot
Definition: border.hxx:110
std::vector< Image > m_aShadowImgVec
Definition: border.hxx:105
void ResetFrameLine_Impl(svx::FrameBorderType eBorder, const editeng::SvxBorderLine *pCurLine, bool bValid)
share for individual Frame-/Core-Line
Definition: border.cxx:566
std::unique_ptr< weld::Container > m_xShadowFrame
Definition: border.hxx:150
std::unique_ptr< weld::CheckButton > m_xSynchronizeCB
Definition: border.hxx:148
std::unique_ptr< weld::CustomWeld > m_xWndShadowsWin
Definition: border.hxx:152
void SetControlDontKnow()
Definition: border.cxx:178
SvxBorderLineStyle
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: border.cxx:560
virtual void dispose() override
Definition: border.cxx:547
std::unique_ptr< weld::CustomWeld > m_xFrameSelWin
Definition: border.hxx:133
bool get_value_changed_from_saved() const
Definition: border.cxx:171
std::unique_ptr< weld::Label > m_xFtShadowColor
Definition: border.hxx:155
bool mbBLTREnabled
true = Bottom-left to top-right border enabled.
Definition: border.hxx:116
std::unique_ptr< weld::Container > m_xPropertiesFrame
properties - "Merge with next paragraph" in Writer
Definition: border.hxx:158
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: border.hxx:147
std::unique_ptr< weld::MetricSpinButton > m_xRightMF
Definition: border.hxx:143
std::vector< Image > m_aBorderImgVec
Definition: border.hxx:106
void FillShadowVS()
Definition: border.cxx:1281
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: border.cxx:845
weld::MetricSpinButton & mrLeftWrp
Definition: border.hxx:71
std::set< SvxBorderLineStyle > maUsedBorderStyles
Definition: border.hxx:126
SwBorderModes nSWMode
table, textframe, paragraph
Definition: border.hxx:109
weld::MetricSpinButton & mrBottomWrp
Definition: border.hxx:74
std::unique_ptr< weld::MetricSpinButton > m_xEdShadowSize
Definition: border.hxx:154
std::unique_ptr< weld::CheckButton > m_xRemoveAdjcentCellBordersCB
Definition: border.hxx:162
std::unique_ptr< weld::Label > m_xBottomFT
Definition: border.hxx:146
bool IsBorderLineStyleAllowed(SvxBorderLineStyle nStyle) const
Definition: border.cxx:577
std::unique_ptr< ColorListBox > m_xLbShadowColor
Definition: border.hxx:156
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: border.hxx:145
bool mbVerEnabled
true = Inner vertical border enabled.
Definition: border.hxx:114
bool mbTopModified
Definition: border.hxx:120
weld::MetricSpinButton & mrTopWrp
Definition: border.hxx:73
void FillValueSets()
Definition: border.cxx:1306
FrameBorderType
const char * GetPresetStringId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1228
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: border.cxx:853
void SetControlValue(const SvxMarginItem &rItem)
Definition: border.cxx:216
DECL_LINK(SelStyleHdl_Impl, SvtLineListBox &, void)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: border.cxx:1501
std::unique_ptr< weld::Label > m_xRightFT
Definition: border.hxx:142
std::unique_ptr< weld::Label > m_xLeftFT
Definition: border.hxx:140
SvxShadowItem GetControlValue(const SvxShadowItem &rItem) const
Definition: border.cxx:104
bool mbRightModified
Definition: border.hxx:119
std::unique_ptr< weld::MetricSpinButton > m_xLeftMF
Definition: border.hxx:141
long nMinValue
minimum distance
Definition: border.hxx:108
SvxMarginItem GetControlValue(const SvxMarginItem &rItem) const
Definition: border.cxx:194
std::unique_ptr< weld::Label > m_xFtShadowSize
Definition: border.hxx:153
MarginControlsWrapper(weld::MetricSpinButton &rMfLeft, weld::MetricSpinButton &rMfRight, weld::MetricSpinButton &rMfTop, weld::MetricSpinButton &rMfBottom)
Definition: border.cxx:185
svx::FrameSelector m_aFrameSel
Definition: border.hxx:129
std::unique_ptr< weld::CustomWeld > m_xWndPresetsWin
Definition: border.hxx:131
void SetTableMode()
Definition: border.cxx:1535
std::unique_ptr< SvtValueSet > m_xWndPresets
Definition: border.hxx:130
std::unique_ptr< SvtLineListBox > m_xLbLineStyle
Definition: border.hxx:135
SvxBorderTabPage(TabPageParent pParent, const SfxItemSet &rCoreAttrs)
Definition: border.cxx:237
bool mbTLBREnabled
true = Top-left to bottom-right border enabled.
Definition: border.hxx:115
ColorListBox & mrLbColor
Definition: border.hxx:55
std::unique_ptr< weld::Label > m_xUserDefFT
Definition: border.hxx:132
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthMF
Definition: border.hxx:137
void HideShadowControls()
Definition: border.cxx:1058
void SetControlValue(const SvxShadowItem &rItem)
Definition: border.cxx:141
DeactivateRC
SwBorderModes
void FillLineListBox_Impl()
Definition: border.cxx:1318
void FillPresetVS()
Definition: border.cxx:1261
virtual void DeactivatePage()
std::unique_ptr< MarginControlsWrapper > m_xMarginControls
Definition: border.hxx:165
std::unique_ptr< weld::CheckButton > m_xMergeAdjacentBordersCB
Definition: border.hxx:161
ShadowControlsWrapper(SvtValueSet &rVsPos, weld::MetricSpinButton &rMfSize, ColorListBox &rLbColor)
Definition: border.cxx:97
void UpdateRemoveAdjCellBorderCB(sal_uInt16 nPreset)
Definition: border.cxx:1453
weld::MetricSpinButton & mrMfSize
Definition: border.hxx:54
static const sal_uInt16 * GetRanges()
Definition: border.hxx:89
void SetControlDontKnow()
Definition: border.cxx:228