xref: /trunk/main/rsc/inc/rscclobj.hxx (revision f7c60c9c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _RSCCLOBJ_HXX
24 #define _RSCCLOBJ_HXX
25 
26 #include <rsctree.hxx>
27 #include <rscdef.hxx>
28 #include <rscall.h>
29 
30 /****************** C L A S S E S ****************************************/
31 class RscTypCont;
32 
33 /*********** R s c I n c o n s i s t e n t *******************************/
34 class RscInconsistent {
35 public:
36     RscId aFirstId;   //Paar von inkonsistenten Id's
37     RscId aSecondId;
RscInconsistent(const RscId & rFirst,const RscId & rSecond)38     RscInconsistent( const RscId & rFirst, const RscId & rSecond ){
39             aFirstId = rFirst;
40             aSecondId = rSecond;
41         };
42 };
43 
44 DECLARE_LIST( RscInconsList, RscInconsistent * )
45 
46 /******************* O b j N o d e ***************************************/
47 class ObjNode : public IdNode{
48     RscId       aRscId; // Id der Resource
49     CLASS_DATA  pRscObj;// pointer to a resourceobject
50     sal_uLong       lFileKey;// Dateischluessel
51 protected:
52     using NameNode::Search;
53 
54 public:
55     using NameNode::Insert;
56 
57                 ObjNode( const RscId & rId, CLASS_DATA pData, sal_uLong lKey );
58     ObjNode *   DelObjNode( RscTop * pClass, sal_uLong lFileKey );
59     sal_uInt32      GetId() const;
GetRscId()60     RscId       GetRscId(){ return( aRscId ); }
GetFileKey()61     sal_uLong       GetFileKey(){ return lFileKey; };
Search(const RscId & rName) const62     ObjNode*    Search( const RscId &rName ) const{
63                     // search the index in the b-tree
64                     return( (ObjNode *)IdNode::Search( rName ) );
65                 }
Insert(ObjNode * pTN)66     sal_Bool        Insert( ObjNode* pTN ){
67                     // insert a new node in the b-tree
68                     return( IdNode::Insert( (IdNode *)pTN ) );
69                 }
GetRscObj()70     CLASS_DATA  GetRscObj(){
71                     // get the Object from this Node
72                     return( pRscObj );
73                 }
74     sal_Bool        IsConsistent( RscInconsList * pList = NULL );
75 };
76 
77 /******************* R e f N o d e ***************************************/
78 class RefNode : public IdNode{
79     Atom        nTypNameId; // index of a Name in a hashtabel
80 protected:
81     using NameNode::Search;
82 
83 public:
84     using NameNode::Insert;
85 
86     ObjNode*    pObjBiTree; // Zeiger auf Objektbaum
87                 RefNode( Atom nTyp );
88     sal_uInt32      GetId() const;
Search(Atom typ) const89     RefNode*    Search( Atom typ ) const{
90                     // search the index in the b-tree
91                     return( (RefNode *)IdNode::Search( typ ) );
92                 };
Insert(RefNode * pTN)93     sal_Bool        Insert( RefNode* pTN ){
94                     // insert a new node in the b-tree
95                     return( IdNode::Insert( (IdNode *)pTN ) );
96                 };
97     sal_Bool        PutObjNode( ObjNode * pPutObject );
98 
99                 // insert new node in b-tree pObjBiTree
100     ObjNode *   GetObjNode( const RscId &rRscId );
101 
GetObjNode()102     ObjNode *   GetObjNode(){
103                     // hole  pObjBiTree
104                     return( pObjBiTree );
105                 };
106 };
107 
108 #endif // _RSCCLOBJ_HXX
109