1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
34 /******************* R s c B a s e C o n t *******************************/
38 void Create(){ aName
.Create(); aInst
= RSCINST(); }
41 struct RscBaseContInst
{
43 ENTRY_STRUCT
* pEntries
;
47 class RscBaseCont
: public RscTop
50 RscTop
* pTypeClass
; // Typ der Eintraege
51 RscTop
* pTypeClass1
;// Zwei verschiedene Typen moeglich
52 sal_Bool bNoId
; // Keine Identifier
53 sal_uInt32 nSize
; // Groesse der Instanzdaten dieser Klasse
55 sal_uInt32 nOffInstData
;// Offset auf eigen Instanzdaten
56 void DestroyElements( RscBaseContInst
* pClassData
);
57 RSCINST
SearchElePos( const RSCINST
& rInst
, const RscId
& rEleName
,
58 RscTop
* pClass
, sal_uInt32 nPos
);
60 void ContWriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
61 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
62 ERRTYPE
ContWriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
63 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
64 void ContWriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
65 const char *, sal_Bool nWriteSize
);
67 RscBaseCont( Atom nId
, sal_uInt32 nTypId
,
68 RscTop
* pSuper
= NULL
,
69 sal_Bool bNoId
= sal_True
);
71 virtual RSCCLASS_TYPE
GetClassType() const;
72 void SetTypeClass( RscTop
* pClass
, RscTop
* pClass1
= NULL
)
75 pTypeClass1
= pClass1
;
77 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, sal_Bool
);
78 void Destroy( const RSCINST
& rInst
);
79 ERRTYPE
GetElement( const RSCINST
& rInst
, const RscId
& rEleName
,
80 RscTop
* pCreateClass
, const RSCINST
& rCreateInst
,
82 RSCINST
SearchEle( const RSCINST
& rInst
, const RscId
& rEleName
,
84 sal_uInt32
GetCount( const RSCINST
& rInst
);
85 RSCINST
GetPosEle( const RSCINST
& rInst
, sal_uInt32 nPos
);
86 ERRTYPE
MovePosEle( const RSCINST
& rInst
, sal_uInt32 nDestPos
,
87 sal_uInt32 nSourcePos
);
88 virtual ERRTYPE
SetPosRscId( const RSCINST
& rInst
, sal_uInt32 nPos
,
89 const RscId
& rRscId
);
90 SUBINFO_STRUCT
GetInfoEle( const RSCINST
& rInst
, sal_uInt32 nPos
);
91 ERRTYPE
SetString( const RSCINST
&, const char * pStr
);
92 ERRTYPE
SetNumber( const RSCINST
&, sal_Int32 lValue
);
93 ERRTYPE
SetBool( const RSCINST
& rInst
, sal_Bool bValue
);
94 ERRTYPE
SetConst( const RSCINST
& rInst
, Atom nValueId
,
96 ERRTYPE
SetRef( const RSCINST
& rInst
, const RscId
& rRefId
);
98 // Gibt die Groesse der Klasse in Bytes
99 sal_uInt32
Size(){ return( nSize
); };
101 sal_Bool
IsConsistent( const RSCINST
& rInst
, RscInconsList
* pList
);
102 void SetToDefault( const RSCINST
& rInst
);
103 sal_Bool
IsDefault( const RSCINST
& rInst
);
104 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
106 void Delete( const RSCINST
& rInst
, RscTop
* pClass
,
108 void DeletePos( const RSCINST
& rInst
, sal_uInt32 nPos
);
110 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
111 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
112 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
113 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
114 ERRTYPE
WriteHxx( const RSCINST
& rInst
, FILE * fOutput
,
115 RscTypCont
* pTC
, const RscId
& rId
);
116 ERRTYPE
WriteCxx( const RSCINST
& rInst
, FILE * fOutput
,
117 RscTypCont
* pTC
, const RscId
&rId
);
120 /******************* R s c C o n t W r i t e S r c ***********************/
121 class RscContWriteSrc
: public RscBaseCont
124 RscContWriteSrc( Atom nId
, sal_uInt32 nTypId
,
125 RscTop
* pSuper
= NULL
,
126 sal_Bool bNoId
= sal_True
);
127 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
128 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
131 /******************* R s c C o n t ***************************************/
132 class RscCont
: public RscContWriteSrc
{
134 RscCont( Atom nId
, sal_uInt32 nTypId
,
135 RscTop
* pSuper
= NULL
,
136 sal_Bool bNoId
= sal_True
);
137 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
138 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
139 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
143 /******************* R s c C o n t E x t r a D a t a *********************/
144 class RscContExtraData
: public RscContWriteSrc
{
146 RscContExtraData( Atom nId
, sal_uInt32 nTypId
,
147 RscTop
* pSuper
= NULL
,
148 sal_Bool bNoId
= sal_True
);
149 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
150 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
153 #endif //_RSCCONT_HXX