xref: /aoo42x/main/rsc/inc/rscclass.hxx (revision f7c60c9c)
1*f7c60c9cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f7c60c9cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f7c60c9cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f7c60c9cSAndrew Rist  * distributed with this work for additional information
6*f7c60c9cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f7c60c9cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f7c60c9cSAndrew Rist  * "License"); you may not use this file except in compliance
9*f7c60c9cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f7c60c9cSAndrew Rist  *
11*f7c60c9cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f7c60c9cSAndrew Rist  *
13*f7c60c9cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f7c60c9cSAndrew Rist  * software distributed under the License is distributed on an
15*f7c60c9cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f7c60c9cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*f7c60c9cSAndrew Rist  * specific language governing permissions and limitations
18*f7c60c9cSAndrew Rist  * under the License.
19*f7c60c9cSAndrew Rist  *
20*f7c60c9cSAndrew Rist  *************************************************************/
21*f7c60c9cSAndrew Rist 
22*f7c60c9cSAndrew Rist 
23cdf0e10cSrcweir #ifndef _RSCCLASS_HXX
24cdf0e10cSrcweir #define _RSCCLASS_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <rscall.h>
27cdf0e10cSrcweir #include <rscerror.h>
28cdf0e10cSrcweir #include <rschash.hxx>
29cdf0e10cSrcweir #include <rsctop.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir /******************* R s c C l a s s *************************************/
32cdf0e10cSrcweir class RscClass : public RscTop
33cdf0e10cSrcweir {
34cdf0e10cSrcweir protected:
35cdf0e10cSrcweir     struct RscClassInst{
36cdf0e10cSrcweir         sal_uLong   nVarDflt;
37cdf0e10cSrcweir     };
38cdf0e10cSrcweir     struct VARTYPE_STRUCT {
39cdf0e10cSrcweir         Atom            nVarName;   // Variablenname
40cdf0e10cSrcweir         RSCVAR          nVarType;   // Variablentyp
41cdf0e10cSrcweir         sal_uInt32      nMask;      // Maskierungsbit
42cdf0e10cSrcweir         sal_uInt32      nOffset;    // Beginn der Instanzdaten
43cdf0e10cSrcweir         RscTop *        pClass;     // Klasse
44cdf0e10cSrcweir         CLASS_DATA      pDefault;   // Zeiger auf DefaultDaten
45cdf0e10cSrcweir         Atom            nDataBaseName;//Name fuer Fremddatenbereich
46cdf0e10cSrcweir     };
47cdf0e10cSrcweir     sal_uInt32              nSuperSize; // Groesse der Instanzdaten der SuperKl.
48cdf0e10cSrcweir     sal_uInt32              nSize;      // Groesse der Instanzdaten dieser Klasse
49cdf0e10cSrcweir                                     // mit Superklassen
50cdf0e10cSrcweir     sal_uInt32              nEntries;   // Eintraege in pVarTypeList
51cdf0e10cSrcweir     VARTYPE_STRUCT *    pVarTypeList;   // Variablenliste
52cdf0e10cSrcweir     RSCINST             GetInstData( CLASS_DATA pData, sal_uInt32 nEle,
53cdf0e10cSrcweir                                      sal_Bool bGetCopy = sal_False );
54cdf0e10cSrcweir     CLASS_DATA          GetDfltData( sal_uInt32 nEle );
55cdf0e10cSrcweir     sal_Bool                IsDflt( CLASS_DATA pData, sal_uInt32 nEle );
56cdf0e10cSrcweir     sal_Bool                IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle );
57cdf0e10cSrcweir     void                SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle,
58cdf0e10cSrcweir                                     sal_Bool bSet );
59cdf0e10cSrcweir     sal_Int32               GetCorrectValues( const RSCINST & rInst, sal_uInt32 nVarPos,
60cdf0e10cSrcweir                                         sal_uInt32 nTupelIdx, RscTypCont * pTC );
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir                     RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
63cdf0e10cSrcweir                     ~RscClass();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir     virtual RSCCLASS_TYPE   GetClassType() const;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir     void            Pre_dtor();
68cdf0e10cSrcweir     ERRTYPE         SetVariable( Atom nVarName, RscTop * pClass,
69cdf0e10cSrcweir                                  RSCINST * pDflt,
70cdf0e10cSrcweir                                  RSCVAR nVarType, sal_uInt32 nMask,
71cdf0e10cSrcweir                                  Atom nDataBaseName );
72cdf0e10cSrcweir     virtual void    EnumVariables( void * pData, VarEnumCallbackProc );
73cdf0e10cSrcweir     RSCINST         GetVariable( const RSCINST & rInst, Atom nVarName,
74cdf0e10cSrcweir                                  const RSCINST & rInitInst,
75cdf0e10cSrcweir                                  sal_Bool nInitDflt = sal_False,
76cdf0e10cSrcweir 								 RscTop * pCreateClass = NULL );
77cdf0e10cSrcweir     RSCINST         GetCopyVar( const RSCINST & rInst, Atom nVarName );
78cdf0e10cSrcweir 
79cdf0e10cSrcweir                     // Gibt die Groesse der Klasse in Bytes
Size()80cdf0e10cSrcweir     sal_uInt32          Size(){ return( nSize ); };
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     sal_Bool            IsConsistent( const RSCINST & rInst, RscInconsList * pList );
83cdf0e10cSrcweir     void            SetToDefault( const RSCINST & rInst );
84cdf0e10cSrcweir     sal_Bool            IsDefault( const RSCINST & rInst );
85cdf0e10cSrcweir     sal_Bool            IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
86cdf0e10cSrcweir     void            SetDefault( const RSCINST & rData, Atom nVarId );
87cdf0e10cSrcweir     using RscTop::GetDefault;
88cdf0e10cSrcweir     RSCINST         GetDefault( Atom nVarId );
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     RSCINST         Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
91cdf0e10cSrcweir     void            Destroy( const RSCINST & rInst );
92cdf0e10cSrcweir     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
93cdf0e10cSrcweir                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
94cdf0e10cSrcweir     ERRTYPE         WriteInstRc( const RSCINST & rInst, RscWriteRc & aMem,
95cdf0e10cSrcweir                                  RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
96cdf0e10cSrcweir     ERRTYPE         WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
97cdf0e10cSrcweir                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
98cdf0e10cSrcweir     void            WriteSyntax( FILE * fOutput, RscTypCont * pTC );
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	void			WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
101cdf0e10cSrcweir 								const char * );
102cdf0e10cSrcweir 	void			WriteRcCtor( FILE * fOutput, RscTypCont * pTC );
103cdf0e10cSrcweir };
104cdf0e10cSrcweir 
105cdf0e10cSrcweir class RscSysDepend : public RscClass
106cdf0e10cSrcweir {
107cdf0e10cSrcweir public:
108cdf0e10cSrcweir                     RscSysDepend( Atom nId, sal_uInt32 nTypId, RscTop * pSuper );
109cdf0e10cSrcweir     ERRTYPE         WriteSysDependRc( const RSCINST &, RscWriteRc & aMem,
110cdf0e10cSrcweir                                     RscTypCont * pTC, sal_uInt32, sal_Bool bExtra,
111cdf0e10cSrcweir                                     sal_Bool bFirst = sal_False );
112cdf0e10cSrcweir     ERRTYPE         WriteRc( const RSCINST &, RscWriteRc & aMem,
113cdf0e10cSrcweir                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
114cdf0e10cSrcweir };
115cdf0e10cSrcweir 
116cdf0e10cSrcweir class RscFirstSysDepend : public RscSysDepend
117cdf0e10cSrcweir {
118cdf0e10cSrcweir public:
119cdf0e10cSrcweir                     RscFirstSysDepend( Atom nId, sal_uInt32 nTypId,
120cdf0e10cSrcweir                                         RscTop * pSuper );
121cdf0e10cSrcweir     ERRTYPE         WriteRc( const RSCINST &, RscWriteRc & aMem,
122cdf0e10cSrcweir                              RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
123cdf0e10cSrcweir };
124cdf0e10cSrcweir 
125cdf0e10cSrcweir class RscTupel : public RscClass
126cdf0e10cSrcweir {
127cdf0e10cSrcweir public:
128cdf0e10cSrcweir     RscTupel( Atom nId, sal_uInt32 nTypId, RscTop * pSuper );
129cdf0e10cSrcweir     RSCINST         GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos,
130cdf0e10cSrcweir                                 const RSCINST & rInitInst );
131cdf0e10cSrcweir     void            WriteSrc( const RSCINST & rInst, FILE * fOutput,
132cdf0e10cSrcweir                               RscTypCont * pTC, sal_uInt32 nTab, const char * );
133cdf0e10cSrcweir };
134cdf0e10cSrcweir 
135cdf0e10cSrcweir #endif //_RSCCLASS_HXX
136