1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
25 #include <editeng/numdef.hxx>
26 #include <editeng/svxenum.hxx>
27 #include <vcl/weld.hxx>
29 #include <cui/numberingpreview.hxx>
31 #define MN_GALLERY_ENTRY 100
36 class SvxBmpNumValueSet
;
45 /// Main class for handling the bullets, numbering format and their position.
46 class SvxBulletAndPositionDlg
: public weld::GenericDialogController
48 OUString m_sNumCharFmtName
;
50 Timer aInvalidateTimer
;
52 std::unique_ptr
<SvxNumRule
> pActNum
;
53 std::unique_ptr
<SvxNumRule
> pSaveNum
;
54 const SfxItemSet
& rFirstStateSet
;
56 Size aInitSize
[SVX_MAX_NUM
];
58 bool bLastWidthModified
: 1;
60 bool bInInitControl
: 1; // workaround for Modify-error, is said to be corrected from 391 on
61 bool bLabelAlignmentPosAndSpaceModeActive
;
64 std::vector
<OUString
> aGrfNames
;
65 vcl::Font aActBulletFont
;
68 sal_uInt16 nActNumLvl
;
69 weld::Window
* p_Window
;
70 TypedWhichId
<SvxNumBulletItem
> nNumItemId
;
73 SvxNumberingPreview m_aPreviewWIN
;
74 std::unique_ptr
<weld::Widget
> m_xGrid
;
75 std::unique_ptr
<weld::TreeView
> m_xLevelLB
;
76 std::unique_ptr
<weld::ComboBox
> m_xFmtLB
;
77 std::unique_ptr
<weld::Label
> m_xPrefixFT
;
78 std::unique_ptr
<weld::Entry
> m_xPrefixED
;
79 std::unique_ptr
<weld::Label
> m_xSuffixFT
;
80 std::unique_ptr
<weld::Entry
> m_xSuffixED
;
81 std::unique_ptr
<weld::Frame
> m_xBeforeAfter
;
82 std::unique_ptr
<weld::Label
> m_xBulColorFT
;
83 std::unique_ptr
<ColorListBox
> m_xBulColLB
;
84 std::unique_ptr
<weld::Label
> m_xBulRelSizeFT
;
85 std::unique_ptr
<weld::MetricSpinButton
> m_xBulRelSizeMF
;
86 std::unique_ptr
<weld::Label
> m_xStartFT
;
87 std::unique_ptr
<weld::SpinButton
> m_xStartED
;
88 std::unique_ptr
<weld::Label
> m_xBulletFT
;
89 std::unique_ptr
<weld::Button
> m_xBulletPB
;
90 std::unique_ptr
<weld::MenuButton
> m_xBitmapMB
;
91 std::unique_ptr
<weld::Label
> m_xWidthFT
;
92 std::unique_ptr
<weld::MetricSpinButton
> m_xWidthMF
;
93 std::unique_ptr
<weld::Label
> m_xHeightFT
;
94 std::unique_ptr
<weld::MetricSpinButton
> m_xHeightMF
;
95 std::unique_ptr
<weld::CheckButton
> m_xRatioCB
;
96 std::unique_ptr
<weld::Menu
> m_xGalleryMenu
;
97 std::unique_ptr
<weld::CustomWeld
> m_xPreviewWIN
;
98 std::unique_ptr
<weld::Label
> m_xDistBorderFT
;
99 std::unique_ptr
<weld::MetricSpinButton
> m_xDistBorderMF
;
100 std::unique_ptr
<weld::CheckButton
> m_xRelativeCB
;
101 std::unique_ptr
<weld::MetricSpinButton
> m_xIndentMF
;
102 std::unique_ptr
<weld::Toggleable
> m_xLeftTB
;
103 std::unique_ptr
<weld::Toggleable
> m_xCenterTB
;
104 std::unique_ptr
<weld::Toggleable
> m_xRightTB
;
105 std::unique_ptr
<weld::RadioButton
> m_xSlideRB
;
106 std::unique_ptr
<weld::RadioButton
> m_xSelectionRB
;
107 std::unique_ptr
<weld::Toggleable
> m_xApplyToMaster
;
108 std::unique_ptr
<weld::Button
> m_xReset
;
111 /** To switch between the numbering type
115 void SwitchNumberType(sal_uInt8 nType
);
116 void CheckForStartValue_Impl(sal_uInt16 nNumberingType
);
118 DECL_LINK(NumberTypeSelectHdl_Impl
, weld::ComboBox
&, void);
119 DECL_LINK(LevelHdl_Impl
, weld::TreeView
&, void);
120 DECL_LINK(PopupActivateHdl_Impl
, weld::Toggleable
&, void);
121 DECL_LINK(GraphicHdl_Impl
, const OUString
&, void);
122 DECL_LINK(BulletHdl_Impl
, weld::Button
&, void);
123 DECL_LINK(SizeHdl_Impl
, weld::MetricSpinButton
&, void);
124 DECL_LINK(RatioHdl_Impl
, weld::Toggleable
&, void);
125 DECL_LINK(EditModifyHdl_Impl
, weld::Entry
&, void);
126 DECL_LINK(SpinModifyHdl_Impl
, weld::SpinButton
&, void);
127 DECL_LINK(BulColorHdl_Impl
, ColorListBox
&, void);
128 DECL_LINK(BulRelSizeHdl_Impl
, weld::MetricSpinButton
&, void);
129 DECL_LINK(PreviewInvalidateHdl_Impl
, Timer
*, void);
130 DECL_LINK(DistanceHdl_Impl
, weld::MetricSpinButton
&, void);
131 DECL_LINK(RelativeHdl_Impl
, weld::Toggleable
&, void);
132 DECL_LINK(SelectLeftAlignmentHdl_Impl
, weld::Toggleable
&, void);
133 DECL_LINK(SelectCenterAlignmentHdl_Impl
, weld::Toggleable
&, void);
134 DECL_LINK(SelectRightAlignmentHdl_Impl
, weld::Toggleable
&, void);
135 DECL_LINK(ApplyToMasterHdl_Impl
, weld::Toggleable
&, void);
136 DECL_LINK(ResetHdl_Impl
, weld::Button
&, void);
137 void EditModifyHdl_Impl(const weld::Entry
*);
138 void InitPosAndSpaceMode();
139 void SetAlignmentHdl_Impl(SvxAdjust
);
142 SvxBulletAndPositionDlg(weld::Window
* pWindow
, const SfxItemSet
& rSet
, const ::sd::View
* pView
);
143 virtual ~SvxBulletAndPositionDlg() override
;
145 SfxItemSet
* GetOutputItemSet(SfxItemSet
* rSet
);
146 bool IsApplyToMaster() const;
147 bool IsSlideScope() const;
148 void Reset(const SfxItemSet
* rSet
);
150 void SetCharFmt(const OUString
& rNumName
) { m_sNumCharFmtName
= rNumName
; }
151 void SetMetric(FieldUnit eSet
);
153 void SetModified(bool bRepaint
= true);
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */