xref: /AOO41X/main/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx (revision 766ce4d0f35a6d5b4b7c65174e638ff2dfbd4ec1)
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 ToGetFocus(bool bType);
47*766ce4d0SZheng Fan     void Rearrange(SfxItemState currSPState,FieldUnit currMetricUnit,SvxLineSpacingItem* currSPItem,const ::sfx2::sidebar::EnumContext currentContext);
48*766ce4d0SZheng Fan     //virtual void Paint(const Rectangle& rect);
49*766ce4d0SZheng Fan 
50*766ce4d0SZheng Fan     //add
51*766ce4d0SZheng Fan     short GetLastCustomState();
52*766ce4d0SZheng Fan     long  GetLastCustomValue();
53*766ce4d0SZheng Fan     //add end
54*766ce4d0SZheng Fan 
55*766ce4d0SZheng Fan     void ExecuteLineSpace();
56*766ce4d0SZheng Fan     void SetLineSpace( SvxLineSpacingItem& rLineSpace,
57*766ce4d0SZheng Fan                         int eSpace, long lValue = 0 );
58*766ce4d0SZheng Fan 
59*766ce4d0SZheng Fan     void ExecuteLineSpacing( sal_uInt16 aIsCustom, sal_uInt16 aEntry );
60*766ce4d0SZheng Fan     void SetAllNoSel();
61*766ce4d0SZheng Fan     void PopupModeEndCallback();
62*766ce4d0SZheng Fan 
63*766ce4d0SZheng Fan private:
64*766ce4d0SZheng Fan     bool                    mbUseLineSPCustom;
65*766ce4d0SZheng Fan     bool                    mbLineSPDisable;
66*766ce4d0SZheng Fan     SfxMapUnit                      m_eLNSpaceUnit;
67*766ce4d0SZheng Fan     ParaPropertyPanel&     mrParaPropertyPanel;
68*766ce4d0SZheng Fan     SfxBindings*        mpBindings;
69*766ce4d0SZheng Fan 
70*766ce4d0SZheng Fan     long                            nMinFixDist;
71*766ce4d0SZheng Fan     Edit*                           pActLineDistFld;
72*766ce4d0SZheng Fan 
73*766ce4d0SZheng Fan     ValueSetWithTextControl maLineSpacing;
74*766ce4d0SZheng Fan 
75*766ce4d0SZheng Fan     FixedText maCustomFT;
76*766ce4d0SZheng Fan     FixedText maLSpacingFT;
77*766ce4d0SZheng Fan     ListBox                         aLineDist;
78*766ce4d0SZheng Fan 
79*766ce4d0SZheng Fan     FixedText maOfFT;
80*766ce4d0SZheng Fan     MetricField                     aLineDistAtPercentBox;
81*766ce4d0SZheng Fan     MetricField                     aLineDistAtMetricBox;
82*766ce4d0SZheng Fan 
83*766ce4d0SZheng Fan     Image  maSpacing1;
84*766ce4d0SZheng Fan     Image  maSpacing115;
85*766ce4d0SZheng Fan     Image  maSpacing15;
86*766ce4d0SZheng Fan     Image  maSpacing2;
87*766ce4d0SZheng Fan     Image  maLPCustom;
88*766ce4d0SZheng Fan 
89*766ce4d0SZheng Fan     Image  maSelSpacing1;
90*766ce4d0SZheng Fan     Image  maSelSpacing115;
91*766ce4d0SZheng Fan     Image  maSelSpacing15;
92*766ce4d0SZheng Fan     Image  maSelSpacing2;
93*766ce4d0SZheng Fan     Image  maSelSelHanging;
94*766ce4d0SZheng Fan     Image               maImgCus;
95*766ce4d0SZheng Fan     Image               maImgCusGrey;
96*766ce4d0SZheng Fan     XubString           maStrCus;
97*766ce4d0SZheng Fan 
98*766ce4d0SZheng Fan     Image*              mpImg;
99*766ce4d0SZheng Fan     Image*              mpImgSel;
100*766ce4d0SZheng Fan     XubString*          mpStr;
101*766ce4d0SZheng Fan     XubString*          mpStrTip;
102*766ce4d0SZheng Fan     String              maLine;
103*766ce4d0SZheng Fan     String              maOf;
104*766ce4d0SZheng Fan 
105*766ce4d0SZheng Fan     sal_Int64             maValue;
106*766ce4d0SZheng Fan     sal_uInt16                maPos;
107*766ce4d0SZheng Fan private:
108*766ce4d0SZheng Fan     void initial();
109*766ce4d0SZheng Fan     DECL_LINK(LineSPDistHdl_Impl, ListBox*);
110*766ce4d0SZheng Fan     DECL_LINK(LineSPDistAtHdl_Impl, MetricField*);
111*766ce4d0SZheng Fan     DECL_LINK(VSSelHdl, void*);
112*766ce4d0SZheng Fan };
113*766ce4d0SZheng Fan }}
114*766ce4d0SZheng Fan 
115*766ce4d0SZheng Fan #endif
116*766ce4d0SZheng Fan 
117