Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _RSCARRAY_HXX
20 : #define _RSCARRAY_HXX
21 :
22 : #include <rscall.h>
23 : #include <rscerror.h>
24 : #include <rsctop.hxx>
25 :
26 : class RscEnum;
27 :
28 : class RscInstNode : public IdNode
29 : {
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 58149 : RscInstNode * Left() const { return (RscInstNode *)pLeft ; };
39 58146 : RscInstNode * Right() const{ return (RscInstNode *)pRight ; };
40 19417 : RscInstNode * Search( sal_uInt32 nId ) const
41 : {
42 19417 : return (RscInstNode *)IdNode::Search( nId );
43 : }
44 : };
45 :
46 : struct RscArrayInst
47 : {
48 : RscInstNode * pNode;
49 : };
50 :
51 : /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
52 : seine HashId.
53 : */
54 : class RscArray : public RscTop
55 : {
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;
68 :
69 : void SetTypeClass( RscEnum * pClass ) { pTypeClass = pClass; }
70 : virtual RscTop * GetTypeClass() const;
71 : RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool );
72 : void Destroy( const RSCINST & rInst );
73 : virtual ERRTYPE GetValueEle( const RSCINST & rInst, sal_Int32 lValue,
74 : RscTop * pCreateClass,
75 : RSCINST * pGetInst );
76 : virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId,
77 : RscTop * pCreateClass,
78 : RSCINST * pGetInst );
79 :
80 : // Gibt die Groesse der Klasse in Bytes
81 72473 : sal_uInt32 Size(){ return nSize; }
82 :
83 : bool IsConsistent( const RSCINST & rInst );
84 : virtual void SetToDefault( const RSCINST & rInst );
85 : bool IsDefault( const RSCINST & rInst );
86 : bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
87 :
88 : virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput,
89 : RscTypCont * pTC, sal_uInt32 nTab,
90 : const RscId & aId, const char * );
91 : void WriteSrc( const RSCINST & rInst, FILE * fOutput,
92 : RscTypCont * pTC, sal_uInt32 nTab, const char * );
93 : ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
94 : RscTypCont * pTC, sal_uInt32, bool bExtra );
95 : };
96 :
97 : class RscClassArray : public RscArray
98 : {
99 : public:
100 : RscClassArray( Atom nId, sal_uInt32 nTypId,
101 : RscTop * pSuper, RscEnum * pTypeClass );
102 : ~RscClassArray();
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 : virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem,
109 : RscTypCont * pTC, const RscId & aId,
110 : sal_uInt32 nDeep, bool bExtra );
111 : };
112 :
113 :
114 2504 : class RscLangArray : public RscArray
115 : {
116 : public:
117 : RscLangArray( Atom nId, sal_uInt32 nTypId,
118 : RscTop * pSuper, RscEnum * pTypeClass );
119 : virtual RSCCLASS_TYPE GetClassType() const;
120 : };
121 :
122 : #endif //_RSCARRAY
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|