1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: rscclobj.hxx,v $
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 ************************************************************************/
33 #include <rsctree.hxx>
37 /****************** C L A S S E S ****************************************/
40 /*********** R s c I n c o n s i s t e n t *******************************/
41 class RscInconsistent
{
43 RscId aFirstId
; //Paar von inkonsistenten Id's
45 RscInconsistent( const RscId
& rFirst
, const RscId
& rSecond
){
51 DECLARE_LIST( RscInconsList
, RscInconsistent
* )
53 /******************* O b j N o d e ***************************************/
54 class ObjNode
: public IdNode
{
55 RscId aRscId
; // Id der Resource
56 CLASS_DATA pRscObj
;// pointer to a resourceobject
57 ULONG lFileKey
;// Dateischluessel
59 using NameNode::Search
;
62 using NameNode::Insert
;
64 ObjNode( const RscId
& rId
, CLASS_DATA pData
, ULONG lKey
);
65 ObjNode
* DelObjNode( RscTop
* pClass
, ULONG lFileKey
);
66 sal_uInt32
GetId() const;
67 RscId
GetRscId(){ return( aRscId
); }
68 ULONG
GetFileKey(){ return lFileKey
; };
69 ObjNode
* Search( const RscId
&rName
) const{
70 // search the index in the b-tree
71 return( (ObjNode
*)IdNode::Search( rName
) );
73 BOOL
Insert( ObjNode
* pTN
){
74 // insert a new node in the b-tree
75 return( IdNode::Insert( (IdNode
*)pTN
) );
77 CLASS_DATA
GetRscObj(){
78 // get the Object from this Node
81 BOOL
IsConsistent( RscInconsList
* pList
= NULL
);
84 /******************* R e f N o d e ***************************************/
85 class RefNode
: public IdNode
{
86 Atom nTypNameId
; // index of a Name in a hashtabel
88 using NameNode::Search
;
91 using NameNode::Insert
;
93 ObjNode
* pObjBiTree
; // Zeiger auf Objektbaum
95 sal_uInt32
GetId() const;
96 RefNode
* Search( Atom typ
) const{
97 // search the index in the b-tree
98 return( (RefNode
*)IdNode::Search( typ
) );
100 BOOL
Insert( RefNode
* pTN
){
101 // insert a new node in the b-tree
102 return( IdNode::Insert( (IdNode
*)pTN
) );
104 BOOL
PutObjNode( ObjNode
* pPutObject
);
106 // insert new node in b-tree pObjBiTree
107 ObjNode
* GetObjNode( const RscId
&rRscId
);
109 ObjNode
* GetObjNode(){
111 return( pObjBiTree
);
115 #endif // _RSCCLOBJ_HXX