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#include <unotools/resmgr.hxx>
31
32#include <set>
33
34// forward ---------------------------------------------------------------
35
36namespace editeng
37{
38 class SvxBorderLine;
39}
40
42{
43public:
44 explicit ShadowControlsWrapper(ValueSet& rVsPos, weld::MetricSpinButton& rMfSize, ColorListBox& rLbColor);
45
47 void SetControlValue(const SvxShadowItem& rItem);
48 void SetControlDontKnow();
49
51
52private:
56};
57
59{
60public:
63
65 void SetControlValue(const SvxMarginItem& rItem);
66 void SetControlDontKnow();
67
69
70private:
75};
76
78{
80 static const std::vector<int> m_aLineWidths;
81
82public:
83 SvxBorderTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs);
84 virtual ~SvxBorderTabPage() override;
85 static std::unique_ptr<SfxTabPage> Create( weld::Container* pPage, weld::DialogController* pController,
86 const SfxItemSet* rAttrSet);
88
89 virtual bool FillItemSet( SfxItemSet* rCoreAttrs ) override;
90 virtual void Reset( const SfxItemSet* ) override;
91 virtual void ChangesApplied() override;
92
93 void HideShadowControls();
94 virtual void PageCreated(const SfxAllItemSet& aSet) override;
95 void SetTableMode();
96protected:
97 virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
98
99private:
100 std::vector<Image> m_aShadowImgVec;
101 std::vector<Image> m_aBorderImgVec;
102
105 sal_uInt16 mnBoxSlot;
106 sal_uInt16 mnShadowSlot;
107
117 bool mbSync;
120
121 std::set<SvxBorderLineStyle> maUsedBorderStyles;
122
123 // Controls
125 std::unique_ptr<ValueSet> m_xWndPresets;
126 std::unique_ptr<weld::CustomWeld> m_xWndPresetsWin;
127 std::unique_ptr<weld::Label> m_xUserDefFT;
128 std::unique_ptr<weld::CustomWeld> m_xFrameSelWin;
129
130 std::unique_ptr<SvtLineListBox> m_xLbLineStyle;
131 std::unique_ptr<ColorListBox> m_xLbLineColor;
132 std::unique_ptr<weld::ComboBox> m_xLineWidthLB;
133 std::unique_ptr<weld::MetricSpinButton> m_xLineWidthMF;
134
135 std::unique_ptr<weld::Container> m_xSpacingFrame;
136 std::unique_ptr<weld::Label> m_xLeftFT;
137 std::unique_ptr<weld::MetricSpinButton> m_xLeftMF;
138 std::unique_ptr<weld::Label> m_xRightFT;
139 std::unique_ptr<weld::MetricSpinButton> m_xRightMF;
140 std::unique_ptr<weld::Label> m_xTopFT;
141 std::unique_ptr<weld::MetricSpinButton> m_xTopMF;
142 std::unique_ptr<weld::Label> m_xBottomFT;
143 std::unique_ptr<weld::MetricSpinButton> m_xBottomMF;
144 std::unique_ptr<weld::CheckButton> m_xSynchronizeCB;
145
146 std::unique_ptr<weld::Container> m_xShadowFrame;
147 std::unique_ptr<ValueSet> m_xWndShadows;
148 std::unique_ptr<weld::CustomWeld> m_xWndShadowsWin;
149 std::unique_ptr<weld::Label> m_xFtShadowSize;
150 std::unique_ptr<weld::MetricSpinButton> m_xEdShadowSize;
151 std::unique_ptr<weld::Label> m_xFtShadowColor;
152 std::unique_ptr<ColorListBox> m_xLbShadowColor;
153
154 std::unique_ptr<weld::Container> m_xPropertiesFrame;
155 std::unique_ptr<weld::CheckButton> m_xMergeWithNextCB;
156 // #i29550#
157 std::unique_ptr<weld::CheckButton> m_xMergeAdjacentBordersCB;
158 std::unique_ptr<weld::CheckButton> m_xRemoveAdjacentCellBordersCB;
159 std::unique_ptr<weld::Label> m_xRemoveAdjacentCellBordersFT;
160 std::unique_ptr<ShadowControlsWrapper> m_xShadowControls;
161 std::unique_ptr<MarginControlsWrapper> m_xMarginControls;
162
163 // Handler
164 DECL_LINK(SelStyleHdl_Impl, SvtLineListBox&, void);
165 DECL_LINK(SelColHdl_Impl, ColorListBox&, void);
166 DECL_LINK(SelPreHdl_Impl, ValueSet*, void);
167 DECL_LINK(SelSdwHdl_Impl, ValueSet*, void);
168 DECL_LINK(LinesChanged_Impl, LinkParamNone*, void);
169 DECL_LINK(ModifyDistanceHdl_Impl, weld::MetricSpinButton&, void);
170 DECL_LINK(ModifyWidthLBHdl_Impl, weld::ComboBox&, void);
171 DECL_LINK(ModifyWidthMFHdl_Impl, weld::MetricSpinButton&, void);
172 DECL_LINK(SyncHdl_Impl, weld::Toggleable&, void);
173 DECL_LINK(RemoveAdjacentCellBorderHdl_Impl, weld::Toggleable&, void);
174
175 sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const;
176 TranslateId GetPresetStringId(sal_uInt16 nValueSetIdx) const;
177
178 void FillPresetVS();
179 void FillShadowVS();
180 void FillValueSets();
181 void SetLineWidth(sal_Int64 nWidth, sal_Int32 nRemovedType = 0);
182
183 // Filler
185
188 const editeng::SvxBorderLine* pCurLine,
189 bool bValid );
190
191 bool IsBorderLineStyleAllowed( SvxBorderLineStyle nStyle ) const;
192 void UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset );
193};
194
195
196/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvxBorderLineStyle
weld::MetricSpinButton & mrTopWrp
Definition: border.hxx:73
SvxMarginItem GetControlValue(const SvxMarginItem &rItem) const
Definition: border.cxx:244
weld::MetricSpinButton & mrBottomWrp
Definition: border.hxx:74
bool get_value_changed_from_saved() const
Definition: border.cxx:258
void SetControlDontKnow()
Definition: border.cxx:278
void SetControlValue(const SvxMarginItem &rItem)
Definition: border.cxx:266
weld::MetricSpinButton & mrLeftWrp
Definition: border.hxx:71
MarginControlsWrapper(weld::MetricSpinButton &rMfLeft, weld::MetricSpinButton &rMfRight, weld::MetricSpinButton &rMfTop, weld::MetricSpinButton &rMfBottom)
Definition: border.cxx:235
weld::MetricSpinButton & mrRightWrp
Definition: border.hxx:72
void SetControlValue(const SvxShadowItem &rItem)
Definition: border.cxx:191
void SetControlDontKnow()
Definition: border.cxx:228
ShadowControlsWrapper(ValueSet &rVsPos, weld::MetricSpinButton &rMfSize, ColorListBox &rLbColor)
Definition: border.cxx:147
weld::MetricSpinButton & mrMfSize
Definition: border.hxx:54
ValueSet & mrVsPos
Definition: border.hxx:53
ColorListBox & mrLbColor
Definition: border.hxx:55
SvxShadowItem GetControlValue(const SvxShadowItem &rItem) const
Definition: border.cxx:154
bool get_value_changed_from_saved() const
Definition: border.cxx:221
std::unique_ptr< weld::Label > m_xRemoveAdjacentCellBordersFT
Definition: border.hxx:159
sal_uInt16 GetPresetImageId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1343
std::unique_ptr< ShadowControlsWrapper > m_xShadowControls
Definition: border.hxx:160
void FillLineListBox_Impl()
Definition: border.cxx:1487
SvxBorderTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreAttrs)
Definition: border.cxx:287
bool mbTopModified
Definition: border.hxx:115
void SetTableMode()
Definition: border.cxx:1699
std::vector< Image > m_aShadowImgVec
Definition: border.hxx:100
bool mbRemoveAdjacentCellBorders
Definition: border.hxx:118
SwBorderModes nSWMode
table, textframe, paragraph
Definition: border.hxx:104
std::unique_ptr< weld::CustomWeld > m_xFrameSelWin
Definition: border.hxx:128
std::unique_ptr< weld::CustomWeld > m_xWndShadowsWin
Definition: border.hxx:148
std::unique_ptr< weld::CustomWeld > m_xWndPresetsWin
Definition: border.hxx:126
std::unique_ptr< ValueSet > m_xWndShadows
Definition: border.hxx:147
std::unique_ptr< ValueSet > m_xWndPresets
Definition: border.hxx:125
void FillPresetVS()
Definition: border.cxx:1409
std::unique_ptr< weld::Container > m_xPropertiesFrame
properties - "Merge with next paragraph" in Writer
Definition: border.hxx:154
std::vector< Image > m_aBorderImgVec
Definition: border.hxx:101
std::unique_ptr< weld::Container > m_xShadowFrame
Definition: border.hxx:146
svx::FrameSelector m_aFrameSel
Definition: border.hxx:124
tools::Long nMinValue
minimum distance
Definition: border.hxx:103
std::unique_ptr< weld::Label > m_xTopFT
Definition: border.hxx:140
std::unique_ptr< weld::ComboBox > m_xLineWidthLB
Definition: border.hxx:132
static const std::vector< int > m_aLineWidths
Definition: border.hxx:80
DECL_LINK(ModifyWidthMFHdl_Impl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::CheckButton > m_xMergeWithNextCB
Definition: border.hxx:155
void SetLineWidth(sal_Int64 nWidth, sal_Int32 nRemovedType=0)
Definition: border.cxx:1460
TranslateId GetPresetStringId(sal_uInt16 nValueSetIdx) const
Definition: border.cxx:1376
sal_uInt16 mnShadowSlot
Definition: border.hxx:106
DECL_LINK(SelSdwHdl_Impl, ValueSet *, void)
std::unique_ptr< ColorListBox > m_xLbLineColor
Definition: border.hxx:131
std::unique_ptr< MarginControlsWrapper > m_xMarginControls
Definition: border.hxx:161
bool mbRightModified
Definition: border.hxx:114
bool mbUseMarginItem
Definition: border.hxx:112
DECL_LINK(SelStyleHdl_Impl, SvtLineListBox &, void)
std::unique_ptr< weld::Label > m_xLeftFT
Definition: border.hxx:136
virtual bool FillItemSet(SfxItemSet *rCoreAttrs) override
Definition: border.cxx:904
bool mbBottomModified
Definition: border.hxx:116
std::unique_ptr< weld::MetricSpinButton > m_xEdShadowSize
Definition: border.hxx:150
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: border.cxx:1673
bool mbTLBREnabled
true = Top-left to bottom-right border enabled.
Definition: border.hxx:110
bool mbHorEnabled
true = Inner horizontal border enabled.
Definition: border.hxx:108
bool mbBLTREnabled
true = Bottom-left to top-right border enabled.
Definition: border.hxx:111
virtual ~SvxBorderTabPage() override
Definition: border.cxx:596
DECL_LINK(SelPreHdl_Impl, ValueSet *, void)
virtual void Reset(const SfxItemSet *) override
Definition: border.cxx:634
std::set< SvxBorderLineStyle > maUsedBorderStyles
Definition: border.hxx:121
sal_uInt16 mnBoxSlot
Definition: border.hxx:105
std::unique_ptr< SvtLineListBox > m_xLbLineStyle
Definition: border.hxx:130
static const WhichRangesContainer pRanges
Definition: border.hxx:79
bool IsBorderLineStyleAllowed(SvxBorderLineStyle nStyle) const
Definition: border.cxx:625
DECL_LINK(ModifyDistanceHdl_Impl, weld::MetricSpinButton &, void)
std::unique_ptr< weld::Label > m_xRightFT
Definition: border.hxx:138
std::unique_ptr< weld::Label > m_xFtShadowSize
Definition: border.hxx:149
std::unique_ptr< weld::Label > m_xFtShadowColor
Definition: border.hxx:151
void HideShadowControls()
Definition: border.cxx:1129
std::unique_ptr< weld::CheckButton > m_xMergeAdjacentBordersCB
Definition: border.hxx:157
void ResetFrameLine_Impl(svx::FrameBorderType eBorder, const editeng::SvxBorderLine *pCurLine, bool bValid)
share for individual Frame-/Core-Line
Definition: border.cxx:614
std::unique_ptr< weld::CheckButton > m_xRemoveAdjacentCellBordersCB
Definition: border.hxx:158
std::unique_ptr< weld::Label > m_xBottomFT
Definition: border.hxx:142
DECL_LINK(ModifyWidthLBHdl_Impl, weld::ComboBox &, void)
DECL_LINK(LinesChanged_Impl, LinkParamNone *, void)
std::unique_ptr< weld::MetricSpinButton > m_xLeftMF
Definition: border.hxx:137
std::unique_ptr< weld::MetricSpinButton > m_xTopMF
Definition: border.hxx:141
virtual void ChangesApplied() override
Definition: border.cxx:886
std::unique_ptr< weld::Container > m_xSpacingFrame
Definition: border.hxx:135
std::unique_ptr< weld::MetricSpinButton > m_xLineWidthMF
Definition: border.hxx:133
void UpdateRemoveAdjCellBorderCB(sal_uInt16 nPreset)
Definition: border.cxx:1625
DECL_LINK(SelColHdl_Impl, ColorListBox &, void)
bool mbLeftModified
Definition: border.hxx:113
void FillShadowVS()
Definition: border.cxx:1429
void FillValueSets()
Definition: border.cxx:1454
std::unique_ptr< ColorListBox > m_xLbShadowColor
Definition: border.hxx:152
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: border.cxx:896
std::unique_ptr< weld::MetricSpinButton > m_xBottomMF
Definition: border.hxx:143
bool mbVerEnabled
true = Inner vertical border enabled.
Definition: border.hxx:109
std::unique_ptr< weld::MetricSpinButton > m_xRightMF
Definition: border.hxx:139
std::unique_ptr< weld::Label > m_xUserDefFT
Definition: border.hxx:127
DECL_LINK(RemoveAdjacentCellBorderHdl_Impl, weld::Toggleable &, void)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: border.cxx:608
std::unique_ptr< weld::CheckButton > m_xSynchronizeCB
Definition: border.hxx:144
DECL_LINK(SyncHdl_Impl, weld::Toggleable &, void)
static WhichRangesContainer GetRanges()
Definition: border.hxx:87
SwBorderModes
FrameBorderType
long Long
DeactivateRC