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 <svx/numberingpreview.hxx>
30 #include <svx/dlgutil.hxx>
32 #define MN_GALLERY_ENTRY 100
37 class SvxBmpNumValueSet
;
46 /// Main class for handling the bullets, numbering format and their position.
47 class SvxBulletAndPositionDlg
: public weld::GenericDialogController
49 OUString m_sNumCharFmtName
;
51 Timer aInvalidateTimer
;
53 std::unique_ptr
<SvxNumRule
> pActNum
;
54 std::unique_ptr
<SvxNumRule
> pSaveNum
;
55 const SfxItemSet
& rFirstStateSet
;
57 Size aInitSize
[SVX_MAX_NUM
];
59 bool bLastWidthModified
: 1;
61 bool bInInitControl
: 1; // workaround for Modify-error, is said to be corrected from 391 on
62 bool bLabelAlignmentPosAndSpaceModeActive
;
65 std::vector
<OUString
> aGrfNames
;
66 vcl::Font aActBulletFont
;
69 sal_uInt16 nActNumLvl
;
70 weld::Window
* p_Window
;
71 TypedWhichId
<SvxNumBulletItem
> nNumItemId
;
74 SvxNumberingPreview m_aPreviewWIN
;
75 SvxRatioConnector m_aRatioTop
;
76 SvxRatioConnector m_aRatioBottom
;
77 std::unique_ptr
<weld::Widget
> m_xGrid
;
78 std::unique_ptr
<weld::TreeView
> m_xLevelLB
;
79 std::unique_ptr
<weld::ComboBox
> m_xFmtLB
;
80 std::unique_ptr
<weld::Label
> m_xPrefixFT
;
81 std::unique_ptr
<weld::Entry
> m_xPrefixED
;
82 std::unique_ptr
<weld::Label
> m_xSuffixFT
;
83 std::unique_ptr
<weld::Entry
> m_xSuffixED
;
84 std::unique_ptr
<weld::Frame
> m_xBeforeAfter
;
85 std::unique_ptr
<weld::Label
> m_xBulColorFT
;
86 std::unique_ptr
<ColorListBox
> m_xBulColLB
;
87 std::unique_ptr
<weld::Label
> m_xBulRelSizeFT
;
88 std::unique_ptr
<weld::MetricSpinButton
> m_xBulRelSizeMF
;
89 std::unique_ptr
<weld::Label
> m_xStartFT
;
90 std::unique_ptr
<weld::SpinButton
> m_xStartED
;
91 std::unique_ptr
<weld::Label
> m_xBulletFT
;
92 std::unique_ptr
<weld::Button
> m_xBulletPB
;
93 std::unique_ptr
<weld::MenuButton
> m_xBitmapMB
;
94 std::unique_ptr
<weld::Label
> m_xWidthFT
;
95 std::unique_ptr
<weld::MetricSpinButton
> m_xWidthMF
;
96 std::unique_ptr
<weld::Label
> m_xHeightFT
;
97 std::unique_ptr
<weld::MetricSpinButton
> m_xHeightMF
;
98 std::unique_ptr
<weld::CheckButton
> m_xRatioCB
;
99 std::unique_ptr
<weld::Image
> m_xCbxScaleImg
;
100 std::unique_ptr
<weld::CustomWeld
> m_xImgRatioTop
;
101 std::unique_ptr
<weld::CustomWeld
> m_xImgRatioBottom
;
102 std::unique_ptr
<weld::Menu
> m_xGalleryMenu
;
103 std::unique_ptr
<weld::CustomWeld
> m_xPreviewWIN
;
104 std::unique_ptr
<weld::Label
> m_xDistBorderFT
;
105 std::unique_ptr
<weld::MetricSpinButton
> m_xDistBorderMF
;
106 std::unique_ptr
<weld::CheckButton
> m_xRelativeCB
;
107 std::unique_ptr
<weld::MetricSpinButton
> m_xIndentMF
;
108 std::unique_ptr
<weld::Toggleable
> m_xLeftTB
;
109 std::unique_ptr
<weld::Toggleable
> m_xCenterTB
;
110 std::unique_ptr
<weld::Toggleable
> m_xRightTB
;
111 std::unique_ptr
<weld::RadioButton
> m_xSlideRB
;
112 std::unique_ptr
<weld::RadioButton
> m_xSelectionRB
;
113 std::unique_ptr
<weld::Toggleable
> m_xApplyToMaster
;
114 std::unique_ptr
<weld::Button
> m_xReset
;
117 /** To switch between the numbering type
121 void SwitchNumberType(sal_uInt8 nType
);
122 void CheckForStartValue_Impl(sal_uInt16 nNumberingType
);
124 DECL_LINK(NumberTypeSelectHdl_Impl
, weld::ComboBox
&, void);
125 DECL_LINK(LevelHdl_Impl
, weld::TreeView
&, void);
126 DECL_LINK(PopupActivateHdl_Impl
, weld::Toggleable
&, void);
127 DECL_LINK(GraphicHdl_Impl
, const OUString
&, void);
128 DECL_LINK(BulletHdl_Impl
, weld::Button
&, void);
129 DECL_LINK(SizeHdl_Impl
, weld::MetricSpinButton
&, void);
130 DECL_LINK(RatioHdl_Impl
, weld::Toggleable
&, void);
131 DECL_LINK(EditModifyHdl_Impl
, weld::Entry
&, void);
132 DECL_LINK(SpinModifyHdl_Impl
, weld::SpinButton
&, void);
133 DECL_LINK(BulColorHdl_Impl
, ColorListBox
&, void);
134 DECL_LINK(BulRelSizeHdl_Impl
, weld::MetricSpinButton
&, void);
135 DECL_LINK(PreviewInvalidateHdl_Impl
, Timer
*, void);
136 DECL_LINK(DistanceHdl_Impl
, weld::MetricSpinButton
&, void);
137 DECL_LINK(RelativeHdl_Impl
, weld::Toggleable
&, void);
138 DECL_LINK(SelectLeftAlignmentHdl_Impl
, weld::Toggleable
&, void);
139 DECL_LINK(SelectCenterAlignmentHdl_Impl
, weld::Toggleable
&, void);
140 DECL_LINK(SelectRightAlignmentHdl_Impl
, weld::Toggleable
&, void);
141 DECL_LINK(ApplyToMasterHdl_Impl
, weld::Toggleable
&, void);
142 DECL_LINK(ResetHdl_Impl
, weld::Button
&, void);
143 void EditModifyHdl_Impl(const weld::Entry
*);
144 void InitPosAndSpaceMode();
145 void SetAlignmentHdl_Impl(SvxAdjust
);
148 SvxBulletAndPositionDlg(weld::Window
* pWindow
, const SfxItemSet
& rSet
, const ::sd::View
* pView
);
149 virtual ~SvxBulletAndPositionDlg() override
;
151 SfxItemSet
* GetOutputItemSet(SfxItemSet
* rSet
);
152 bool IsApplyToMaster() const;
153 bool IsSlideScope() const;
154 void Reset(const SfxItemSet
* rSet
);
156 void SetCharFmt(const OUString
& rNumName
) { m_sNumCharFmtName
= rNumName
; }
157 void SetMetric(FieldUnit eSet
);
159 void SetModified(bool bRepaint
= true);
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */