Update ooo320-m1
[ooovba.git] / rsc / inc / rscclass.hxx
blobe16bd15ddc407a2705b806a860f06105e654ef32
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscclass.hxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
30 #ifndef _RSCCLASS_HXX
31 #define _RSCCLASS_HXX
33 #include <rscall.h>
34 #include <rscerror.h>
35 #include <rschash.hxx>
36 #include <rsctop.hxx>
38 /******************* R s c C l a s s *************************************/
39 class RscClass : public RscTop
41 protected:
42 struct RscClassInst{
43 ULONG nVarDflt;
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
56 // mit Superklassen
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,
65 BOOL bSet );
66 INT32 GetCorrectValues( const RSCINST & rInst, sal_uInt32 nVarPos,
67 sal_uInt32 nTupelIdx, RscTypCont * pTC );
68 public:
69 RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
70 ~RscClass();
72 virtual RSCCLASS_TYPE GetClassType() const;
74 void Pre_dtor();
75 ERRTYPE SetVariable( Atom nVarName, RscTop * pClass,
76 RSCINST * pDflt,
77 RSCVAR nVarType, sal_uInt32 nMask,
78 Atom nDataBaseName );
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,
108 const char * );
109 void WriteRcCtor( FILE * fOutput, RscTypCont * pTC );
112 class RscSysDepend : public RscClass
114 public:
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
125 public:
126 RscFirstSysDepend( Atom nId, sal_uInt32 nTypId,
127 RscTop * pSuper );
128 ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
129 RscTypCont * pTC, sal_uInt32, BOOL bExtra );
132 class RscTupel : public RscClass
134 public:
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