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