1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
24 #include <rschash.hxx>
27 /******************* R s c R a n g e *************************************/
28 class RscRange
: public RscTop
32 sal_uInt16 nValue
; // nValue = Ausgangswert - nMin
33 sal_Bool bDflt
; // Ist Default
35 sal_Int32 nMin
; // Minimum des Bereiches
36 sal_Int32 nMax
; // Maximum des Bereiches
39 RscRange( Atom nId
, sal_uInt32 nTypId
);
40 virtual RSCCLASS_TYPE
GetClassType() const;
41 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, sal_Bool
);
42 // Der zulaessige Bereich wird gesetzt
43 ERRTYPE
SetRange( sal_Int32 nMinimum
, sal_Int32 nMaximum
);
44 // Gibt die Groesse der Klasse in Bytes
45 sal_uInt32
Size(){ return nSize
; }
46 // Eine Zuweisung an eine Variable
47 virtual void SetToDefault( const RSCINST
& rInst
)
49 ((RscRangeInst
*)rInst
.pData
)->bDflt
= sal_True
;
51 sal_Bool
IsDefault( const RSCINST
& rInst
)
53 return( ((RscRangeInst
*)rInst
.pData
)->bDflt
);
56 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
57 ERRTYPE
SetNumber( const RSCINST
&, sal_Int32
);
58 ERRTYPE
GetNumber( const RSCINST
&, sal_Int32
* );
59 void WriteSrc( const RSCINST
&, FILE * fOutput
,
60 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
61 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
62 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
63 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
67 /******************* R s c L o n g R a n g e ******************************/
68 class RscLongRange
: public RscTop
71 struct RscLongRangeInst
73 sal_Int32 nValue
; // nValue = Ausgangswert - nMin
74 sal_Bool bDflt
; // Ist Default
76 sal_Int32 nMin
; // Minimum des Bereiches
77 sal_Int32 nMax
; // Maximum des Bereiches
80 RscLongRange( Atom nId
, sal_uInt32 nTypId
);
81 virtual RSCCLASS_TYPE
GetClassType() const;
82 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, sal_Bool
);
83 // Der zulaessige Bereich wird gesetzt
84 ERRTYPE
SetRange( sal_Int32 nMinimum
, sal_Int32 nMaximum
);
85 // Gibt die Groesse der Klasse in Bytes
86 sal_uInt32
Size(){ return nSize
; }
87 // Eine Zuweisung an eine Variable
88 virtual void SetToDefault( const RSCINST
& rInst
)
90 ((RscLongRangeInst
*)rInst
.pData
)->bDflt
= sal_True
;
92 sal_Bool
IsDefault( const RSCINST
& rInst
)
94 return( ((RscLongRangeInst
*)rInst
.pData
)->bDflt
);
97 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
98 ERRTYPE
SetNumber( const RSCINST
&, sal_Int32
);
99 ERRTYPE
GetNumber( const RSCINST
&, sal_Int32
* );
100 void WriteSrc( const RSCINST
&, FILE * fOutput
,
101 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
102 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
103 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
104 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
109 /******************* R s c L o n g E n u m R a n g e ******************/
110 class RscLongEnumRange
: public RscLongRange
113 RscLongEnumRange( Atom nId
, sal_uInt32 nTypId
);
115 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
119 /******************* R s c I d R a n g e ***********************************/
120 class RscIdRange
: public RscTop
124 sal_Int32 nMin
; // Minimum des Bereiches
125 sal_Int32 nMax
; // Maximum des Bereiches
127 RscIdRange( Atom nId
, sal_uInt32 nTypId
);
128 virtual RSCCLASS_TYPE
GetClassType() const;
129 // Der zulaessige Bereich wird gesetzt
130 ERRTYPE
SetRange( sal_Int32 nMinimum
, sal_Int32 nMaximum
){
135 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, sal_Bool
);
136 void Destroy( const RSCINST
& rInst
);
137 sal_uInt32
Size(){ return nSize
; }
138 virtual void SetToDefault( const RSCINST
& rInst
)
140 ((RscId
*)rInst
.pData
)->aExp
.cUnused
= sal_True
;
142 sal_Bool
IsDefault( const RSCINST
& rInst
)
144 //cUnused wird fuer Defaultkennung verwendet
145 return ((RscId
*)rInst
.pData
)->aExp
.cUnused
146 ? sal_True
: sal_False
;
148 // Als Default setzen
149 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
150 ERRTYPE
SetNumber( const RSCINST
&, sal_Int32
);
151 ERRTYPE
GetNumber( const RSCINST
&, sal_Int32
* );
152 ERRTYPE
SetRef( const RSCINST
&, const RscId
& rRscId
);
153 ERRTYPE
GetRef( const RSCINST
& rInst
, RscId
* );
154 void WriteSrc( const RSCINST
&, FILE * fOutput
,
155 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
156 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
157 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
158 sal_Bool
IsConsistent( const RSCINST
& rInst
);
159 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
164 /******************* R s c B o o l ***************************************/
165 class RscBool
: public RscRange
168 RscBool( Atom nId
, sal_uInt32 nTypId
);
169 virtual RSCCLASS_TYPE
GetClassType() const;
170 // Der zulaessige Bereich wird gesetzt
171 ERRTYPE
SetRange( sal_Int32
, sal_Int32
){
172 return( ERR_UNKNOWN_METHOD
);
174 ERRTYPE
SetBool( const RSCINST
& rInst
, sal_Bool b
){
175 return( SetNumber( rInst
, (sal_Int32
)b
) );
177 ERRTYPE
GetBool( const RSCINST
& rInst
, sal_Bool
* pB
){
179 GetNumber( rInst
, &l
);
183 void WriteSrc( const RSCINST
&, FILE * fOutput
,
184 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
185 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
190 class RscBreakRange
: public RscRange
{
193 RscBreakRange( Atom nId
, sal_uInt32 nTypId
);
194 void SetOutRange( sal_Int32 nNumber
){
197 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, sal_Bool
);
198 ERRTYPE
SetNumber( const RSCINST
&, sal_Int32
);
201 #endif // _RSCRANGE_HXX
203 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */