1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #ifndef INCLUDED_RSC_INC_RSCARRAY_HXX
21 #define INCLUDED_RSC_INC_RSCARRAY_HXX
29 class RscInstNode
: public IdNode
33 using NameNode::Search
;
36 RscInstNode( sal_uInt32 nId
);
37 virtual ~RscInstNode();
38 virtual sal_uInt32
GetId() const SAL_OVERRIDE
;
39 RscInstNode
* Left() const { return static_cast<RscInstNode
*>(pLeft
); };
40 RscInstNode
* Right() const{ return static_cast<RscInstNode
*>(pRight
); };
41 RscInstNode
* Search( sal_uInt32 nId
) const
43 return static_cast<RscInstNode
*>(IdNode::Search( nId
));
52 /* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber
55 class RscArray
: public RscTop
58 RscEnum
* pTypeClass
; // Typ der Eintraege
59 sal_uInt32 nSize
; // Groesse der Instanzdaten dieser Klasse
61 sal_uInt32 nOffInstData
;// Offset auf eigen Instanzdaten
62 void WriteSrcArray( const RSCINST
& rInst
, FILE * fOutput
,
63 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
65 RscArray( Atom nId
, sal_uInt32 nTypId
,
66 RscTop
* pSuper
, RscEnum
* pTypeClass
);
68 virtual RSCCLASS_TYPE
GetClassType() const SAL_OVERRIDE
;
70 void SetTypeClass( RscEnum
* pClass
) { pTypeClass
= pClass
; }
71 virtual RscTop
* GetTypeClass() const SAL_OVERRIDE
;
72 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, bool ) SAL_OVERRIDE
;
73 void Destroy( const RSCINST
& rInst
) SAL_OVERRIDE
;
74 virtual ERRTYPE
GetValueEle( const RSCINST
& rInst
, sal_Int32 lValue
,
75 RscTop
* pCreateClass
,
76 RSCINST
* pGetInst
) SAL_OVERRIDE
;
77 virtual ERRTYPE
GetArrayEle( const RSCINST
& rInst
, Atom nId
,
78 RscTop
* pCreateClass
,
79 RSCINST
* pGetInst
) SAL_OVERRIDE
;
81 // Gibt die Groesse der Klasse in Bytes
82 sal_uInt32
Size() SAL_OVERRIDE
{ return nSize
; }
84 bool IsConsistent( const RSCINST
& rInst
) SAL_OVERRIDE
;
85 virtual void SetToDefault( const RSCINST
& rInst
) SAL_OVERRIDE
;
86 bool IsDefault( const RSCINST
& rInst
) SAL_OVERRIDE
;
87 bool IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
) SAL_OVERRIDE
;
89 virtual void WriteSrcHeader( const RSCINST
& rInst
, FILE * fOutput
,
90 RscTypCont
* pTC
, sal_uInt32 nTab
,
91 const RscId
& aId
, const char * ) SAL_OVERRIDE
;
92 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
93 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * ) SAL_OVERRIDE
;
94 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
95 RscTypCont
* pTC
, sal_uInt32
, bool bExtra
) SAL_OVERRIDE
;
98 class RscClassArray
: public RscArray
101 RscClassArray( Atom nId
, sal_uInt32 nTypId
,
102 RscTop
* pSuper
, RscEnum
* pTypeClass
);
103 virtual ~RscClassArray();
104 virtual void WriteSrcHeader( const RSCINST
& rInst
, FILE * fOutput
,
105 RscTypCont
* pTC
, sal_uInt32 nTab
,
106 const RscId
& aId
, const char * ) SAL_OVERRIDE
;
107 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
108 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * ) SAL_OVERRIDE
;
109 virtual ERRTYPE
WriteRcHeader( const RSCINST
& rInst
, RscWriteRc
& aMem
,
110 RscTypCont
* pTC
, const RscId
& aId
,
111 sal_uInt32 nDeep
, bool bExtra
) SAL_OVERRIDE
;
115 class RscLangArray
: public RscArray
118 RscLangArray( Atom nId
, sal_uInt32 nTypId
,
119 RscTop
* pSuper
, RscEnum
* pTypeClass
);
120 virtual RSCCLASS_TYPE
GetClassType() const SAL_OVERRIDE
;
123 #endif // INCLUDED_RSC_INC_RSCARRAY_HXX
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */