Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / svx / source / sidebar / paragraph / ParaLineSpacingControl.hxx
blobe49556f16c59a01439f2f32588af9353c7ccb300
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #pragma once
21 #include <svtools/toolbarmenu.hxx>
23 class SvxLineSpacingItem;
25 namespace svx
27 class SvxLineSpacingToolBoxControl;
29 class ParaLineSpacingControl : public WeldToolbarPopup
31 public:
32 explicit ParaLineSpacingControl(SvxLineSpacingToolBoxControl* pControl, weld::Widget* pParent);
33 virtual ~ParaLineSpacingControl() override;
35 /// Setup the widgets with values from the document.
36 void Initialize();
38 virtual void GrabFocus() override;
40 private:
41 rtl::Reference<SvxLineSpacingToolBoxControl> mxControl;
43 MapUnit meLNSpaceUnit;
45 std::unique_ptr<weld::Button> mxSpacing1Button;
46 std::unique_ptr<weld::Button> mxSpacing115Button;
47 std::unique_ptr<weld::Button> mxSpacing15Button;
48 std::unique_ptr<weld::Button> mxSpacing2Button;
50 std::unique_ptr<weld::ComboBox> mxLineDist;
52 std::unique_ptr<weld::Label> mxLineDistLabel;
53 std::unique_ptr<weld::MetricSpinButton> mxLineDistAtPercentBox;
54 std::unique_ptr<weld::MetricSpinButton> mxLineDistAtMetricBox;
55 weld::MetricSpinButton* mpActLineDistFld;
57 private:
58 /// Take the values from the widgets, and update the paragraph accordingly.
59 void ExecuteLineSpace();
61 /// Set one particular value.
62 static void SetLineSpace(SvxLineSpacingItem& rLineSpace, sal_Int32 eSpace,
63 tools::Long lValue = 0);
65 /// For the buttons - set the values, and close the popup.
66 void ExecuteLineSpacing(sal_Int32 aEntry);
68 /// Set mpActlineDistFld and visibility of mpLineDist* fields according to what is just selected.
69 void UpdateMetricFields();
71 /// Set the entry and update the metric fields.
72 void SelectEntryPos(sal_Int32 nPos);
74 DECL_LINK(LineSPDistHdl_Impl, weld::ComboBox&, void);
75 DECL_LINK(LineSPDistAtHdl_Impl, weld::MetricSpinButton&, void);
76 DECL_LINK(PredefinedValuesHandler, weld::Button&, void);
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */