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 
22 
23 
24 #ifndef _SVX_SIDEBAR_CHARACTER_SPACING_CONTROL_HXX_
25 #define _SVX_SIDEBAR_CHARACTER_SPACING_CONTROL_HXX_
26 
27 #include "svx/sidebar/PopupControl.hxx"
28 #include "svx/sidebar/ValueSetWithTextControl.hxx"
29 #include <sfx2/bindings.hxx>
30 #include <svtools/ctrlbox.hxx>
31 #include <svtools/ctrltool.hxx>
32 #include "TextPropertyPanel.hxx"
33 #include <vcl/fixed.hxx>
34 
35 
36 namespace svx { namespace sidebar {
37 #define SPACING_NOCUSTOM				0
38 #define SPACING_CLOSE_BY_CLICK_ICON		-1
39 #define SPACING_CLOSE_BY_CUS_EDIT		1
40 
41 #define SIDEBAR_SPACING_GLOBAL_VALUE	String("PopupPanel_Spacing", 18, RTL_TEXTENCODING_ASCII_US)
42 
43 #define SIDEBAR_SPACE_NORMAL	0
44 #define SIDEBAR_SPACE_EXPAND	1
45 #define SIDEBAR_SPACE_CONDENSED	2
46 
47 class TextCharacterSpacingControl:public svx::sidebar::PopupControl
48 {
49 public:
50 	TextCharacterSpacingControl (
51 		Window* pParent,
52 		svx::sidebar::TextPropertyPanel& rPanel,
53 		SfxBindings* pBindings);
54 	virtual ~TextCharacterSpacingControl();
55 	void ToGetFocus();
56 	void Rearrange(bool bLBAvailable,bool bAvailable, long nKerning);
57 	// virtual void Paint(const Rectangle& rect);
58 
59 	// add
60 	short GetLastCustomState();
61 	long GetLastCustomValue();
62 	// add end
63 
64 private:
65 	svx::sidebar::TextPropertyPanel& mrTextPropertyPanel;
66 	SfxBindings*		mpBindings;
67 
68 	ValueSetWithTextControl	maVSSpacing;
69 
70 	FixedText			maLastCus;
71 //	Control				maBorder;
72 
73 	FixedText			maFTSpacing;
74 	ListBox				maLBKerning;
75 	FixedText			maFTBy;
76 	MetricField			maEditKerning;
77 
78 	Image*				mpImg;
79 	Image*				mpImgSel;
80 	XubString*			mpStr;
81 	XubString*			mpStrTip;
82 
83 	Image				maImgCus;
84 	Image				maImgCusGrey;
85 	XubString			maStrCus;
86 	XubString			maStrCusE;		// add
87 	XubString			maStrCusC;		// add
88 	XubString			maStrCusN;		// add
89 	XubString			maStrUnit;		// add
90 
91 	long				mnCustomKern;
92 	short				mnLastCus;
93 	bool				mbCusEnable;
94 	bool				mbVS;
95 
96 	void initial();
97 	DECL_LINK(VSSelHdl, void*);
98 	DECL_LINK(KerningSelectHdl, ListBox*);
99 	DECL_LINK(KerningModifyHdl, MetricField*);
100 };
101 }}
102 
103 #endif
104