Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / nsgmls / EntityDecl.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: EntityDecl.h /main/1 1996/07/29 16:50:29 cde-hp $ */
24 // Copyright (c) 1995 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef EntityDecl_INCLUDED
28 #define EntityDecl_INCLUDED 1
29
30 #ifdef __GNUG__
31 #pragma interface
32 #endif
33
34 #include "NamedResource.h"
35 #include "Ptr.h"
36 #include "StringResource.h"
37 #include "Location.h"
38 #include "types.h"
39
40 #ifdef SP_NAMESPACE
41 namespace SP_NAMESPACE {
42 #endif
43
44 class SP_API EntityDecl : public NamedResource {
45 public:
46   enum DeclType { generalEntity, parameterEntity, doctype, linktype,
47                   notation };
48   enum DataType { sgmlText, pi, cdata, sdata, ndata, subdoc };
49   EntityDecl(const StringC &, DeclType declType, DataType dataType,
50              const Location &defLocation);
51   DataType dataType() const;
52   DeclType declType() const;
53   const Location &defLocation() const;
54   Boolean declInDtdIsBase() const;
55   Boolean declInActiveLpd() const;
56   const StringC *declInDtdNamePointer() const;
57   const StringC *declInLpdNamePointer() const;
58   void setDeclIn(const ConstPtr<StringResource<Char> > &dtdName,
59                  Boolean dtdIsBase,
60                  const ConstPtr<StringResource<Char> > &lpdName,
61                  Boolean lpdIsActive);
62   void setDeclIn(const ConstPtr<StringResource<Char> > &dtdName,
63                  Boolean dtdIsBase);
64   void setDefLocation(const Location &);
65   virtual const StringC *systemIdPointer() const;
66   virtual const StringC *publicIdPointer() const;
67   virtual const StringC *effectiveSystemIdPointer() const;
68 private:
69   DeclType declType_;
70   DataType dataType_;
71   PackedBoolean dtdIsBase_;
72   PackedBoolean lpdIsActive_;
73   Location defLocation_;
74   ConstPtr<StringResource<Char> > dtdName_;
75   ConstPtr<StringResource<Char> > lpdName_;
76 };
77
78 inline
79 const Location &EntityDecl::defLocation() const
80 {
81   return defLocation_;
82 }
83
84 inline
85 EntityDecl::DeclType EntityDecl::declType() const
86 {
87   return declType_;
88 }
89
90 inline
91 EntityDecl::DataType EntityDecl::dataType() const
92 {
93   return dataType_;
94 }
95
96 inline
97 const StringC *EntityDecl::declInDtdNamePointer() const
98 {
99   return dtdName_.pointer();
100 }
101
102 inline
103 const StringC *EntityDecl::declInLpdNamePointer() const
104 {
105   return lpdName_.pointer();
106 }
107
108 inline
109 Boolean EntityDecl::declInDtdIsBase() const
110 {
111   return dtdIsBase_;
112 }
113
114 inline
115 Boolean EntityDecl::declInActiveLpd() const
116 {
117   return lpdIsActive_;
118 }
119
120 inline
121 void EntityDecl::setDefLocation(const Location &loc)
122 {
123   defLocation_ = loc;
124 }
125
126 #ifdef SP_NAMESPACE
127 }
128 #endif
129
130 #endif /* not EntityDecl_INCLUDED */