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 #pragma once
20 
21 #include <editeng/shaditem.hxx>
22 #include <svtools/ctrlbox.hxx>
23 #include <vcl/weld.hxx>
24 #include <svtools/valueset.hxx>
25 #include <sfx2/tabdlg.hxx>
26 #include <svx/algitem.hxx>
27 #include <svx/colorbox.hxx>
28 #include <svx/frmsel.hxx>
29 #include <svx/flagsdef.hxx>
30 
31 #include <set>
32 
33 // forward ---------------------------------------------------------------
34 
35 namespace editeng
36 {
37  class SvxBorderLine;
38 }
39 
41 {
42 public:
43  explicit ShadowControlsWrapper(ValueSet& rVsPos, weld::MetricSpinButton& rMfSize, ColorListBox& rLbColor);
44 
45  SvxShadowItem GetControlValue(const SvxShadowItem& rItem) const;
46  void SetControlValue(const SvxShadowItem& rItem);
47  void SetControlDontKnow();
48 
49  bool get_value_changed_from_saved() const;
50 
51 private:
55 };
56 
58 {
59 public:
62 
63  SvxMarginItem GetControlValue(const SvxMarginItem& rItem) const;
64  void SetControlValue(const SvxMarginItem& rItem);
65  void SetControlDontKnow();
66 
67  bool get_value_changed_from_saved() const;
68 
69 private:
74 };
75 
77 {
78  static const sal_uInt16 pRanges[];
79 
80 public:
81  SvxBorderTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
82  virtual ~SvxBorderTabPage() override;
83  static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
84  const SfxItemSet* rAttrSet);
85  static const sal_uInt16* GetRanges() { return pRanges; }
86 
87  virtual bool FillItemSet( SfxItemSet* rCoreAttrs ) override;
88  virtual void Reset( const SfxItemSet* ) override;
89  virtual void ChangesApplied() override;
90 
91  void HideShadowControls();
92  virtual void PageCreated(const SfxAllItemSet& aSet) override;
93  void SetTableMode();
94 protected:
95  virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
96 
97 private:
98  std::vector<Image> m_aShadowImgVec;
99  std::vector<Image> m_aBorderImgVec;
100 
103  sal_uInt16 mnBoxSlot;
104  sal_uInt16 mnShadowSlot;
105 
115  bool mbSync;
118 
119  std::set<SvxBorderLineStyle> maUsedBorderStyles;
120 
121  // Controls
123  std::unique_ptr<ValueSet> m_xWndPresets;
124  std::unique_ptr<weld::CustomWeld> m_xWndPresetsWin;
125  std::unique_ptr<weld::Label> m_xUserDefFT;
126  std::unique_ptr<weld::CustomWeld> m_xFrameSelWin;
127 
128  std::unique_ptr<SvtLineListBox> m_xLbLineStyle;
129  std::unique_ptr<ColorListBox> m_xLbLineColor;
130  std::unique_ptr<weld::MetricSpinButton> m_xLineWidthMF;
131 
132  std::unique_ptr<weld::Container> m_xSpacingFrame;
133  std::unique_ptr<weld::Label> m_xLeftFT;
134  std::unique_ptr<weld::MetricSpinButton> m_xLeftMF;
135  std::unique_ptr<weld::Label> m_xRightFT;
136  std::unique_ptr<weld::MetricSpinButton> m_xRightMF;
137  std::unique_ptr<weld::Label> m_xTopFT;
138  std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
139  std::unique_ptr<weld::Label> m_xBottomFT;
140  std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
141  std::unique_ptr<weld::CheckButton> m_xSynchronizeCB;
142 
143  std::unique_ptr<weld::Container> m_xShadowFrame;
144  std::unique_ptr<ValueSet> m_xWndShadows;
145  std::unique_ptr<weld::CustomWeld> m_xWndShadowsWin;
146  std::unique_ptr<weld::Label> m_xFtShadowSize;
147  std::unique_ptr<weld::MetricSpinButton> m_xEdShadowSize;
148  std::unique_ptr<weld::Label> m_xFtShadowColor;
149  std::unique_ptr<ColorListBox> m_xLbShadowColor;
150 
151  std::unique_ptr<weld::Container> m_xPropertiesFrame;
152  std::unique_ptr<weld::CheckButton> m_xMergeWithNextCB;
153  // #i29550#
154  std::unique_ptr<weld::CheckButton> m_xMergeAdjacentBordersCB;
155  std::unique_ptr<weld::CheckButton> m_xRemoveAdjacentCellBordersCB;
156  std::unique_ptr<weld::Label> m_xRemoveAdjacentCellBordersFT;
157  std::unique_ptr<ShadowControlsWrapper> m_xShadowControls;
158  std::unique_ptr<MarginControlsWrapper> m_xMarginControls;
159 
160  // Handler
161  DECL_LINK(SelStyleHdl_Impl, SvtLineListBox&, void);
162  DECL_LINK(SelColHdl_Impl, ColorListBox&, void);
163  DECL_LINK(SelPreHdl_Impl, ValueSet*, void);
164  DECL_LINK(SelSdwHdl_Impl, ValueSet*, void);
165  DECL_LINK(LinesChanged_Impl, LinkParamNone*, void);
166  DECL_LINK(ModifyDistanceHdl_Impl, weld::MetricSpinButton&, void);
167  DECL_LINK(ModifyWidthHdl_Impl, weld::MetricSpinButton&, void);
168  DECL_LINK(SyncHdl_Impl, weld::ToggleButton&, void);
169  DECL_LINK(RemoveAdjacentCellBorderHdl_Impl, weld::ToggleButton&, void);
170 
171  sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const;
172  const char* GetPresetStringId(sal_uInt16 nValueSetIdx) const;
173 
174  void FillPresetVS();
175  void FillShadowVS();
176  void FillValueSets();
177 
178  // Filler
179  void FillLineListBox_Impl();
180 
183  const editeng::SvxBorderLine* pCurLine,
184  bool bValid );
185 
186  bool IsBorderLineStyleAllowed( SvxBorderLineStyle nStyle ) const;
187  void UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset );
188 };
189 
190 
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 mnShadowSlot
Definition: border.hxx:104
virtual ~SvxBorderTabPage() override
Definition: border.cxx:576
bool mbHorEnabled
true = Inner horizontal border enabled.
Definition: border.hxx:106
std::unique_ptr< ValueSet > m_xWndShadows
Definition: border.hxx:144
std::unique_ptr< ShadowControlsWrapper > m_xShadowControls
Definition: border.hxx:157
bool mbUseMarginItem
Definition: border.hxx:110
static const sal_uInt16 pRanges[]
Definition: border.hxx:78
bool get_value_changed_from_saved() const
Definition: border.cxx:242
std::unique_ptr< weld::CheckButton > m_xMergeWithNextCB
Definition: border.hxx:152
bool mbLeftModified
Definition: border.hxx:111
weld::MetricSpinButton & mrRightWrp
Definition: border.hxx:71
const SfxItemSet * pSet
tools::Long nMinValue
minimum distance
Definition: border.hxx:101
bool mbRemoveAdjacentCellBorders
Definition: border.hxx:116
long Long
std::unique_ptr< weld::Label > m_xTopFT
Definition: border.hxx:137
virtual void ChangesApplied() override
Definition: border.cxx:864
sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1266
ValueSet & mrVsPos
Definition: border.hxx:52
std::unique_ptr< weld::Container > m_xSpacingFrame
Definition: border.hxx:132
virtual void Reset(const SfxItemSet *) override
Definition: border.cxx:614
bool mbBottomModified
Definition: border.hxx:114
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: border.cxx:588
std::unique_ptr< ColorListBox > m_xLbLineColor
Definition: border.hxx:129
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: border.cxx:1575
SvxBorderTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
Definition: border.cxx:271
sal_uInt16 mnBoxSlot
Definition: border.hxx:103
std::vector< Image > m_aShadowImgVec
Definition: border.hxx:98
void ResetFrameLine_Impl(svx::FrameBorderType eBorder, const editeng::SvxBorderLine *pCurLine, bool bValid)
share for individual Frame-/Core-Line
Definition: border.cxx:594
std::unique_ptr< weld::Container > m_xShadowFrame
Definition: border.hxx:143
std::unique_ptr< weld::Label > m_xRemoveAdjacentCellBordersFT
Definition: border.hxx:156
std::unique_ptr< weld::CheckButton > m_xSynchronizeCB
Definition: border.hxx:141
std::unique_ptr< weld::CustomWeld > m_xWndShadowsWin
Definition: border.hxx:145
void SetControlDontKnow()
Definition: border.cxx:212
SvxBorderLineStyle
std::unique_ptr< weld::CustomWeld > m_xFrameSelWin
Definition: border.hxx:126
bool get_value_changed_from_saved() const
Definition: border.cxx:205
std::unique_ptr< weld::Label > m_xFtShadowColor
Definition: border.hxx:148
bool mbBLTREnabled
true = Bottom-left to top-right border enabled.
Definition: border.hxx:109
std::unique_ptr< weld::Container > m_xPropertiesFrame
properties - "Merge with next paragraph" in Writer
Definition: border.hxx:151
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: border.hxx:140
std::unique_ptr< weld::MetricSpinButton > m_xRightMF
Definition: border.hxx:136
std::vector< Image > m_aBorderImgVec
Definition: border.hxx:99
void FillShadowVS()
Definition: border.cxx:1352
std::unique_ptr< weld::CheckButton > m_xRemoveAdjacentCellBordersCB
Definition: border.hxx:155
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: border.cxx:874
weld::MetricSpinButton & mrLeftWrp
Definition: border.hxx:70
std::set< SvxBorderLineStyle > maUsedBorderStyles
Definition: border.hxx:119
SwBorderModes nSWMode
table, textframe, paragraph
Definition: border.hxx:102
weld::MetricSpinButton & mrBottomWrp
Definition: border.hxx:73
std::unique_ptr< weld::MetricSpinButton > m_xEdShadowSize
Definition: border.hxx:147
std::unique_ptr< weld::Label > m_xBottomFT
Definition: border.hxx:139
bool IsBorderLineStyleAllowed(SvxBorderLineStyle nStyle) const
Definition: border.cxx:605
std::unique_ptr< ColorListBox > m_xLbShadowColor
Definition: border.hxx:149
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: border.hxx:138
bool mbVerEnabled
true = Inner vertical border enabled.
Definition: border.hxx:107
bool mbTopModified
Definition: border.hxx:113
weld::MetricSpinButton & mrTopWrp
Definition: border.hxx:72
void FillValueSets()
Definition: border.cxx:1377
FrameBorderType
const char * GetPresetStringId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1299
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: border.cxx:882
void SetControlValue(const SvxMarginItem &rItem)
Definition: border.cxx:250
DECL_LINK(SelStyleHdl_Impl, SvtLineListBox &, void)
std::unique_ptr< weld::Label > m_xRightFT
Definition: border.hxx:135
std::unique_ptr< weld::Label > m_xLeftFT
Definition: border.hxx:133
SvxShadowItem GetControlValue(const SvxShadowItem &rItem) const
Definition: border.cxx:138
bool mbRightModified
Definition: border.hxx:112
std::unique_ptr< weld::MetricSpinButton > m_xLeftMF
Definition: border.hxx:134
SvxMarginItem GetControlValue(const SvxMarginItem &rItem) const
Definition: border.cxx:228
std::unique_ptr< weld::Label > m_xFtShadowSize
Definition: border.hxx:146
MarginControlsWrapper(weld::MetricSpinButton &rMfLeft, weld::MetricSpinButton &rMfRight, weld::MetricSpinButton &rMfTop, weld::MetricSpinButton &rMfBottom)
Definition: border.cxx:219
svx::FrameSelector m_aFrameSel
Definition: border.hxx:122
std::unique_ptr< weld::CustomWeld > m_xWndPresetsWin
Definition: border.hxx:124
void SetTableMode()
Definition: border.cxx:1601
std::unique_ptr< ValueSet > m_xWndPresets
Definition: border.hxx:123
std::unique_ptr< SvtLineListBox > m_xLbLineStyle
Definition: border.hxx:128
ShadowControlsWrapper(ValueSet &rVsPos, weld::MetricSpinButton &rMfSize, ColorListBox &rLbColor)
Definition: border.cxx:131
bool mbTLBREnabled
true = Top-left to bottom-right border enabled.
Definition: border.hxx:108
ColorListBox & mrLbColor
Definition: border.hxx:54
std::unique_ptr< weld::Label > m_xUserDefFT
Definition: border.hxx:125
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthMF
Definition: border.hxx:130
void HideShadowControls()
Definition: border.cxx:1107
void SetControlValue(const SvxShadowItem &rItem)
Definition: border.cxx:175
DeactivateRC
SwBorderModes
void FillLineListBox_Impl()
Definition: border.cxx:1389
void FillPresetVS()
Definition: border.cxx:1332
std::unique_ptr< MarginControlsWrapper > m_xMarginControls
Definition: border.hxx:158
std::unique_ptr< weld::CheckButton > m_xMergeAdjacentBordersCB
Definition: border.hxx:154
void UpdateRemoveAdjCellBorderCB(sal_uInt16 nPreset)
Definition: border.cxx:1527
weld::MetricSpinButton & mrMfSize
Definition: border.hxx:53
static const sal_uInt16 * GetRanges()
Definition: border.hxx:85
void SetControlDontKnow()
Definition: border.cxx:262