1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _RSCCLOBJ_HXX 28 #define _RSCCLOBJ_HXX 29 30 #include <rsctree.hxx> 31 #include <rscdef.hxx> 32 #include <rscall.h> 33 34 /****************** C L A S S E S ****************************************/ 35 class RscTypCont; 36 37 /*********** R s c I n c o n s i s t e n t *******************************/ 38 class RscInconsistent { 39 public: 40 RscId aFirstId; //Paar von inkonsistenten Id's 41 RscId aSecondId; 42 RscInconsistent( const RscId & rFirst, const RscId & rSecond ){ 43 aFirstId = rFirst; 44 aSecondId = rSecond; 45 }; 46 }; 47 48 DECLARE_LIST( RscInconsList, RscInconsistent * ) 49 50 /******************* O b j N o d e ***************************************/ 51 class ObjNode : public IdNode{ 52 RscId aRscId; // Id der Resource 53 CLASS_DATA pRscObj;// pointer to a resourceobject 54 sal_uLong lFileKey;// Dateischluessel 55 protected: 56 using NameNode::Search; 57 58 public: 59 using NameNode::Insert; 60 61 ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey ); 62 ObjNode * DelObjNode( RscTop * pClass, sal_uLong lFileKey ); 63 sal_uInt32 GetId() const; 64 RscId GetRscId(){ return( aRscId ); } 65 sal_uLong GetFileKey(){ return lFileKey; }; 66 ObjNode* Search( const RscId &rName ) const{ 67 // search the index in the b-tree 68 return( (ObjNode *)IdNode::Search( rName ) ); 69 } 70 sal_Bool Insert( ObjNode* pTN ){ 71 // insert a new node in the b-tree 72 return( IdNode::Insert( (IdNode *)pTN ) ); 73 } 74 CLASS_DATA GetRscObj(){ 75 // get the Object from this Node 76 return( pRscObj ); 77 } 78 sal_Bool IsConsistent( RscInconsList * pList = NULL ); 79 }; 80 81 /******************* R e f N o d e ***************************************/ 82 class RefNode : public IdNode{ 83 Atom nTypNameId; // index of a Name in a hashtabel 84 protected: 85 using NameNode::Search; 86 87 public: 88 using NameNode::Insert; 89 90 ObjNode* pObjBiTree; // Zeiger auf Objektbaum 91 RefNode( Atom nTyp ); 92 sal_uInt32 GetId() const; 93 RefNode* Search( Atom typ ) const{ 94 // search the index in the b-tree 95 return( (RefNode *)IdNode::Search( typ ) ); 96 }; 97 sal_Bool Insert( RefNode* pTN ){ 98 // insert a new node in the b-tree 99 return( IdNode::Insert( (IdNode *)pTN ) ); 100 }; 101 sal_Bool PutObjNode( ObjNode * pPutObject ); 102 103 // insert new node in b-tree pObjBiTree 104 ObjNode * GetObjNode( const RscId &rRscId ); 105 106 ObjNode * GetObjNode(){ 107 // hole pObjBiTree 108 return( pObjBiTree ); 109 }; 110 }; 111 112 #endif // _RSCCLOBJ_HXX 113