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