Update ooo320-m1
[ooovba.git] / rsc / inc / rscarray.hxx
blobecfb5998beeb07e7ec11ab0b0e4662fca3d7e7ef
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscarray.hxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
30 #ifndef _RSCARRAY_HXX
31 #define _RSCARRAY_HXX
33 #include <rscall.h>
34 #include <rscerror.h>
35 #include <rsctop.hxx>
37 class RscEnum;
39 /******************* R s c A r r a y ************************************/
40 class RscInstNode : public IdNode
42 sal_uInt32 nTypeId;
43 protected:
44 using NameNode::Search;
45 public:
46 RSCINST aInst;
47 RscInstNode( sal_uInt32 nId );
48 ~RscInstNode();
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 );
58 struct RscArrayInst
60 RscInstNode * pNode;
63 /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
64 seine HashId.
66 class RscArray : public RscTop
68 protected:
69 RscEnum * pTypeClass; // Typ der Eintraege
70 sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse
71 // mit Superklassen
72 sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten
73 void WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
74 RscTypCont * pTC, sal_uInt32 nTab, const char * );
75 public:
76 RscArray( Atom nId, sal_uInt32 nTypId,
77 RscTop * pSuper, RscEnum * pTypeClass );
78 ~RscArray();
79 virtual RSCCLASS_TYPE GetClassType() const;
81 void SetTypeClass( RscEnum * pClass )
83 pTypeClass = 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,
90 RSCINST * pGetInst );
91 virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
92 RscTop * pCreateClass,
93 RSCINST * pGetInst );
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,
111 const char * );
114 class RscClassArray : public RscArray
116 public:
117 RscClassArray( Atom nId, sal_uInt32 nTypId,
118 RscTop * pSuper, RscEnum * pTypeClass );
119 ~RscClassArray();
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
133 public:
134 RscLangArray( Atom nId, sal_uInt32 nTypId,
135 RscTop * pSuper, RscEnum * pTypeClass );
136 virtual RSCCLASS_TYPE GetClassType() const;
139 #endif //_RSCARRAY