1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
25 RscTop::RscTop( Atom nId
, sal_uInt32 nTypIdent
, RscTop
* pSuperCl
)
27 , pSuperClass( pSuperCl
)
32 SetCallPar( pSuperClass
->aCallPar1
, pSuperClass
->aCallPar2
,
33 pSuperClass
->aCallParType
);
36 void RscTop::SetCallPar(const OString
& rPar1
, const OString
& rPar2
,
37 const OString
& rParType
)
41 aCallParType
= rParType
;
44 RSCINST
RscTop::GetDefault()
46 if( !aDfltInst
.IsInst() )
47 aDfltInst
= this->Create( NULL
, RSCINST() );
51 void RscTop :: Pre_dtor()
53 if( aDfltInst
.IsInst() )
55 aDfltInst
.pClass
->Destroy( aDfltInst
);
56 rtl_freeMemory( aDfltInst
.pData
);
57 aDfltInst
= RSCINST();
61 Atom
RscTop :: GetConstant( sal_uInt32
)
66 RscTop
* RscTop::GetTypeClass() const
69 return pSuperClass
->GetTypeClass();
74 sal_uInt32
RscTop :: Size()
77 return pSuperClass
->Size();
82 ERRTYPE
RscTop :: GetRef( const RSCINST
& rInst
, RscId
* pRscId
)
85 return pSuperClass
->GetRef( rInst
, pRscId
);
87 return ERR_UNKNOWN_METHOD
;
90 bool RscTop::InHierarchy( RscTop
* pClass
)
95 return pSuperClass
->InHierarchy( pClass
);
99 ERRTYPE
RscTop::SetVariable( Atom nVarName
, RscTop
* pClass
,
100 RSCINST
* pDflt
, RSCVAR nVarType
, sal_uInt32 nMask
,
104 return pSuperClass
->SetVariable( nVarName
, pClass
, pDflt
,
105 nVarType
, nMask
, nDataBaseName
);
107 return ERR_UNKNOWN_METHOD
;
110 void RscTop::EnumVariables( void * pData
, VarEnumCallbackProc pProc
)
113 pSuperClass
->EnumVariables( pData
, pProc
);
116 RSCINST
RscTop::GetVariable( const RSCINST
& rInst
,
118 const RSCINST
& rInitInst
,
120 RscTop
* pCreateClass
)
123 return pSuperClass
->GetVariable( rInst
, nVarName
, rInitInst
, bInitDflt
, pCreateClass
);
128 RSCINST
RscTop::GetCopyVar( const RSCINST
& rInst
, Atom nVarName
)
131 return pSuperClass
->GetCopyVar( rInst
, nVarName
);
136 RSCINST
RscTop::GetTupelVar( const RSCINST
& rInst
, sal_uInt32 nPos
,
137 const RSCINST
& rInitInst
)
140 return pSuperClass
->GetTupelVar( rInst
, nPos
, rInitInst
);
145 ERRTYPE
RscTop::GetElement( const RSCINST
& rInst
, const RscId
& rEleName
,
146 RscTop
*pCreateClass
, const RSCINST
& rCreateInst
,
150 return pSuperClass
-> GetElement( rInst
, rEleName
,
151 pCreateClass
, rCreateInst
,
154 return ERR_UNKNOWN_METHOD
;
157 ERRTYPE
RscTop::GetArrayEle( const RSCINST
& rInst
,
159 RscTop
* pCreateClass
,
163 return pSuperClass
->GetArrayEle( rInst
, nId
, pCreateClass
, pGetInst
);
165 return ERR_UNKNOWN_METHOD
;
168 ERRTYPE
RscTop::GetValueEle( const RSCINST
& rInst
,
170 RscTop
* pCreateClass
,
174 return pSuperClass
->GetValueEle( rInst
, lValue
, pCreateClass
, pGetInst
);
176 return ERR_UNKNOWN_METHOD
;
179 RSCINST
RscTop::SearchEle( const RSCINST
& rInst
, const RscId
& rEleName
,
183 return pSuperClass
->SearchEle( rInst
, rEleName
, pClass
);
188 RSCINST
RscTop::GetPosEle( const RSCINST
& rInst
, sal_uInt32 nPos
)
191 return pSuperClass
->GetPosEle( rInst
, nPos
);
196 ERRTYPE
RscTop::MovePosEle( const RSCINST
& rInst
, sal_uInt32 nDestPos
,
197 sal_uInt32 nSourcePos
)
200 return pSuperClass
->MovePosEle( rInst
, nDestPos
, nSourcePos
);
202 return ERR_UNKNOWN_METHOD
;
205 ERRTYPE
RscTop::SetPosRscId( const RSCINST
& rInst
, sal_uInt32 nPos
,
206 const RscId
& rRscId
)
209 return pSuperClass
->SetPosRscId( rInst
, nPos
, rRscId
);
211 return ERR_UNKNOWN_METHOD
;
214 SUBINFO_STRUCT
RscTop::GetInfoEle( const RSCINST
& rInst
, sal_uInt32 nPos
)
217 return pSuperClass
->GetInfoEle( rInst
, nPos
);
219 return SUBINFO_STRUCT();
222 sal_uInt32
RscTop::GetCount( const RSCINST
& rInst
)
225 return pSuperClass
->GetCount( rInst
);
230 ERRTYPE
RscTop::SetNumber( const RSCINST
& rInst
, sal_Int32 lValue
)
233 return pSuperClass
->SetNumber( rInst
, lValue
);
235 return ERR_UNKNOWN_METHOD
;
238 ERRTYPE
RscTop::SetBool( const RSCINST
& rInst
, bool bValue
)
241 return pSuperClass
->SetBool( rInst
, bValue
);
243 return ERR_UNKNOWN_METHOD
;
246 ERRTYPE
RscTop::SetConst( const RSCINST
& rInst
, Atom nId
, sal_Int32 nVal
)
249 return pSuperClass
->SetConst( rInst
, nId
, nVal
);
251 return ERR_UNKNOWN_METHOD
;
254 ERRTYPE
RscTop::SetNotConst( const RSCINST
& rInst
, Atom nId
)
257 return pSuperClass
->SetNotConst( rInst
, nId
);
259 return ERR_UNKNOWN_METHOD
;
262 ERRTYPE
RscTop::SetString( const RSCINST
& rInst
, const char * pStr
)
265 return pSuperClass
->SetString( rInst
, pStr
);
267 return ERR_UNKNOWN_METHOD
;
270 ERRTYPE
RscTop::GetNumber( const RSCINST
& rInst
, sal_Int32
* pN
)
273 return pSuperClass
->GetNumber( rInst
, pN
);
275 return ERR_UNKNOWN_METHOD
;
278 ERRTYPE
RscTop::GetBool( const RSCINST
& rInst
, bool * pB
)
281 return pSuperClass
->GetBool( rInst
, pB
);
283 return ERR_UNKNOWN_METHOD
;
286 ERRTYPE
RscTop::GetConst( const RSCINST
& rInst
, Atom
* pH
)
289 return pSuperClass
->GetConst( rInst
, pH
);
291 return ERR_UNKNOWN_METHOD
;
294 ERRTYPE
RscTop::GetString( const RSCINST
& rInst
, char ** ppStr
)
297 return pSuperClass
->GetString( rInst
, ppStr
);
299 return ERR_UNKNOWN_METHOD
;
302 RSCINST
RscTop::Create( RSCINST
* pInst
, const RSCINST
& rDefInst
, bool bOwnRange
)
305 return pSuperClass
->Create( pInst
, rDefInst
, bOwnRange
);
314 void RscTop::Destroy( const RSCINST
& rInst
)
317 pSuperClass
->Destroy( rInst
);
320 bool RscTop::IsConsistent( const RSCINST
& rInst
)
323 return pSuperClass
->IsConsistent( rInst
);
328 void RscTop::SetToDefault( const RSCINST
& rInst
)
331 pSuperClass
->SetToDefault( rInst
);
334 bool RscTop::IsDefault( const RSCINST
& rInst
)
337 return pSuperClass
->IsDefault( rInst
);
342 bool RscTop::IsValueDefault( const RSCINST
& rInst
, CLASS_DATA pDef
)
345 return pSuperClass
->IsValueDefault( rInst
, pDef
);
350 void RscTop::SetDefault( const RSCINST
& rInst
, Atom nVarId
)
353 pSuperClass
->SetDefault( rInst
, nVarId
);
356 RSCINST
RscTop::GetDefault( Atom nVarId
)
359 return pSuperClass
->GetDefault( nVarId
);
364 void RscTop::Delete( const RSCINST
& rInst
, RscTop
* pClass
,
368 pSuperClass
->Delete( rInst
, pClass
, rId
);
371 void RscTop::DeletePos( const RSCINST
& rInst
, sal_uInt32 nPos
)
374 pSuperClass
->DeletePos( rInst
, nPos
);
377 ERRTYPE
RscTop::SetRef( const RSCINST
& rInst
, const RscId
& rRefId
)
380 return pSuperClass
->SetRef( rInst
, rRefId
);
382 return ERR_UNKNOWN_METHOD
;
385 void RscTop::WriteSrcHeader( const RSCINST
& rInst
, FILE * fOutput
,
386 RscTypCont
* pTC
, sal_uInt32 nTab
,
387 const RscId
& rId
, const char * pVarName
)
390 pSuperClass
->WriteSrcHeader( rInst
, fOutput
, pTC
, nTab
, rId
, pVarName
);
392 rInst
.pClass
->WriteSrc( rInst
, fOutput
, pTC
, nTab
, pVarName
);
395 void RscTop::WriteSrc( const RSCINST
& rInst
, FILE * fOutput
,
396 RscTypCont
* pTC
, sal_uInt32 nTab
, const char * pVarName
)
399 pSuperClass
->WriteSrc( rInst
, fOutput
, pTC
, nTab
, pVarName
);
402 ERRTYPE
RscTop::WriteRcHeader( const RSCINST
& rInst
, RscWriteRc
& rMem
,
403 RscTypCont
* pTC
, const RscId
& rId
,
404 sal_uInt32 nDeep
, bool bExtra
)
407 return pSuperClass
->WriteRcHeader( rInst
, rMem
, pTC
, rId
, nDeep
, bExtra
);
409 return rInst
.pClass
->WriteRc( rInst
, rMem
, pTC
, nDeep
, bExtra
);
412 ERRTYPE
RscTop::WriteRc( const RSCINST
& rInst
, RscWriteRc
& rMem
,
413 RscTypCont
* pTC
, sal_uInt32 nDeep
, bool bExtra
)
416 return pSuperClass
->WriteRc( rInst
, rMem
, pTC
, nDeep
, bExtra
);
421 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */