bump product version to 4.1.6.2
[LibreOffice.git] / rsc / inc / rscarray.hxx
blob9d036a5fc4fe76c307c5cc8b6f91b790ab882895
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _RSCARRAY_HXX
20 #define _RSCARRAY_HXX
22 #include <rscall.h>
23 #include <rscerror.h>
24 #include <rsctop.hxx>
26 class RscEnum;
28 class RscInstNode : public IdNode
30 sal_uInt32 nTypeId;
31 protected:
32 using NameNode::Search;
33 public:
34 RSCINST aInst;
35 RscInstNode( sal_uInt32 nId );
36 ~RscInstNode();
37 virtual sal_uInt32 GetId() const;
38 RscInstNode * Left() const { return (RscInstNode *)pLeft ; };
39 RscInstNode * Right() const{ return (RscInstNode *)pRight ; };
40 RscInstNode * Search( sal_uInt32 nId ) const
42 return (RscInstNode *)IdNode::Search( nId );
46 struct RscArrayInst
48 RscInstNode * pNode;
51 /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
52 seine HashId.
54 class RscArray : public RscTop
56 protected:
57 RscEnum * pTypeClass; // Typ der Eintraege
58 sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse
59 // mit Superklassen
60 sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten
61 void WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
62 RscTypCont * pTC, sal_uInt32 nTab, const char * );
63 public:
64 RscArray( Atom nId, sal_uInt32 nTypId,
65 RscTop * pSuper, RscEnum * pTypeClass );
66 ~RscArray();
67 virtual RSCCLASS_TYPE GetClassType() const;
69 void SetTypeClass( RscEnum * pClass )
71 pTypeClass = pClass;
73 virtual RscTop * GetTypeClass() const;
74 RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
75 void Destroy( const RSCINST & rInst );
76 virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
77 RscTop * pCreateClass,
78 RSCINST * pGetInst );
79 virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
80 RscTop * pCreateClass,
81 RSCINST * pGetInst );
83 // Gibt die Groesse der Klasse in Bytes
84 sal_uInt32 Size(){ return( nSize ); };
86 sal_Bool IsConsistent( const RSCINST & rInst );
87 virtual void SetToDefault( const RSCINST & rInst );
88 sal_Bool IsDefault( const RSCINST & rInst );
89 sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
91 virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
92 RscTypCont * pTC, sal_uInt32 nTab,
93 const RscId & aId, const char * );
94 void WriteSrc( const RSCINST & rInst, FILE * fOutput,
95 RscTypCont * pTC, sal_uInt32 nTab, const char * );
96 ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
97 RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
100 class RscClassArray : public RscArray
102 public:
103 RscClassArray( Atom nId, sal_uInt32 nTypId,
104 RscTop * pSuper, RscEnum * pTypeClass );
105 ~RscClassArray();
106 virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
107 RscTypCont * pTC, sal_uInt32 nTab,
108 const RscId & aId, const char * );
109 void WriteSrc( const RSCINST & rInst, FILE * fOutput,
110 RscTypCont * pTC, sal_uInt32 nTab, const char * );
111 virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
112 RscTypCont * pTC, const RscId & aId,
113 sal_uInt32 nDeep, sal_Bool bExtra );
117 class RscLangArray : public RscArray
119 public:
120 RscLangArray( Atom nId, sal_uInt32 nTypId,
121 RscTop * pSuper, RscEnum * pTypeClass );
122 virtual RSCCLASS_TYPE GetClassType() const;
125 #endif //_RSCARRAY
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */