2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef _SVX_SIDEBAR_LINE_SPACING_CONTROL_HXX_
19 #define _SVX_SIDEBAR_LINE_SPACING_CONTROL_HXX_
21 #include "svx/sidebar/PopupControl.hxx"
22 #include "svx/sidebar/ValueSetWithTextControl.hxx"
23 #include <sfx2/bindings.hxx>
24 #include <svtools/ctrlbox.hxx>
25 #include <svtools/ctrltool.hxx>
26 #include "ParaPropertyPanel.hxx"
27 #include <vcl/fixed.hxx>
28 #include <svl/poolitem.hxx>
29 #include <editeng/lspcitem.hxx>
30 #include <sfx2/sidebar/EnumContext.hxx>
33 namespace svx
{ namespace sidebar
{
35 #define LSP_POS_GLOBAL_VALUE String("Line_Spacing_Pos", 16, RTL_TEXTENCODING_ASCII_US)
36 #define LSP_LV_GLOBAL_VALUE String("Line_Spacing_Lv", 15, RTL_TEXTENCODING_ASCII_US)
37 #define BEGIN_VALUE 28
38 class ParaLineSpacingControl
:public svx::sidebar::PopupControl
41 ParaLineSpacingControl(Window
* pParent
, svx::sidebar::ParaPropertyPanel
& rPanel
);
42 ~ParaLineSpacingControl();
43 void Rearrange(SfxItemState currSPState
,FieldUnit currMetricUnit
,SvxLineSpacingItem
* currSPItem
,const ::sfx2::sidebar::EnumContext currentContext
);
44 //virtual void Paint(const Rectangle& rect);
47 short GetLastCustomState();
48 long GetLastCustomValue();
51 void ExecuteLineSpace();
52 void SetLineSpace( SvxLineSpacingItem
& rLineSpace
,
53 int eSpace
, long lValue
= 0 );
55 void ExecuteLineSpacing( sal_uInt16 aIsCustom
, sal_uInt16 aEntry
);
57 void PopupModeEndCallback();
60 bool mbUseLineSPCustom
;
62 SfxMapUnit m_eLNSpaceUnit
;
63 ParaPropertyPanel
& mrParaPropertyPanel
;
64 SfxBindings
* mpBindings
;
67 Edit
* pActLineDistFld
;
69 ValueSetWithTextControl maLineSpacing
;
72 FixedText maLSpacingFT
;
76 MetricField aLineDistAtPercentBox
;
77 MetricField aLineDistAtMetricBox
;
85 Image maSelSpacing115
;
88 Image maSelSelHanging
;
104 DECL_LINK(LineSPDistHdl_Impl
, ListBox
*);
105 DECL_LINK(LineSPDistAtHdl_Impl
, void*);
106 DECL_LINK(VSSelHdl
, void*);