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