xref: /AOO41X/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx (revision 3ce09a58b0d6873449cda31e55c66dba2dbc8f7f)
1*766ce4d0SZheng Fan /**************************************************************
2*766ce4d0SZheng Fan  *
3*766ce4d0SZheng Fan  * Licensed to the Apache Software Foundation (ASF) under one
4*766ce4d0SZheng Fan  * or more contributor license agreements.  See the NOTICE file
5*766ce4d0SZheng Fan  * distributed with this work for additional information
6*766ce4d0SZheng Fan  * regarding copyright ownership.  The ASF licenses this file
7*766ce4d0SZheng Fan  * to you under the Apache License, Version 2.0 (the
8*766ce4d0SZheng Fan  * "License"); you may not use this file except in compliance
9*766ce4d0SZheng Fan  * with the License.  You may obtain a copy of the License at
10*766ce4d0SZheng Fan  *
11*766ce4d0SZheng Fan  *   http://www.apache.org/licenses/LICENSE-2.0
12*766ce4d0SZheng Fan  *
13*766ce4d0SZheng Fan  * Unless required by applicable law or agreed to in writing,
14*766ce4d0SZheng Fan  * software distributed under the License is distributed on an
15*766ce4d0SZheng Fan  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*766ce4d0SZheng Fan  * KIND, either express or implied.  See the License for the
17*766ce4d0SZheng Fan  * specific language governing permissions and limitations
18*766ce4d0SZheng Fan  * under the License.
19*766ce4d0SZheng Fan  *
20*766ce4d0SZheng Fan  *************************************************************/
21*766ce4d0SZheng Fan #ifndef _SVX_SIDEBAR_LINE_SPACING_CONTROL_HXX_
22*766ce4d0SZheng Fan #define _SVX_SIDEBAR_LINE_SPACING_CONTROL_HXX_
23*766ce4d0SZheng Fan 
24*766ce4d0SZheng Fan #include "svx/sidebar/PopupControl.hxx"
25*766ce4d0SZheng Fan #include "svx/sidebar/ValueSetWithTextControl.hxx"
26*766ce4d0SZheng Fan #include <sfx2/bindings.hxx>
27*766ce4d0SZheng Fan #include <svtools/ctrlbox.hxx>
28*766ce4d0SZheng Fan #include <svtools/ctrltool.hxx>
29*766ce4d0SZheng Fan #include "ParaPropertyPanel.hxx"
30*766ce4d0SZheng Fan #include <vcl/fixed.hxx>
31*766ce4d0SZheng Fan #include <svl/poolitem.hxx>
32*766ce4d0SZheng Fan #include <editeng/lspcitem.hxx>
33*766ce4d0SZheng Fan #include <sfx2/sidebar/EnumContext.hxx>
34*766ce4d0SZheng Fan 
35*766ce4d0SZheng Fan 
36*766ce4d0SZheng Fan namespace svx { namespace sidebar {
37*766ce4d0SZheng Fan 
38*766ce4d0SZheng Fan #define LSP_POS_GLOBAL_VALUE	String("Line_Spacing_Pos", 16, RTL_TEXTENCODING_ASCII_US)
39*766ce4d0SZheng Fan #define LSP_LV_GLOBAL_VALUE	    String("Line_Spacing_Lv", 15, RTL_TEXTENCODING_ASCII_US)
40*766ce4d0SZheng Fan #define BEGIN_VALUE            28
41*766ce4d0SZheng Fan class ParaLineSpacingControl:public svx::sidebar::PopupControl
42*766ce4d0SZheng Fan {
43*766ce4d0SZheng Fan public:
44*766ce4d0SZheng Fan 	ParaLineSpacingControl(Window* pParent, svx::sidebar::ParaPropertyPanel& rPanel);
45*766ce4d0SZheng Fan 	~ParaLineSpacingControl();
46*766ce4d0SZheng Fan 	void Rearrange(SfxItemState currSPState,FieldUnit currMetricUnit,SvxLineSpacingItem* currSPItem,const ::sfx2::sidebar::EnumContext currentContext);
47*766ce4d0SZheng Fan 	//virtual void Paint(const Rectangle& rect);
48*766ce4d0SZheng Fan 
49*766ce4d0SZheng Fan 	//add
50*766ce4d0SZheng Fan 	short GetLastCustomState();
51*766ce4d0SZheng Fan 	long  GetLastCustomValue();
52*766ce4d0SZheng Fan 	//add end
53*766ce4d0SZheng Fan 
54*766ce4d0SZheng Fan 	void ExecuteLineSpace();
55*766ce4d0SZheng Fan 	void SetLineSpace( SvxLineSpacingItem& rLineSpace,
56*766ce4d0SZheng Fan 						int eSpace, long lValue = 0 );
57*766ce4d0SZheng Fan 
58*766ce4d0SZheng Fan 	void ExecuteLineSpacing( sal_uInt16 aIsCustom, sal_uInt16 aEntry );
59*766ce4d0SZheng Fan 	void SetAllNoSel();
60*766ce4d0SZheng Fan 	void PopupModeEndCallback();
61*766ce4d0SZheng Fan 
62*766ce4d0SZheng Fan private:
63*766ce4d0SZheng Fan 	bool					mbUseLineSPCustom;
64*766ce4d0SZheng Fan 	bool					mbLineSPDisable;
65*766ce4d0SZheng Fan 	SfxMapUnit                      m_eLNSpaceUnit;
66*766ce4d0SZheng Fan 	ParaPropertyPanel&     mrParaPropertyPanel;
67*766ce4d0SZheng Fan 	SfxBindings*		mpBindings;
68*766ce4d0SZheng Fan 
69*766ce4d0SZheng Fan 	long 							nMinFixDist;
70*766ce4d0SZheng Fan 	Edit*							pActLineDistFld;
71*766ce4d0SZheng Fan 
72*766ce4d0SZheng Fan 	ValueSetWithTextControl	maLineSpacing;
73*766ce4d0SZheng Fan 
74*766ce4d0SZheng Fan 	FixedText maCustomFT;
75*766ce4d0SZheng Fan 	FixedText maLSpacingFT;
76*766ce4d0SZheng Fan 	ListBox					        aLineDist;
77*766ce4d0SZheng Fan 
78*766ce4d0SZheng Fan 	FixedText maOfFT;
79*766ce4d0SZheng Fan 	MetricField			        	aLineDistAtPercentBox;
80*766ce4d0SZheng Fan 	MetricField	        			aLineDistAtMetricBox;
81*766ce4d0SZheng Fan 
82*766ce4d0SZheng Fan 	Image  maSpacing1;
83*766ce4d0SZheng Fan 	Image  maSpacing115;
84*766ce4d0SZheng Fan 	Image  maSpacing15;
85*766ce4d0SZheng Fan 	Image  maSpacing2;
86*766ce4d0SZheng Fan 
87*766ce4d0SZheng Fan 	Image  maSelSpacing1;
88*766ce4d0SZheng Fan 	Image  maSelSpacing115;
89*766ce4d0SZheng Fan 	Image  maSelSpacing15;
90*766ce4d0SZheng Fan 	Image  maSelSpacing2;
91*766ce4d0SZheng Fan 	Image  maSelSelHanging;
92*766ce4d0SZheng Fan 	Image				maImgCus;
93*766ce4d0SZheng Fan 	Image				maImgCusGrey;
94*766ce4d0SZheng Fan 	XubString			maStrCus;
95*766ce4d0SZheng Fan 
96*766ce4d0SZheng Fan 	Image*				mpImg;
97*766ce4d0SZheng Fan 	Image*				mpImgSel;
98*766ce4d0SZheng Fan 	XubString*			mpStr;
99*766ce4d0SZheng Fan 	XubString*			mpStrTip;
100*766ce4d0SZheng Fan 	String				maLine;
101*766ce4d0SZheng Fan 	String				maOf;
102*766ce4d0SZheng Fan 
103*766ce4d0SZheng Fan 	sal_Int64             maValue;
104*766ce4d0SZheng Fan 	sal_uInt16                maPos;
105*766ce4d0SZheng Fan private:
106*766ce4d0SZheng Fan 	void initial();
107*766ce4d0SZheng Fan 	DECL_LINK(LineSPDistHdl_Impl, ListBox*);
108*766ce4d0SZheng Fan 	DECL_LINK(LineSPDistAtHdl_Impl, MetricField*);
109*766ce4d0SZheng Fan 	DECL_LINK(VSSelHdl, void*);
110*766ce4d0SZheng Fan };
111*766ce4d0SZheng Fan }}
112*766ce4d0SZheng Fan 
113*766ce4d0SZheng Fan #endif
114*766ce4d0SZheng Fan 
115