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 .
19 #ifndef INCLUDED_RSC_INC_RSCCONT_HXX
20 #define INCLUDED_RSC_INC_RSCCONT_HXX
30 void Create(){ aName
.Create(); aInst
= RSCINST(); }
33 struct RscBaseContInst
36 ENTRY_STRUCT
* pEntries
;
40 class RscBaseCont
: public RscTop
43 RscTop
* pTypeClass
; // Typ der Eintraege
44 RscTop
* pTypeClass1
;// Zwei verschiedene Typen moeglich
45 bool bNoId
; // Keine Identifier
46 sal_uInt32 nSize
; // Groesse der Instanzdaten dieser Klasse
48 sal_uInt32 nOffInstData
;// Offset auf eigen Instanzdaten
49 static void DestroyElements( RscBaseContInst
* pClassData
);
50 RSCINST
SearchElePos( const RSCINST
& rInst
, const RscId
& rEleName
,
51 RscTop
* pClass
, sal_uInt32 nPos
);
53 void ContWriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
54 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
55 ERRTYPE
ContWriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
56 RscTypCont
* pTC
, sal_uInt32
, bool bExtra
);
58 RscBaseCont( Atom nId
, sal_uInt32 nTypId
,
59 RscTop
* pSuper
= NULL
,
61 virtual ~RscBaseCont();
62 virtual RSCCLASS_TYPE
GetClassType() const SAL_OVERRIDE
;
63 void SetTypeClass( RscTop
* pClass
, RscTop
* pClass1
= NULL
)
66 pTypeClass1
= pClass1
;
68 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, bool ) SAL_OVERRIDE
;
69 void Destroy( const RSCINST
& rInst
) SAL_OVERRIDE
;
70 ERRTYPE
GetElement( const RSCINST
& rInst
, const RscId
& rEleName
,
71 RscTop
* pCreateClass
, const RSCINST
& rCreateInst
,
72 RSCINST
* pGetInst
) SAL_OVERRIDE
;
73 RSCINST
SearchEle( const RSCINST
& rInst
, const RscId
& rEleName
,
74 RscTop
* pClass
) SAL_OVERRIDE
;
75 sal_uInt32
GetCount( const RSCINST
& rInst
) SAL_OVERRIDE
;
76 RSCINST
GetPosEle( const RSCINST
& rInst
, sal_uInt32 nPos
) SAL_OVERRIDE
;
77 ERRTYPE
MovePosEle( const RSCINST
& rInst
, sal_uInt32 nDestPos
,
78 sal_uInt32 nSourcePos
) SAL_OVERRIDE
;
79 virtual ERRTYPE
SetPosRscId( const RSCINST
& rInst
, sal_uInt32 nPos
,
80 const RscId
& rRscId
) SAL_OVERRIDE
;
81 SUBINFO_STRUCT
GetInfoEle( const RSCINST
& rInst
, sal_uInt32 nPos
) SAL_OVERRIDE
;
82 ERRTYPE
SetString( const RSCINST
&, const char * pStr
) SAL_OVERRIDE
;
83 ERRTYPE
SetNumber( const RSCINST
&, sal_Int32 lValue
) SAL_OVERRIDE
;
84 ERRTYPE
SetBool( const RSCINST
& rInst
, bool bValue
) SAL_OVERRIDE
;
85 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
86 sal_Int32 nValue
) SAL_OVERRIDE
;
87 ERRTYPE
SetRef( const RSCINST
& rInst
, const RscId
& rRefId
) SAL_OVERRIDE
;
89 // Gibt die Groesse der Klasse in Bytes
90 sal_uInt32
Size() SAL_OVERRIDE
{ return nSize
; }
92 bool IsConsistent( const RSCINST
& rInst
) SAL_OVERRIDE
;
93 void SetToDefault( const RSCINST
& rInst
) SAL_OVERRIDE
;
94 bool IsDefault( const RSCINST
& rInst
) SAL_OVERRIDE
;
95 bool IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
) SAL_OVERRIDE
;
97 void Delete( const RSCINST
& rInst
, RscTop
* pClass
,
98 const RscId
& rId
) SAL_OVERRIDE
;
99 void DeletePos( const RSCINST
& rInst
, sal_uInt32 nPos
) SAL_OVERRIDE
;
101 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
102 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * ) SAL_OVERRIDE
;
103 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
104 RscTypCont
* pTC
, sal_uInt32
, bool bExtra
) SAL_OVERRIDE
;
107 class RscContWriteSrc
: public RscBaseCont
110 RscContWriteSrc( Atom nId
, sal_uInt32 nTypId
,
111 RscTop
* pSuper
= NULL
,
113 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
114 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * ) SAL_OVERRIDE
;
117 class RscCont
: public RscContWriteSrc
120 RscCont( Atom nId
, sal_uInt32 nTypId
,
121 RscTop
* pSuper
= NULL
,
123 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
124 RscTypCont
* pTC
, sal_uInt32
, bool bExtra
) SAL_OVERRIDE
;
127 class RscContExtraData
: public RscContWriteSrc
130 RscContExtraData( Atom nId
, sal_uInt32 nTypId
,
131 RscTop
* pSuper
= NULL
,
133 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
134 RscTypCont
* pTC
, sal_uInt32
, bool bExtra
) SAL_OVERRIDE
;
137 #endif // INCLUDED_RSC_INC_RSCCONT_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */