Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / StyleSheet / Element.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: Element.h /main/5 1996/08/21 15:50:08 drk $ */
24 #ifndef _Element_h
25 #define _Element_h
26
27 #ifndef CDE_NEXT
28 #else
29 #include "dti_cc/CC_Slist.h"
30 #endif
31
32 #include "SymTab.h"
33
34 /* **************************************************************
35    class Element
36    
37    this is the structure passed from the node parser to the Resolver.
38    It contains the Element GI, and the attribute list for the element
39    ************************************************************** */
40
41 class Attribute;
42 class AttributeList;
43
44 class Element
45 {
46 public:
47   Element(const Element&);
48   Element(const Symbol &gi,
49           unsigned int  sibling_number = 0,
50           AttributeList *attrs = 0,
51           AttributeList *olias_attrs = 0,
52           unsigned int  relative_sibling_number = 0
53          );
54   ~Element();
55   
56   const Symbol       &gi() const { return f_gi ; }
57
58   const Attribute       *get_attribute(const Symbol &name) const ;
59   const Attribute       *get_olias_attribute(const Symbol &name) const;
60
61   unsigned int          sibling_number() const { return f_sibling_number ; }
62   unsigned int          relative_sibling_number() const 
63         { return f_relative_sibling_number; }
64
65   int           last_child() const { return f_last_child; }
66   int           relatively_last_child() const 
67         { return f_relatively_last_child; }
68
69   ostream &print(ostream &) const ;
70
71 private:
72   Symbol                f_gi ;
73   unsigned int          f_sibling_number ; // counting all children of a parent
74   AttributeList        *f_attributes;
75   AttributeList        *f_olias_attributes;
76   unsigned int          f_freeAttrLists;
77   unsigned int          f_relative_sibling_number ; // counting all 
78                                                     // consecutive children
79                                                     // of same types of a
80                                                     // parent
81   int                   f_last_child;
82   int                   f_relatively_last_child;
83 };
84
85 inline
86 ostream &operator<<(ostream &o, const Element &e)
87 {
88   return e.print(o);
89 }
90
91
92 #endif /* _Element_h */
93 /* DO NOT ADD ANY LINES AFTER THIS #endif */