Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / rsc / inc / rscarray.hxx
blob1ab0f2e31271b4c3c7d87e089ebb26d2cdb745db
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 /******************* R s c A r r a y ************************************/
29 class RscInstNode : public IdNode
31 sal_uInt32 nTypeId;
32 protected:
33 using NameNode::Search;
34 public:
35 RSCINST aInst;
36 RscInstNode( sal_uInt32 nId );
37 ~RscInstNode();
38 virtual sal_uInt32 GetId() const;
39 RscInstNode * Left() const { return (RscInstNode *)pLeft ; };
40 RscInstNode * Right() const{ return (RscInstNode *)pRight ; };
41 RscInstNode * Search( sal_uInt32 nId ) const
43 return (RscInstNode *)IdNode::Search( nId );
47 struct RscArrayInst
49 RscInstNode * pNode;
52 /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
53 seine HashId.
55 class RscArray : public RscTop
57 protected:
58 RscEnum * pTypeClass; // Typ der Eintraege
59 sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse
60 // mit Superklassen
61 sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten
62 void WriteSrcArray( const RSCINST & rInst, FILE * fOutput,
63 RscTypCont * pTC, sal_uInt32 nTab, const char * );
64 public:
65 RscArray( Atom nId, sal_uInt32 nTypId,
66 RscTop * pSuper, RscEnum * pTypeClass );
67 ~RscArray();
68 virtual RSCCLASS_TYPE GetClassType() const;
70 void SetTypeClass( RscEnum * pClass )
72 pTypeClass = pClass;
74 virtual RscTop * GetTypeClass() const;
75 RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
76 void Destroy( const RSCINST & rInst );
77 virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
78 RscTop * pCreateClass,
79 RSCINST * pGetInst );
80 virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
81 RscTop * pCreateClass,
82 RSCINST * pGetInst );
84 // Gibt die Groesse der Klasse in Bytes
85 sal_uInt32 Size(){ return( nSize ); };
87 sal_Bool IsConsistent( const RSCINST & rInst );
88 virtual void SetToDefault( const RSCINST & rInst );
89 sal_Bool IsDefault( const RSCINST & rInst );
90 sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
92 virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
93 RscTypCont * pTC, sal_uInt32 nTab,
94 const RscId & aId, const char * );
95 void WriteSrc( const RSCINST & rInst, FILE * fOutput,
96 RscTypCont * pTC, sal_uInt32 nTab, const char * );
97 ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
98 RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
99 virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
100 const char * );
103 class RscClassArray : public RscArray
105 public:
106 RscClassArray( Atom nId, sal_uInt32 nTypId,
107 RscTop * pSuper, RscEnum * pTypeClass );
108 ~RscClassArray();
109 virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
110 RscTypCont * pTC, sal_uInt32 nTab,
111 const RscId & aId, const char * );
112 void WriteSrc( const RSCINST & rInst, FILE * fOutput,
113 RscTypCont * pTC, sal_uInt32 nTab, const char * );
114 virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
115 RscTypCont * pTC, const RscId & aId,
116 sal_uInt32 nDeep, sal_Bool bExtra );
120 class RscLangArray : public RscArray
122 public:
123 RscLangArray( Atom nId, sal_uInt32 nTypId,
124 RscTop * pSuper, RscEnum * pTypeClass );
125 virtual RSCCLASS_TYPE GetClassType() const;
128 #endif //_RSCARRAY
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */