1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscrange.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
35 #include <rschash.hxx>
38 /******************* R s c R a n g e *************************************/
39 class RscRange
: public RscTop
43 sal_uInt16 nValue
; // nValue = Ausgangswert - nMin
44 BOOL bDflt
; // Ist Default
46 INT32 nMin
; // Minimum des Bereiches
47 INT32 nMax
; // Maximum des Bereiches
50 RscRange( Atom nId
, sal_uInt32 nTypId
);
51 virtual RSCCLASS_TYPE
GetClassType() const;
52 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, BOOL
);
53 // Der zulaessige Bereich wird gesetzt
54 ERRTYPE
SetRange( INT32 nMinimum
, INT32 nMaximum
);
55 // Gibt die Groesse der Klasse in Bytes
56 sal_uInt32
Size(){ return nSize
; }
57 // Eine Zuweisung an eine Variable
58 virtual void SetToDefault( const RSCINST
& rInst
)
60 ((RscRangeInst
*)rInst
.pData
)->bDflt
= TRUE
;
62 BOOL
IsDefault( const RSCINST
& rInst
)
64 return( ((RscRangeInst
*)rInst
.pData
)->bDflt
);
67 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
68 ERRTYPE
SetNumber( const RSCINST
&, INT32
);
69 ERRTYPE
GetNumber( const RSCINST
&, INT32
* );
70 void WriteSrc( const RSCINST
&, FILE * fOutput
,
71 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
72 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
73 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
74 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
78 /******************* R s c L o n g R a n g e ******************************/
79 class RscLongRange
: public RscTop
82 struct RscLongRangeInst
84 INT32 nValue
; // nValue = Ausgangswert - nMin
85 BOOL bDflt
; // Ist Default
87 INT32 nMin
; // Minimum des Bereiches
88 INT32 nMax
; // Maximum des Bereiches
91 RscLongRange( Atom nId
, sal_uInt32 nTypId
);
92 virtual RSCCLASS_TYPE
GetClassType() const;
93 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, BOOL
);
94 // Der zulaessige Bereich wird gesetzt
95 ERRTYPE
SetRange( INT32 nMinimum
, INT32 nMaximum
);
96 // Gibt die Groesse der Klasse in Bytes
97 sal_uInt32
Size(){ return nSize
; }
98 // Eine Zuweisung an eine Variable
99 virtual void SetToDefault( const RSCINST
& rInst
)
101 ((RscLongRangeInst
*)rInst
.pData
)->bDflt
= TRUE
;
103 BOOL
IsDefault( const RSCINST
& rInst
)
105 return( ((RscLongRangeInst
*)rInst
.pData
)->bDflt
);
107 // Als Default setzen
108 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
109 ERRTYPE
SetNumber( const RSCINST
&, INT32
);
110 ERRTYPE
GetNumber( const RSCINST
&, INT32
* );
111 void WriteSrc( const RSCINST
&, FILE * fOutput
,
112 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
113 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
114 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
115 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
120 /******************* R s c L o n g E n u m R a n g e ******************/
121 class RscLongEnumRange
: public RscLongRange
124 RscLongEnumRange( Atom nId
, sal_uInt32 nTypId
);
126 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
130 /******************* R s c I d R a n g e ***********************************/
131 class RscIdRange
: public RscTop
135 INT32 nMin
; // Minimum des Bereiches
136 INT32 nMax
; // Maximum des Bereiches
138 RscIdRange( Atom nId
, sal_uInt32 nTypId
);
139 virtual RSCCLASS_TYPE
GetClassType() const;
140 // Der zulaessige Bereich wird gesetzt
141 ERRTYPE
SetRange( INT32 nMinimum
, INT32 nMaximum
){
146 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, BOOL
);
147 void Destroy( const RSCINST
& rInst
);
148 sal_uInt32
Size(){ return nSize
; }
149 virtual void SetToDefault( const RSCINST
& rInst
)
151 ((RscId
*)rInst
.pData
)->aExp
.cUnused
= TRUE
;
153 BOOL
IsDefault( const RSCINST
& rInst
)
155 //cUnused wird fuer Defaultkennung verwendet
156 return ((RscId
*)rInst
.pData
)->aExp
.cUnused
159 // Als Default setzen
160 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
161 ERRTYPE
SetNumber( const RSCINST
&, INT32
);
162 ERRTYPE
GetNumber( const RSCINST
&, INT32
* );
163 ERRTYPE
SetRef( const RSCINST
&, const RscId
& rRscId
);
164 ERRTYPE
GetRef( const RSCINST
& rInst
, RscId
* );
165 void WriteSrc( const RSCINST
&, FILE * fOutput
,
166 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
167 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
168 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
169 BOOL
IsConsistent( const RSCINST
& rInst
, RscInconsList
* pList
);
170 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
175 /******************* R s c B o o l ***************************************/
176 class RscBool
: public RscRange
179 RscBool( Atom nId
, sal_uInt32 nTypId
);
180 virtual RSCCLASS_TYPE
GetClassType() const;
181 // Der zulaessige Bereich wird gesetzt
182 ERRTYPE
SetRange( INT32
, INT32
){
183 return( ERR_UNKNOWN_METHOD
);
185 ERRTYPE
SetBool( const RSCINST
& rInst
, BOOL b
){
186 return( SetNumber( rInst
, (INT32
)b
) );
188 ERRTYPE
GetBool( const RSCINST
& rInst
, BOOL
* pB
){
190 GetNumber( rInst
, &l
);
194 void WriteSrc( const RSCINST
&, FILE * fOutput
,
195 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
196 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
201 class RscBreakRange
: public RscRange
{
204 RscBreakRange( Atom nId
, sal_uInt32 nTypId
);
205 void SetOutRange( INT32 nNumber
){
208 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDfltInst
, BOOL
);
209 ERRTYPE
SetNumber( const RSCINST
&, INT32
);
212 #endif // _RSCRANGE_HXX