1d4aefcaeSZheng Fan /**************************************************************
2d4aefcaeSZheng Fan  *
3d4aefcaeSZheng Fan  * Licensed to the Apache Software Foundation (ASF) under one
4d4aefcaeSZheng Fan  * or more contributor license agreements.  See the NOTICE file
5d4aefcaeSZheng Fan  * distributed with this work for additional information
6d4aefcaeSZheng Fan  * regarding copyright ownership.  The ASF licenses this file
7d4aefcaeSZheng Fan  * to you under the Apache License, Version 2.0 (the
8d4aefcaeSZheng Fan  * "License"); you may not use this file except in compliance
9d4aefcaeSZheng Fan  * with the License.  You may obtain a copy of the License at
10d4aefcaeSZheng Fan  *
11d4aefcaeSZheng Fan  *   http://www.apache.org/licenses/LICENSE-2.0
12d4aefcaeSZheng Fan  *
13d4aefcaeSZheng Fan  * Unless required by applicable law or agreed to in writing,
14d4aefcaeSZheng Fan  * software distributed under the License is distributed on an
15d4aefcaeSZheng Fan  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d4aefcaeSZheng Fan  * KIND, either express or implied.  See the License for the
17d4aefcaeSZheng Fan  * specific language governing permissions and limitations
18d4aefcaeSZheng Fan  * under the License.
19d4aefcaeSZheng Fan  *
20d4aefcaeSZheng Fan  *************************************************************/
21d4aefcaeSZheng Fan #ifndef _SVX_SIDEBAR_CHARACTER_SPACING_CONTROL_HXX_
22d4aefcaeSZheng Fan #define _SVX_SIDEBAR_CHARACTER_SPACING_CONTROL_HXX_
23d4aefcaeSZheng Fan 
24d4aefcaeSZheng Fan #include "svx/sidebar/PopupControl.hxx"
25d4aefcaeSZheng Fan #include "svx/sidebar/ValueSetWithTextControl.hxx"
26d4aefcaeSZheng Fan #include <sfx2/bindings.hxx>
27d4aefcaeSZheng Fan #include <svtools/ctrlbox.hxx>
28d4aefcaeSZheng Fan #include <svtools/ctrltool.hxx>
29d4aefcaeSZheng Fan #include "TextPropertyPanel.hxx"
30d4aefcaeSZheng Fan #include <vcl/fixed.hxx>
31d4aefcaeSZheng Fan 
32d4aefcaeSZheng Fan 
33d4aefcaeSZheng Fan namespace svx { namespace sidebar {
34d4aefcaeSZheng Fan #define SPACING_NOCUSTOM				0
35d4aefcaeSZheng Fan #define SPACING_CLOSE_BY_CLICK_ICON		-1
36d4aefcaeSZheng Fan #define SPACING_CLOSE_BY_CUS_EDIT		1
37d4aefcaeSZheng Fan 
38d4aefcaeSZheng Fan #define SIDEBAR_SPACING_GLOBAL_VALUE	String("PopupPanal_Spacing", 18, RTL_TEXTENCODING_ASCII_US)
39d4aefcaeSZheng Fan 
40d4aefcaeSZheng Fan #define SIDEBAR_SPACE_NORMAL	0
41d4aefcaeSZheng Fan #define SIDEBAR_SPACE_EXPAND	1
42d4aefcaeSZheng Fan #define SIDEBAR_SPACE_CONDENSED	2
43*45da7d5eSAndre Fischer 
44d4aefcaeSZheng Fan class TextCharacterSpacingControl:public svx::sidebar::PopupControl
45d4aefcaeSZheng Fan {
46d4aefcaeSZheng Fan public:
47*45da7d5eSAndre Fischer 	TextCharacterSpacingControl (
48*45da7d5eSAndre Fischer         Window* pParent,
49*45da7d5eSAndre Fischer         svx::sidebar::TextPropertyPanel& rPanel,
50*45da7d5eSAndre Fischer         SfxBindings* pBindings);
51*45da7d5eSAndre Fischer 	virtual ~TextCharacterSpacingControl();
52d4aefcaeSZheng Fan 	void ToGetFocus();
53d4aefcaeSZheng Fan 	void Rearrange(bool bLBAvailable,bool bAvailable, long nKerning);
54d4aefcaeSZheng Fan 	//virtual void Paint(const Rectangle& rect);
55d4aefcaeSZheng Fan 
56d4aefcaeSZheng Fan 	//add
57d4aefcaeSZheng Fan 	short GetLastCustomState();
58d4aefcaeSZheng Fan 	long  GetLastCustomValue();
59d4aefcaeSZheng Fan 	//add end
60d4aefcaeSZheng Fan 
61d4aefcaeSZheng Fan private:
62d4aefcaeSZheng Fan 	svx::sidebar::TextPropertyPanel&     mrTextPropertyPanel;
63d4aefcaeSZheng Fan 	SfxBindings*		mpBindings;
64d4aefcaeSZheng Fan 
65d4aefcaeSZheng Fan 	ValueSetWithTextControl	maVSSpacing;
66d4aefcaeSZheng Fan 
67d4aefcaeSZheng Fan 	FixedText			maLastCus;
68d4aefcaeSZheng Fan //	Control				maBorder;
69d4aefcaeSZheng Fan 
70d4aefcaeSZheng Fan 	FixedText			maFTSpacing;
71d4aefcaeSZheng Fan 	ListBox				maLBKerning;
72d4aefcaeSZheng Fan 	FixedText			maFTBy;
73d4aefcaeSZheng Fan 	MetricField			maEditKerning;
74d4aefcaeSZheng Fan 
75d4aefcaeSZheng Fan 	Image*				mpImg;
76d4aefcaeSZheng Fan 	Image*				mpImgSel;
77d4aefcaeSZheng Fan 	XubString*			mpStr;
78d4aefcaeSZheng Fan 	XubString*			mpStrTip;
79d4aefcaeSZheng Fan 
80d4aefcaeSZheng Fan 	Image				maImgCus;
81d4aefcaeSZheng Fan 	Image				maImgCusGrey;
82d4aefcaeSZheng Fan 	XubString			maStrCus;
83d4aefcaeSZheng Fan 	XubString			maStrCusE;		//add
84d4aefcaeSZheng Fan 	XubString			maStrCusC;		//add
85d4aefcaeSZheng Fan 	XubString			maStrCusN;		//add
86d4aefcaeSZheng Fan 	XubString			maStrUnit;		//add
87d4aefcaeSZheng Fan 
88d4aefcaeSZheng Fan 	long				mnCustomKern;
89d4aefcaeSZheng Fan 	short				mnLastCus;
90d4aefcaeSZheng Fan 	bool				mbCusEnable;
91d4aefcaeSZheng Fan 	bool				mbVS;
92d4aefcaeSZheng Fan 
93d4aefcaeSZheng Fan 	void initial();
94d4aefcaeSZheng Fan 	DECL_LINK(VSSelHdl, void*);
95d4aefcaeSZheng Fan 	DECL_LINK(KerningSelectHdl, ListBox*);
96d4aefcaeSZheng Fan 	DECL_LINK(KerningModifyHdl,  MetricField*);
97d4aefcaeSZheng Fan };
98d4aefcaeSZheng Fan }}
99d4aefcaeSZheng Fan 
100d4aefcaeSZheng Fan #endif
101