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: rscarray.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 ************************************************************************/
39 /******************* R s c A r r a y ************************************/
40 class RscInstNode
: public IdNode
44 using NameNode::Search
;
47 RscInstNode( sal_uInt32 nId
);
49 virtual sal_uInt32
GetId() const;
50 RscInstNode
* Left() const { return (RscInstNode
*)pLeft
; };
51 RscInstNode
* Right() const{ return (RscInstNode
*)pRight
; };
52 RscInstNode
* Search( sal_uInt32 nId
) const
54 return (RscInstNode
*)IdNode::Search( nId
);
63 /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
66 class RscArray
: public RscTop
69 RscEnum
* pTypeClass
; // Typ der Eintraege
70 sal_uInt32 nSize
; // Groesse der Instanzdaten dieser Klasse
72 sal_uInt32 nOffInstData
;// Offset auf eigen Instanzdaten
73 void WriteSrcArray( const RSCINST
& rInst
, FILE * fOutput
,
74 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
76 RscArray( Atom nId
, sal_uInt32 nTypId
,
77 RscTop
* pSuper
, RscEnum
* pTypeClass
);
79 virtual RSCCLASS_TYPE
GetClassType() const;
81 void SetTypeClass( RscEnum
* pClass
)
85 virtual RscTop
* GetTypeClass() const;
86 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, BOOL
);
87 void Destroy( const RSCINST
& rInst
);
88 virtual ERRTYPE
GetValueEle( const RSCINST
& rInst
, INT32 lValue
,
89 RscTop
* pCreateClass
,
91 virtual ERRTYPE
GetArrayEle( const RSCINST
& rInst
, Atom nId
,
92 RscTop
* pCreateClass
,
95 // Gibt die Groesse der Klasse in Bytes
96 sal_uInt32
Size(){ return( nSize
); };
98 BOOL
IsConsistent( const RSCINST
& rInst
, RscInconsList
* pList
);
99 virtual void SetToDefault( const RSCINST
& rInst
);
100 BOOL
IsDefault( const RSCINST
& rInst
);
101 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
103 virtual void WriteSrcHeader( const RSCINST
& rInst
, FILE * fOutput
,
104 RscTypCont
* pTC
, sal_uInt32 nTab
,
105 const RscId
& aId
, const char * );
106 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
107 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
108 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
109 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
110 virtual void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
114 class RscClassArray
: public RscArray
117 RscClassArray( Atom nId
, sal_uInt32 nTypId
,
118 RscTop
* pSuper
, RscEnum
* pTypeClass
);
120 virtual void WriteSrcHeader( const RSCINST
& rInst
, FILE * fOutput
,
121 RscTypCont
* pTC
, sal_uInt32 nTab
,
122 const RscId
& aId
, const char * );
123 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
124 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
125 virtual ERRTYPE
WriteRcHeader( const RSCINST
& rInst
, RscWriteRc
& aMem
,
126 RscTypCont
* pTC
, const RscId
& aId
,
127 sal_uInt32 nDeep
, BOOL bExtra
);
131 class RscLangArray
: public RscArray
134 RscLangArray( Atom nId
, sal_uInt32 nTypId
,
135 RscTop
* pSuper
, RscEnum
* pTypeClass
);
136 virtual RSCCLASS_TYPE
GetClassType() const;