LibreOffice Module svx (master)  1
ParaLineSpacingControl.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 <svtools/toolbarmenu.hxx>
22 
23 class SvxLineSpacingItem;
24 
25 namespace svx
26 {
27 class SvxLineSpacingToolBoxControl;
28 
30 {
31 public:
33  virtual ~ParaLineSpacingControl() override;
34 
36  void Initialize();
37 
38  virtual void GrabFocus() override;
39 
40 private:
42 
44 
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;
49 
50  std::unique_ptr<weld::ComboBox> mxLineDist;
51 
52  std::unique_ptr<weld::Label> mxLineDistLabel;
53  std::unique_ptr<weld::MetricSpinButton> mxLineDistAtPercentBox;
54  std::unique_ptr<weld::MetricSpinButton> mxLineDistAtMetricBox;
56 
57 private:
59  void ExecuteLineSpace();
60 
62  static void SetLineSpace(SvxLineSpacingItem& rLineSpace, sal_Int32 eSpace,
63  tools::Long lValue = 0);
64 
66  void ExecuteLineSpacing(sal_Int32 aEntry);
67 
69  void UpdateMetricFields();
70 
72  void SelectEntryPos(sal_Int32 nPos);
73 
74  DECL_LINK(LineSPDistHdl_Impl, weld::ComboBox&, void);
75  DECL_LINK(LineSPDistAtHdl_Impl, weld::MetricSpinButton&, void);
76  DECL_LINK(PredefinedValuesHandler, weld::Button&, void);
77 };
78 }
79 
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::MetricSpinButton > mxLineDistAtMetricBox
ParaLineSpacingControl(SvxLineSpacingToolBoxControl *pControl, weld::Widget *pParent)
void ExecuteLineSpacing(sal_Int32 aEntry)
For the buttons - set the values, and close the popup.
std::unique_ptr< weld::Button > mxSpacing115Button
long Long
std::unique_ptr< weld::MetricSpinButton > mxLineDistAtPercentBox
static void SetLineSpace(SvxLineSpacingItem &rLineSpace, sal_Int32 eSpace, tools::Long lValue=0)
Set one particular value.
void ExecuteLineSpace()
Take the values from the widgets, and update the paragraph accordingly.
DECL_LINK(LineSPDistHdl_Impl, weld::ComboBox &, void)
std::unique_ptr< weld::Button > mxSpacing2Button
void UpdateMetricFields()
Set mpActlineDistFld and visibility of mpLineDist* fields according to what is just selected...
void Initialize()
Setup the widgets with values from the document.
std::unique_ptr< weld::Button > mxSpacing1Button
rtl::Reference< SvxLineSpacingToolBoxControl > mxControl
std::unique_ptr< weld::Button > mxSpacing15Button
std::unique_ptr< weld::ComboBox > mxLineDist
virtual void GrabFocus() override
MapUnit
weld::MetricSpinButton * mpActLineDistFld
void SelectEntryPos(sal_Int32 nPos)
Set the entry and update the metric fields.
std::unique_ptr< weld::Label > mxLineDistLabel