xref: /trunk/main/svx/inc/svx/relfld.hxx (revision b5da552ccefc4034e06a43bfae43fb8a8b64a7ad)
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 #ifndef _SVX_RELFLD_HXX
24 #define _SVX_RELFLD_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #ifndef _FIELD_HXX //autogen
29 #include <vcl/field.hxx>
30 #endif
31 #include "svx/svxdllapi.h"
32 
33 
34 // class SvxRelativeField ------------------------------------------------
35 /*
36     [Beschreibung]
37 
38     "Ahnlich der Klasse FontSizeBox. Abgeleitet von der Klasse MetricField.
39     Zus"atzliche Funktionalit"at: relative Angaben.
40 */
41 
42 class SVX_DLLPUBLIC SvxRelativeField : public MetricField
43 {
44 private:
45     sal_uInt16          nRelMin;
46     sal_uInt16          nRelMax;
47     sal_uInt16          nRelStep;
48     sal_Bool            bRelativeMode;
49     sal_Bool            bRelative;
50     sal_Bool            bNegativeEnabled;
51 
52 protected:
53     void            Modify();
54 
55 public:
56     SvxRelativeField( Window* pParent, WinBits nWinStyle = 0 );
57     SvxRelativeField( Window* pParent, const ResId& rResId );
58 
59     void            EnableRelativeMode( sal_uInt16 nMin = 50, sal_uInt16 nMax = 150,
60                                         sal_uInt16 nStep = 5 );
61     sal_Bool            IsRelativeMode() const { return bRelativeMode; }
62     void            SetRelative( sal_Bool bRelative = sal_False );
63     sal_Bool            IsRelative() const { return bRelative; }
64     void            EnableNegativeMode() {bNegativeEnabled = sal_True;}
65 };
66 
67 
68 #endif
69 
70