Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _RSCCLASS_HXX
20 : #define _RSCCLASS_HXX
21 :
22 : #include <rscall.h>
23 : #include <rscerror.h>
24 : #include <rschash.hxx>
25 : #include <rsctop.hxx>
26 :
27 : /******************* R s c C l a s s *************************************/
28 : class RscClass : public RscTop
29 : {
30 : protected:
31 : struct RscClassInst{
32 : sal_uLong nVarDflt;
33 : };
34 : struct VARTYPE_STRUCT {
35 : Atom nVarName; // Variablenname
36 : RSCVAR nVarType; // Variablentyp
37 : sal_uInt32 nMask; // Maskierungsbit
38 : sal_uInt32 nOffset; // Beginn der Instanzdaten
39 : RscTop * pClass; // Klasse
40 : CLASS_DATA pDefault; // Zeiger auf DefaultDaten
41 : Atom nDataBaseName;//Name fuer Fremddatenbereich
42 : };
43 : sal_uInt32 nSuperSize; // Groesse der Instanzdaten der SuperKl.
44 : sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse
45 : // mit Superklassen
46 : sal_uInt32 nEntries; // Eintraege in pVarTypeList
47 : VARTYPE_STRUCT * pVarTypeList; // Variablenliste
48 : RSCINST GetInstData( CLASS_DATA pData, sal_uInt32 nEle,
49 : sal_Bool bGetCopy = sal_False );
50 : CLASS_DATA GetDfltData( sal_uInt32 nEle );
51 : sal_Bool IsDflt( CLASS_DATA pData, sal_uInt32 nEle );
52 : sal_Bool IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle );
53 : void SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle,
54 : sal_Bool bSet );
55 : sal_Int32 GetCorrectValues( const RSCINST & rInst, sal_uInt32 nVarPos,
56 : sal_uInt32 nTupelIdx, RscTypCont * pTC );
57 : public:
58 : RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl );
59 : ~RscClass();
60 :
61 : virtual RSCCLASS_TYPE GetClassType() const;
62 :
63 : void Pre_dtor();
64 : ERRTYPE SetVariable( Atom nVarName, RscTop * pClass,
65 : RSCINST * pDflt,
66 : RSCVAR nVarType, sal_uInt32 nMask,
67 : Atom nDataBaseName );
68 : virtual void EnumVariables( void * pData, VarEnumCallbackProc );
69 : RSCINST GetVariable( const RSCINST & rInst, Atom nVarName,
70 : const RSCINST & rInitInst,
71 : sal_Bool nInitDflt = sal_False,
72 : RscTop * pCreateClass = NULL );
73 : RSCINST GetCopyVar( const RSCINST & rInst, Atom nVarName );
74 :
75 : // Gibt die Groesse der Klasse in Bytes
76 341333 : sal_uInt32 Size(){ return( nSize ); };
77 :
78 : sal_Bool IsConsistent( const RSCINST & rInst );
79 : void SetToDefault( const RSCINST & rInst );
80 : sal_Bool IsDefault( const RSCINST & rInst );
81 : sal_Bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
82 : void SetDefault( const RSCINST & rData, Atom nVarId );
83 : using RscTop::GetDefault;
84 : RSCINST GetDefault( Atom nVarId );
85 :
86 : RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, sal_Bool );
87 : void Destroy( const RSCINST & rInst );
88 : void WriteSrc( const RSCINST & rInst, FILE * fOutput,
89 : RscTypCont * pTC, sal_uInt32 nTab, const char * );
90 : ERRTYPE WriteInstRc( const RSCINST & rInst, RscWriteRc & aMem,
91 : RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
92 : ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
93 : RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
94 : void WriteSyntax( FILE * fOutput, RscTypCont * pTC );
95 :
96 : void WriteRcAccess( FILE * fOutput, RscTypCont * pTC,
97 : const char * );
98 : void WriteRcCtor( FILE * fOutput, RscTypCont * pTC );
99 : };
100 :
101 1382 : class RscSysDepend : public RscClass
102 : {
103 : public:
104 : RscSysDepend( Atom nId, sal_uInt32 nTypId, RscTop * pSuper );
105 : ERRTYPE WriteSysDependRc( const RSCINST &, RscWriteRc & aMem,
106 : RscTypCont * pTC, sal_uInt32, sal_Bool bExtra,
107 : sal_Bool bFirst = sal_False );
108 : ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem,
109 : RscTypCont * pTC, sal_uInt32, sal_Bool bExtra );
110 : };
111 :
112 4146 : class RscTupel : public RscClass
113 : {
114 : public:
115 : RscTupel( Atom nId, sal_uInt32 nTypId, RscTop * pSuper );
116 : RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos,
117 : const RSCINST & rInitInst );
118 : void WriteSrc( const RSCINST & rInst, FILE * fOutput,
119 : RscTypCont * pTC, sal_uInt32 nTab, const char * );
120 : };
121 :
122 : #endif //_RSCCLASS_HXX
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|