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 ************************************************************************/
32 #include <rschash.hxx>
35 /******************* R s c C l a s s *************************************/
36 class RscClass
: public RscTop
42 struct VARTYPE_STRUCT
{
43 Atom nVarName
; // Variablenname
44 RSCVAR nVarType
; // Variablentyp
45 sal_uInt32 nMask
; // Maskierungsbit
46 sal_uInt32 nOffset
; // Beginn der Instanzdaten
47 RscTop
* pClass
; // Klasse
48 CLASS_DATA pDefault
; // Zeiger auf DefaultDaten
49 Atom nDataBaseName
;//Name fuer Fremddatenbereich
51 sal_uInt32 nSuperSize
; // Groesse der Instanzdaten der SuperKl.
52 sal_uInt32 nSize
; // Groesse der Instanzdaten dieser Klasse
54 sal_uInt32 nEntries
; // Eintraege in pVarTypeList
55 VARTYPE_STRUCT
* pVarTypeList
; // Variablenliste
56 RSCINST
GetInstData( CLASS_DATA pData
, sal_uInt32 nEle
,
57 sal_Bool bGetCopy
= sal_False
);
58 CLASS_DATA
GetDfltData( sal_uInt32 nEle
);
59 sal_Bool
IsDflt( CLASS_DATA pData
, sal_uInt32 nEle
);
60 sal_Bool
IsValueDflt( CLASS_DATA pData
, sal_uInt32 nEle
);
61 void SetVarDflt( CLASS_DATA pData
, sal_uInt32 nEle
,
63 sal_Int32
GetCorrectValues( const RSCINST
& rInst
, sal_uInt32 nVarPos
,
64 sal_uInt32 nTupelIdx
, RscTypCont
* pTC
);
66 RscClass( Atom nId
, sal_uInt32 nTypId
, RscTop
* pSuperCl
);
69 virtual RSCCLASS_TYPE
GetClassType() const;
72 ERRTYPE
SetVariable( Atom nVarName
, RscTop
* pClass
,
74 RSCVAR nVarType
, sal_uInt32 nMask
,
76 virtual void EnumVariables( void * pData
, VarEnumCallbackProc
);
77 RSCINST
GetVariable( const RSCINST
& rInst
, Atom nVarName
,
78 const RSCINST
& rInitInst
,
79 sal_Bool nInitDflt
= sal_False
,
80 RscTop
* pCreateClass
= NULL
);
81 RSCINST
GetCopyVar( const RSCINST
& rInst
, Atom nVarName
);
83 // Gibt die Groesse der Klasse in Bytes
84 sal_uInt32
Size(){ return( nSize
); };
86 sal_Bool
IsConsistent( const RSCINST
& rInst
, RscInconsList
* pList
);
87 void SetToDefault( const RSCINST
& rInst
);
88 sal_Bool
IsDefault( const RSCINST
& rInst
);
89 sal_Bool
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
90 void SetDefault( const RSCINST
& rData
, Atom nVarId
);
91 using RscTop::GetDefault
;
92 RSCINST
GetDefault( Atom nVarId
);
94 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, sal_Bool
);
95 void Destroy( const RSCINST
& rInst
);
96 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
97 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
98 ERRTYPE
WriteInstRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
99 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
100 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
101 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
102 void WriteSyntax( FILE * fOutput
, RscTypCont
* pTC
);
104 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
106 void WriteRcCtor( FILE * fOutput
, RscTypCont
* pTC
);
109 class RscSysDepend
: public RscClass
112 RscSysDepend( Atom nId
, sal_uInt32 nTypId
, RscTop
* pSuper
);
113 ERRTYPE
WriteSysDependRc( const RSCINST
&, RscWriteRc
& aMem
,
114 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
,
115 sal_Bool bFirst
= sal_False
);
116 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
117 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
120 class RscFirstSysDepend
: public RscSysDepend
123 RscFirstSysDepend( Atom nId
, sal_uInt32 nTypId
,
125 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
126 RscTypCont
* pTC
, sal_uInt32
, sal_Bool bExtra
);
129 class RscTupel
: public RscClass
132 RscTupel( Atom nId
, sal_uInt32 nTypId
, RscTop
* pSuper
);
133 RSCINST
GetTupelVar( const RSCINST
& rInst
, sal_uInt32 nPos
,
134 const RSCINST
& rInitInst
);
135 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
136 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
139 #endif //_RSCCLASS_HXX