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  static const sal_uInt16 pRanges[];
80 
81 public:
82  SvxBorderTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
83  virtual ~SvxBorderTabPage() override;
84  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
85  const SfxItemSet* rAttrSet);
86  static const sal_uInt16* GetRanges() { return pRanges; }
87 
88  virtual bool FillItemSet( SfxItemSet* rCoreAttrs ) override;
89  virtual void Reset( const SfxItemSet* ) override;
90  virtual void ChangesApplied() override;
91 
92  void HideShadowControls();
93  virtual void PageCreated(const SfxAllItemSet& aSet) override;
94  void SetTableMode();
95 protected:
96  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
97 
98 private:
99  std::vector<Image> m_aShadowImgVec;
100  std::vector<Image> m_aBorderImgVec;
101 
102  long nMinValue;
104  sal_uInt16 mnBoxSlot;
105  sal_uInt16 mnShadowSlot;
106 
116  bool mbSync;
119 
120  std::set<SvxBorderLineStyle> maUsedBorderStyles;
121 
122  // Controls
124  std::unique_ptr<SvtValueSet> m_xWndPresets;
125  std::unique_ptr<weld::CustomWeld> m_xWndPresetsWin;
126  std::unique_ptr<weld::Label> m_xUserDefFT;
127  std::unique_ptr<weld::CustomWeld> m_xFrameSelWin;
128 
129  std::unique_ptr<SvtLineListBox> m_xLbLineStyle;
130  std::unique_ptr<ColorListBox> m_xLbLineColor;
131  std::unique_ptr<weld::MetricSpinButton> m_xLineWidthMF;
132 
133  std::unique_ptr<weld::Container> m_xSpacingFrame;
134  std::unique_ptr<weld::Label> m_xLeftFT;
135  std::unique_ptr<weld::MetricSpinButton> m_xLeftMF;
136  std::unique_ptr<weld::Label> m_xRightFT;
137  std::unique_ptr<weld::MetricSpinButton> m_xRightMF;
138  std::unique_ptr<weld::Label> m_xTopFT;
139  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
140  std::unique_ptr<weld::Label> m_xBottomFT;
141  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
142  std::unique_ptr<weld::CheckButton> m_xSynchronizeCB;
143 
144  std::unique_ptr<weld::Container> m_xShadowFrame;
145  std::unique_ptr<SvtValueSet> m_xWndShadows;
146  std::unique_ptr<weld::CustomWeld> m_xWndShadowsWin;
147  std::unique_ptr<weld::Label> m_xFtShadowSize;
148  std::unique_ptr<weld::MetricSpinButton> m_xEdShadowSize;
149  std::unique_ptr<weld::Label> m_xFtShadowColor;
150  std::unique_ptr<ColorListBox> m_xLbShadowColor;
151 
152  std::unique_ptr<weld::Container> m_xPropertiesFrame;
153  std::unique_ptr<weld::CheckButton> m_xMergeWithNextCB;
154  // #i29550#
155  std::unique_ptr<weld::CheckButton> m_xMergeAdjacentBordersCB;
156  std::unique_ptr<weld::CheckButton> m_xRemoveAdjcentCellBordersCB;
157  std::unique_ptr<weld::Label> m_xRemoveAdjcentCellBordersFT;
158  std::unique_ptr<ShadowControlsWrapper> m_xShadowControls;
159  std::unique_ptr<MarginControlsWrapper> m_xMarginControls;
160 
161  // Handler
162  DECL_LINK(SelStyleHdl_Impl, SvtLineListBox&, void);
163  DECL_LINK(SelColHdl_Impl, ColorListBox&, void);
164  DECL_LINK(SelPreHdl_Impl, SvtValueSet*, void);
165  DECL_LINK(SelSdwHdl_Impl, SvtValueSet*, void);
166  DECL_LINK(LinesChanged_Impl, LinkParamNone*, void);
167  DECL_LINK(ModifyDistanceHdl_Impl, weld::MetricSpinButton&, void);
168  DECL_LINK(ModifyWidthHdl_Impl, weld::MetricSpinButton&, void);
169  DECL_LINK(SyncHdl_Impl, weld::ToggleButton&, void);
170  DECL_LINK(RemoveAdjacentCellBorderHdl_Impl, weld::ToggleButton&, void);
171 
172  sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const;
173  const char* GetPresetStringId(sal_uInt16 nValueSetIdx) const;
174 
175  void FillPresetVS();
176  void FillShadowVS();
177  void FillValueSets();
178 
179  // Filler
180  void FillLineListBox_Impl();
181 
184  const editeng::SvxBorderLine* pCurLine,
185  bool bValid );
186 
187  bool IsBorderLineStyleAllowed( SvxBorderLineStyle nStyle ) const;
188  void UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset );
189 };
190 
191 
192 #endif
193 
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 mnShadowSlot
Definition: border.hxx:105
virtual ~SvxBorderTabPage() override
Definition: border.cxx:535
std::unique_ptr< SvtValueSet > m_xWndShadows
Definition: border.hxx:145
bool mbHorEnabled
true = Inner horizontal border enabled.
Definition: border.hxx:107
std::unique_ptr< ShadowControlsWrapper > m_xShadowControls
Definition: border.hxx:158
bool mbUseMarginItem
Definition: border.hxx:111
static const sal_uInt16 pRanges[]
Definition: border.hxx:79
std::unique_ptr< weld::Label > m_xRemoveAdjcentCellBordersFT
Definition: border.hxx:157
bool get_value_changed_from_saved() const
Definition: border.cxx:201
std::unique_ptr< weld::CheckButton > m_xMergeWithNextCB
Definition: border.hxx:153
bool mbLeftModified
Definition: border.hxx:112
weld::MetricSpinButton & mrRightWrp
Definition: border.hxx:72
const SfxItemSet * pSet
bool mbRemoveAdjacentCellBorders
Definition: border.hxx:117
SvtValueSet & mrVsPos
Definition: border.hxx:53
std::unique_ptr< weld::Label > m_xTopFT
Definition: border.hxx:138
virtual void ChangesApplied() override
Definition: border.cxx:823
sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1183
std::unique_ptr< weld::Container > m_xSpacingFrame
Definition: border.hxx:133
virtual void Reset(const SfxItemSet *) override
Definition: border.cxx:573
bool mbBottomModified
Definition: border.hxx:115
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: border.cxx:547
std::unique_ptr< ColorListBox > m_xLbLineColor
Definition: border.hxx:130
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: border.cxx:1489
SvxBorderTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
Definition: border.cxx:230
sal_uInt16 mnBoxSlot
Definition: border.hxx:104
std::vector< Image > m_aShadowImgVec
Definition: border.hxx:99
void ResetFrameLine_Impl(svx::FrameBorderType eBorder, const editeng::SvxBorderLine *pCurLine, bool bValid)
share for individual Frame-/Core-Line
Definition: border.cxx:553
std::unique_ptr< weld::Container > m_xShadowFrame
Definition: border.hxx:144
std::unique_ptr< weld::CheckButton > m_xSynchronizeCB
Definition: border.hxx:142
std::unique_ptr< weld::CustomWeld > m_xWndShadowsWin
Definition: border.hxx:146
void SetControlDontKnow()
Definition: border.cxx:171
SvxBorderLineStyle
std::unique_ptr< weld::CustomWeld > m_xFrameSelWin
Definition: border.hxx:127
bool get_value_changed_from_saved() const
Definition: border.cxx:164
std::unique_ptr< weld::Label > m_xFtShadowColor
Definition: border.hxx:149
bool mbBLTREnabled
true = Bottom-left to top-right border enabled.
Definition: border.hxx:110
std::unique_ptr< weld::Container > m_xPropertiesFrame
properties - "Merge with next paragraph" in Writer
Definition: border.hxx:152
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: border.hxx:141
std::unique_ptr< weld::MetricSpinButton > m_xRightMF
Definition: border.hxx:137
std::vector< Image > m_aBorderImgVec
Definition: border.hxx:100
void FillShadowVS()
Definition: border.cxx:1269
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: border.cxx:833
weld::MetricSpinButton & mrLeftWrp
Definition: border.hxx:71
std::set< SvxBorderLineStyle > maUsedBorderStyles
Definition: border.hxx:120
SwBorderModes nSWMode
table, textframe, paragraph
Definition: border.hxx:103
weld::MetricSpinButton & mrBottomWrp
Definition: border.hxx:74
std::unique_ptr< weld::MetricSpinButton > m_xEdShadowSize
Definition: border.hxx:148
std::unique_ptr< weld::CheckButton > m_xRemoveAdjcentCellBordersCB
Definition: border.hxx:156
std::unique_ptr< weld::Label > m_xBottomFT
Definition: border.hxx:140
bool IsBorderLineStyleAllowed(SvxBorderLineStyle nStyle) const
Definition: border.cxx:564
std::unique_ptr< ColorListBox > m_xLbShadowColor
Definition: border.hxx:150
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: border.hxx:139
bool mbVerEnabled
true = Inner vertical border enabled.
Definition: border.hxx:108
bool mbTopModified
Definition: border.hxx:114
weld::MetricSpinButton & mrTopWrp
Definition: border.hxx:73
void FillValueSets()
Definition: border.cxx:1294
FrameBorderType
const char * GetPresetStringId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1216
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: border.cxx:841
void SetControlValue(const SvxMarginItem &rItem)
Definition: border.cxx:209
DECL_LINK(SelStyleHdl_Impl, SvtLineListBox &, void)
std::unique_ptr< weld::Label > m_xRightFT
Definition: border.hxx:136
std::unique_ptr< weld::Label > m_xLeftFT
Definition: border.hxx:134
SvxShadowItem GetControlValue(const SvxShadowItem &rItem) const
Definition: border.cxx:97
bool mbRightModified
Definition: border.hxx:113
std::unique_ptr< weld::MetricSpinButton > m_xLeftMF
Definition: border.hxx:135
long nMinValue
minimum distance
Definition: border.hxx:102
SvxMarginItem GetControlValue(const SvxMarginItem &rItem) const
Definition: border.cxx:187
std::unique_ptr< weld::Label > m_xFtShadowSize
Definition: border.hxx:147
MarginControlsWrapper(weld::MetricSpinButton &rMfLeft, weld::MetricSpinButton &rMfRight, weld::MetricSpinButton &rMfTop, weld::MetricSpinButton &rMfBottom)
Definition: border.cxx:178
svx::FrameSelector m_aFrameSel
Definition: border.hxx:123
std::unique_ptr< weld::CustomWeld > m_xWndPresetsWin
Definition: border.hxx:125
void SetTableMode()
Definition: border.cxx:1515
std::unique_ptr< SvtValueSet > m_xWndPresets
Definition: border.hxx:124
std::unique_ptr< SvtLineListBox > m_xLbLineStyle
Definition: border.hxx:129
bool mbTLBREnabled
true = Top-left to bottom-right border enabled.
Definition: border.hxx:109
ColorListBox & mrLbColor
Definition: border.hxx:55
std::unique_ptr< weld::Label > m_xUserDefFT
Definition: border.hxx:126
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthMF
Definition: border.hxx:131
void HideShadowControls()
Definition: border.cxx:1046
void SetControlValue(const SvxShadowItem &rItem)
Definition: border.cxx:134
DeactivateRC
SwBorderModes
void FillLineListBox_Impl()
Definition: border.cxx:1306
void FillPresetVS()
Definition: border.cxx:1249
std::unique_ptr< MarginControlsWrapper > m_xMarginControls
Definition: border.hxx:159
std::unique_ptr< weld::CheckButton > m_xMergeAdjacentBordersCB
Definition: border.hxx:155
ShadowControlsWrapper(SvtValueSet &rVsPos, weld::MetricSpinButton &rMfSize, ColorListBox &rLbColor)
Definition: border.cxx:90
void UpdateRemoveAdjCellBorderCB(sal_uInt16 nPreset)
Definition: border.cxx:1441
weld::MetricSpinButton & mrMfSize
Definition: border.hxx:54
static const sal_uInt16 * GetRanges()
Definition: border.hxx:86
void SetControlDontKnow()
Definition: border.cxx:221