Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / nsgmls / EntityDecl.h
1 /* $XConsortium: EntityDecl.h /main/1 1996/07/29 16:50:29 cde-hp $ */
2 // Copyright (c) 1995 James Clark
3 // See the file COPYING for copying permission.
4
5 #ifndef EntityDecl_INCLUDED
6 #define EntityDecl_INCLUDED 1
7
8 #ifdef __GNUG__
9 #pragma interface
10 #endif
11
12 #include "NamedResource.h"
13 #include "Ptr.h"
14 #include "StringResource.h"
15 #include "Location.h"
16 #include "types.h"
17
18 #ifdef SP_NAMESPACE
19 namespace SP_NAMESPACE {
20 #endif
21
22 class SP_API EntityDecl : public NamedResource {
23 public:
24   enum DeclType { generalEntity, parameterEntity, doctype, linktype,
25                   notation };
26   enum DataType { sgmlText, pi, cdata, sdata, ndata, subdoc };
27   EntityDecl(const StringC &, DeclType declType, DataType dataType,
28              const Location &defLocation);
29   DataType dataType() const;
30   DeclType declType() const;
31   const Location &defLocation() const;
32   Boolean declInDtdIsBase() const;
33   Boolean declInActiveLpd() const;
34   const StringC *declInDtdNamePointer() const;
35   const StringC *declInLpdNamePointer() const;
36   void setDeclIn(const ConstPtr<StringResource<Char> > &dtdName,
37                  Boolean dtdIsBase,
38                  const ConstPtr<StringResource<Char> > &lpdName,
39                  Boolean lpdIsActive);
40   void setDeclIn(const ConstPtr<StringResource<Char> > &dtdName,
41                  Boolean dtdIsBase);
42   void setDefLocation(const Location &);
43   virtual const StringC *systemIdPointer() const;
44   virtual const StringC *publicIdPointer() const;
45   virtual const StringC *effectiveSystemIdPointer() const;
46 private:
47   DeclType declType_;
48   DataType dataType_;
49   PackedBoolean dtdIsBase_;
50   PackedBoolean lpdIsActive_;
51   Location defLocation_;
52   ConstPtr<StringResource<Char> > dtdName_;
53   ConstPtr<StringResource<Char> > lpdName_;
54 };
55
56 inline
57 const Location &EntityDecl::defLocation() const
58 {
59   return defLocation_;
60 }
61
62 inline
63 EntityDecl::DeclType EntityDecl::declType() const
64 {
65   return declType_;
66 }
67
68 inline
69 EntityDecl::DataType EntityDecl::dataType() const
70 {
71   return dataType_;
72 }
73
74 inline
75 const StringC *EntityDecl::declInDtdNamePointer() const
76 {
77   return dtdName_.pointer();
78 }
79
80 inline
81 const StringC *EntityDecl::declInLpdNamePointer() const
82 {
83   return lpdName_.pointer();
84 }
85
86 inline
87 Boolean EntityDecl::declInDtdIsBase() const
88 {
89   return dtdIsBase_;
90 }
91
92 inline
93 Boolean EntityDecl::declInActiveLpd() const
94 {
95   return lpdIsActive_;
96 }
97
98 inline
99 void EntityDecl::setDefLocation(const Location &loc)
100 {
101   defLocation_ = loc;
102 }
103
104 #ifdef SP_NAMESPACE
105 }
106 #endif
107
108 #endif /* not EntityDecl_INCLUDED */