1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscclass.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
35 #include <rschash.hxx>
38 /******************* R s c C l a s s *************************************/
39 class RscClass
: public RscTop
45 struct VARTYPE_STRUCT
{
46 Atom nVarName
; // Variablenname
47 RSCVAR nVarType
; // Variablentyp
48 sal_uInt32 nMask
; // Maskierungsbit
49 sal_uInt32 nOffset
; // Beginn der Instanzdaten
50 RscTop
* pClass
; // Klasse
51 CLASS_DATA pDefault
; // Zeiger auf DefaultDaten
52 Atom nDataBaseName
;//Name fuer Fremddatenbereich
54 sal_uInt32 nSuperSize
; // Groesse der Instanzdaten der SuperKl.
55 sal_uInt32 nSize
; // Groesse der Instanzdaten dieser Klasse
57 sal_uInt32 nEntries
; // Eintraege in pVarTypeList
58 VARTYPE_STRUCT
* pVarTypeList
; // Variablenliste
59 RSCINST
GetInstData( CLASS_DATA pData
, sal_uInt32 nEle
,
60 BOOL bGetCopy
= FALSE
);
61 CLASS_DATA
GetDfltData( sal_uInt32 nEle
);
62 BOOL
IsDflt( CLASS_DATA pData
, sal_uInt32 nEle
);
63 BOOL
IsValueDflt( CLASS_DATA pData
, sal_uInt32 nEle
);
64 void SetVarDflt( CLASS_DATA pData
, sal_uInt32 nEle
,
66 INT32
GetCorrectValues( const RSCINST
& rInst
, sal_uInt32 nVarPos
,
67 sal_uInt32 nTupelIdx
, RscTypCont
* pTC
);
69 RscClass( Atom nId
, sal_uInt32 nTypId
, RscTop
* pSuperCl
);
72 virtual RSCCLASS_TYPE
GetClassType() const;
75 ERRTYPE
SetVariable( Atom nVarName
, RscTop
* pClass
,
77 RSCVAR nVarType
, sal_uInt32 nMask
,
79 virtual void EnumVariables( void * pData
, VarEnumCallbackProc
);
80 RSCINST
GetVariable( const RSCINST
& rInst
, Atom nVarName
,
81 const RSCINST
& rInitInst
,
82 BOOL nInitDflt
= FALSE
,
83 RscTop
* pCreateClass
= NULL
);
84 RSCINST
GetCopyVar( const RSCINST
& rInst
, Atom nVarName
);
86 // Gibt die Groesse der Klasse in Bytes
87 sal_uInt32
Size(){ return( nSize
); };
89 BOOL
IsConsistent( const RSCINST
& rInst
, RscInconsList
* pList
);
90 void SetToDefault( const RSCINST
& rInst
);
91 BOOL
IsDefault( const RSCINST
& rInst
);
92 BOOL
IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
);
93 void SetDefault( const RSCINST
& rData
, Atom nVarId
);
94 using RscTop::GetDefault
;
95 RSCINST
GetDefault( Atom nVarId
);
97 RSCINST
Create( RSCINST
* pInst
, const RSCINST
& rDflt
, BOOL
);
98 void Destroy( const RSCINST
& rInst
);
99 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
100 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
101 ERRTYPE
WriteInstRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
102 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
103 ERRTYPE
WriteRc( const RSCINST
& rInst
, RscWriteRc
& aMem
,
104 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
105 void WriteSyntax( FILE * fOutput
, RscTypCont
* pTC
);
107 void WriteRcAccess( FILE * fOutput
, RscTypCont
* pTC
,
109 void WriteRcCtor( FILE * fOutput
, RscTypCont
* pTC
);
112 class RscSysDepend
: public RscClass
115 RscSysDepend( Atom nId
, sal_uInt32 nTypId
, RscTop
* pSuper
);
116 ERRTYPE
WriteSysDependRc( const RSCINST
&, RscWriteRc
& aMem
,
117 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
,
118 BOOL bFirst
= FALSE
);
119 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
120 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
123 class RscFirstSysDepend
: public RscSysDepend
126 RscFirstSysDepend( Atom nId
, sal_uInt32 nTypId
,
128 ERRTYPE
WriteRc( const RSCINST
&, RscWriteRc
& aMem
,
129 RscTypCont
* pTC
, sal_uInt32
, BOOL bExtra
);
132 class RscTupel
: public RscClass
135 RscTupel( Atom nId
, sal_uInt32 nTypId
, RscTop
* pSuper
);
136 RSCINST
GetTupelVar( const RSCINST
& rInst
, sal_uInt32 nPos
,
137 const RSCINST
& rInitInst
);
138 void WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
139 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * );
142 #endif //_RSCCLASS_HXX