xref: /aoo42x/main/rsc/inc/rscarray.hxx (revision f7c60c9c)
1*f7c60c9cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f7c60c9cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f7c60c9cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f7c60c9cSAndrew Rist  * distributed with this work for additional information
6*f7c60c9cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f7c60c9cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f7c60c9cSAndrew Rist  * "License"); you may not use this file except in compliance
9*f7c60c9cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f7c60c9cSAndrew Rist  *
11*f7c60c9cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f7c60c9cSAndrew Rist  *
13*f7c60c9cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f7c60c9cSAndrew Rist  * software distributed under the License is distributed on an
15*f7c60c9cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f7c60c9cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*f7c60c9cSAndrew Rist  * specific language governing permissions and limitations
18*f7c60c9cSAndrew Rist  * under the License.
19*f7c60c9cSAndrew Rist  *
20*f7c60c9cSAndrew Rist  *************************************************************/
21*f7c60c9cSAndrew Rist 
22*f7c60c9cSAndrew Rist 
23cdf0e10cSrcweir #ifndef _RSCARRAY_HXX
24cdf0e10cSrcweir #define _RSCARRAY_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <rscall.h>
27cdf0e10cSrcweir #include <rscerror.h>
28cdf0e10cSrcweir #include <rsctop.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class RscEnum;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir /******************* R s c A r r a y ************************************/
33cdf0e10cSrcweir class RscInstNode : public IdNode
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 	sal_uInt32	nTypeId;
36cdf0e10cSrcweir protected:
37cdf0e10cSrcweir     using NameNode::Search;
38cdf0e10cSrcweir public:
39cdf0e10cSrcweir 	RSCINST	aInst;
40cdf0e10cSrcweir 	RscInstNode( sal_uInt32 nId );
41cdf0e10cSrcweir 	~RscInstNode();
42cdf0e10cSrcweir 	virtual sal_uInt32	GetId() const;
Left() const43cdf0e10cSrcweir 	RscInstNode *   Left() const { return (RscInstNode *)pLeft  ; };
Right() const44cdf0e10cSrcweir 	RscInstNode *   Right() const{ return (RscInstNode *)pRight ; };
Search(sal_uInt32 nId) const45cdf0e10cSrcweir 	RscInstNode *	Search( sal_uInt32 nId ) const
46cdf0e10cSrcweir 					{
47cdf0e10cSrcweir 						return (RscInstNode *)IdNode::Search( nId );
48cdf0e10cSrcweir 					}
49cdf0e10cSrcweir };
50cdf0e10cSrcweir 
51cdf0e10cSrcweir struct RscArrayInst
52cdf0e10cSrcweir {
53cdf0e10cSrcweir 	RscInstNode *	pNode;
54cdf0e10cSrcweir };
55cdf0e10cSrcweir 
56cdf0e10cSrcweir /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
57cdf0e10cSrcweir 	seine HashId.
58cdf0e10cSrcweir */
59cdf0e10cSrcweir class RscArray : public RscTop
60cdf0e10cSrcweir {
61cdf0e10cSrcweir protected:
62cdf0e10cSrcweir     RscEnum *       pTypeClass; // Typ der Eintraege
63cdf0e10cSrcweir     sal_uInt32          nSize;      // Groesse der Instanzdaten dieser Klasse
64cdf0e10cSrcweir                                 // mit Superklassen
65cdf0e10cSrcweir     sal_uInt32          nOffInstData;// Offset auf eigen Instanzdaten
66cdf0e10cSrcweir     void            WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
67cdf0e10cSrcweir                               	RscTypCont * pTC, sal_uInt32 nTab, const char * );
68cdf0e10cSrcweir public:
69cdf0e10cSrcweir                     RscArray( Atom nId, sal_uInt32 nTypId,
70cdf0e10cSrcweir                                 RscTop * pSuper, RscEnum * pTypeClass );
71cdf0e10cSrcweir                     ~RscArray();
72cdf0e10cSrcweir 	virtual RSCCLASS_TYPE	GetClassType() const;
73cdf0e10cSrcweir 
SetTypeClass(RscEnum * pClass)74cdf0e10cSrcweir     void            SetTypeClass( RscEnum * pClass )
75cdf0e10cSrcweir 					{
76cdf0e10cSrcweir                         pTypeClass = pClass;
77cdf0e10cSrcweir                     }
78cdf0e10cSrcweir     virtual RscTop *    GetTypeClass() const;
79cdf0e10cSrcweir     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
80cdf0e10cSrcweir     void            Destroy( const RSCINST & rInst );
81cdf0e10cSrcweir     virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
82cdf0e10cSrcweir 								RscTop * pCreateClass,
83cdf0e10cSrcweir                                 RSCINST * pGetInst );
84cdf0e10cSrcweir     virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
85cdf0e10cSrcweir 								RscTop * pCreateClass,
86cdf0e10cSrcweir                                 RSCINST * pGetInst );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir                     // Gibt die Groesse der Klasse in Bytes
Size()89cdf0e10cSrcweir     sal_uInt32          Size(){ return( nSize ); };
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     sal_Bool            IsConsistent( const RSCINST & rInst, RscInconsList * pList );
92cdf0e10cSrcweir 	virtual void	SetToDefault( const RSCINST & rInst );
93cdf0e10cSrcweir     sal_Bool            IsDefault( const RSCINST & rInst );
94cdf0e10cSrcweir     sal_Bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
95cdf0e10cSrcweir 
96cdf0e10cSrcweir     virtual void    WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
97cdf0e10cSrcweir                                     RscTypCont * pTC, sal_uInt32 nTab,
98cdf0e10cSrcweir                                     const RscId & aId, const char * );
99cdf0e10cSrcweir     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
100cdf0e10cSrcweir                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
101cdf0e10cSrcweir     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
102cdf0e10cSrcweir                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
103cdf0e10cSrcweir 	virtual void	WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
104cdf0e10cSrcweir 									const char * );
105cdf0e10cSrcweir };
106cdf0e10cSrcweir 
107cdf0e10cSrcweir class RscClassArray : public RscArray
108cdf0e10cSrcweir {
109cdf0e10cSrcweir public:
110cdf0e10cSrcweir                     RscClassArray( Atom nId, sal_uInt32 nTypId,
111cdf0e10cSrcweir                                 RscTop * pSuper, RscEnum * pTypeClass );
112cdf0e10cSrcweir                     ~RscClassArray();
113cdf0e10cSrcweir     virtual void    WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
114cdf0e10cSrcweir                                     RscTypCont * pTC, sal_uInt32 nTab,
115cdf0e10cSrcweir                                     const RscId & aId, const char * );
116cdf0e10cSrcweir     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
117cdf0e10cSrcweir                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
118cdf0e10cSrcweir     virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
119cdf0e10cSrcweir                                    RscTypCont * pTC, const RscId & aId,
120cdf0e10cSrcweir                     				sal_uInt32 nDeep, sal_Bool bExtra );
121cdf0e10cSrcweir };
122cdf0e10cSrcweir 
123cdf0e10cSrcweir 
124cdf0e10cSrcweir class RscLangArray : public RscArray
125cdf0e10cSrcweir {
126cdf0e10cSrcweir public:
127cdf0e10cSrcweir                     RscLangArray( Atom nId, sal_uInt32 nTypId,
128cdf0e10cSrcweir                                 RscTop * pSuper, RscEnum * pTypeClass );
129cdf0e10cSrcweir 	virtual RSCCLASS_TYPE	GetClassType() const;
130cdf0e10cSrcweir };
131cdf0e10cSrcweir 
132cdf0e10cSrcweir #endif //_RSCARRAY
133