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 _RSCCONT_HXX
20 : #define _RSCCONT_HXX
21 :
22 : #include <rscall.h>
23 : #include <rscerror.h>
24 : #include <rsctop.hxx>
25 :
26 0 : struct ENTRY_STRUCT
27 : {
28 : RscId aName;
29 : RSCINST aInst;
30 51808 : void Create(){ aName.Create(); aInst = RSCINST(); }
31 : void Destroy();
32 : };
33 : struct RscBaseContInst
34 : {
35 : sal_uInt32 nEntries;
36 : ENTRY_STRUCT * pEntries;
37 : bool bDflt;
38 : };
39 :
40 : class RscBaseCont : public RscTop
41 : {
42 : protected:
43 : RscTop * pTypeClass; // Typ der Eintraege
44 : RscTop * pTypeClass1;// Zwei verschiedene Typen moeglich
45 : bool bNoId; // Keine Identifier
46 : sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse
47 : // mit Superklassen
48 : sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten
49 : void DestroyElements( RscBaseContInst * pClassData );
50 : RSCINST SearchElePos( const RSCINST & rInst, const RscId & rEleName,
51 : RscTop * pClass, sal_uInt32 nPos );
52 : protected:
53 : void ContWriteSrc( const RSCINST & rInst, FILE * fOutput,
54 : RscTypCont * pTC, sal_uInt32 nTab, const char * );
55 : ERRTYPE ContWriteRc( const RSCINST & rInst, RscWriteRc & aMem,
56 : RscTypCont * pTC, sal_uInt32, bool bExtra );
57 : public:
58 : RscBaseCont( Atom nId, sal_uInt32 nTypId,
59 : RscTop * pSuper = NULL,
60 : bool bNoId = true );
61 : ~RscBaseCont();
62 : virtual RSCCLASS_TYPE GetClassType() const;
63 6886 : void SetTypeClass( RscTop * pClass, RscTop * pClass1 = NULL )
64 : {
65 6886 : pTypeClass = pClass;
66 6886 : pTypeClass1 = pClass1;
67 6886 : }
68 : RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, bool );
69 : void Destroy( const RSCINST & rInst );
70 : ERRTYPE GetElement( const RSCINST & rInst, const RscId & rEleName,
71 : RscTop * pCreateClass, const RSCINST & rCreateInst,
72 : RSCINST * pGetInst );
73 : RSCINST SearchEle( const RSCINST & rInst, const RscId & rEleName,
74 : RscTop * pClass );
75 : sal_uInt32 GetCount( const RSCINST & rInst );
76 : RSCINST GetPosEle( const RSCINST & rInst, sal_uInt32 nPos );
77 : ERRTYPE MovePosEle( const RSCINST & rInst, sal_uInt32 nDestPos,
78 : sal_uInt32 nSourcePos );
79 : virtual ERRTYPE SetPosRscId( const RSCINST & rInst, sal_uInt32 nPos,
80 : const RscId & rRscId);
81 : SUBINFO_STRUCT GetInfoEle( const RSCINST & rInst, sal_uInt32 nPos );
82 : ERRTYPE SetString( const RSCINST &, const char * pStr );
83 : ERRTYPE SetNumber( const RSCINST &, sal_Int32 lValue );
84 : ERRTYPE SetBool( const RSCINST & rInst, bool bValue );
85 : ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId,
86 : sal_Int32 nValue );
87 : ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId );
88 :
89 : // Gibt die Groesse der Klasse in Bytes
90 9803 : sal_uInt32 Size(){ return nSize; }
91 :
92 : bool IsConsistent( const RSCINST & rInst );
93 : void SetToDefault( const RSCINST & rInst );
94 : bool IsDefault( const RSCINST & rInst );
95 : bool IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef );
96 :
97 : void Delete( const RSCINST & rInst, RscTop * pClass,
98 : const RscId & rId );
99 : void DeletePos( const RSCINST & rInst, sal_uInt32 nPos );
100 :
101 : void WriteSrc( const RSCINST & rInst, FILE * fOutput,
102 : RscTypCont * pTC, sal_uInt32 nTab, const char * );
103 : ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
104 : RscTypCont * pTC, sal_uInt32 , bool bExtra);
105 : };
106 :
107 6260 : class RscContWriteSrc : public RscBaseCont
108 : {
109 : public:
110 : RscContWriteSrc( Atom nId, sal_uInt32 nTypId,
111 : RscTop * pSuper = NULL,
112 : bool bNoId = true );
113 : void WriteSrc( const RSCINST & rInst, FILE * fOutput,
114 : RscTypCont * pTC, sal_uInt32 nTab, const char * );
115 : };
116 :
117 11268 : class RscCont : public RscContWriteSrc
118 : {
119 : public:
120 : RscCont( Atom nId, sal_uInt32 nTypId,
121 : RscTop * pSuper = NULL,
122 : bool bNoId = true );
123 : ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
124 : RscTypCont * pTC, sal_uInt32, bool bExtra );
125 : };
126 :
127 1252 : class RscContExtraData : public RscContWriteSrc
128 : {
129 : public:
130 : RscContExtraData( Atom nId, sal_uInt32 nTypId,
131 : RscTop * pSuper = NULL,
132 : bool bNoId = true );
133 : ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem,
134 : RscTypCont * pTC, sal_uInt32, bool bExtra );
135 : };
136 :
137 : #endif //_RSCCONT_HXX
138 :
139 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|