Link with C++ linker
[oweals/cde.git] / cde / programs / nsgmls / LinkProcess.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: LinkProcess.h /main/1 1996/07/29 16:55:50 cde-hp $ */
24 // Copyright (c) 1994 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef LinkProcess_INCLUDED
28 #define LinkProcess_INCLUDED 1
29 #ifdef __GNUG__
30 #pragma interface
31 #endif
32
33 #include "Lpd.h"
34 #include "IList.h"
35 #include "Link.h"
36 #include "Vector.h"
37 #include "Vector.h"
38 #include "Ptr.h"
39
40 #ifdef SP_NAMESPACE
41 namespace SP_NAMESPACE {
42 #endif
43
44 class Messenger;
45
46 struct SP_API LinkProcessOpenElement : public Link {
47   LinkProcessOpenElement(const LinkSet *current, const SourceLinkRule &);
48   LinkProcessOpenElement(const LinkSet *current);
49   const LinkSet *current;
50   const LinkSet *restore;
51   const LinkSet *post;
52   Boolean postRestore;
53 };
54
55 class SP_API LinkProcess {
56 public:
57   LinkProcess();
58   void init(const ConstPtr<ComplexLpd> &lpd);
59   Boolean startElement(const ElementType *,
60                        const AttributeList &attributes,
61                        const Location &location,
62                        Messenger &,
63                        const AttributeList *&linkAttributes,
64                        const ResultElementSpec *&resultElementSpec);
65   void endElement();
66   void uselink(const LinkSet *linkSet,
67                Boolean restore,
68                const Lpd *);
69   virtual Boolean selectLinkRule(const Vector<const AttributeList *> &,
70                                  const Location &location,
71                                  size_t &selected);
72   size_t nImpliedLinkRules() const;
73   const ResultElementSpec &impliedLinkRule(size_t) const;
74   const StringC &name() const;
75   Boolean isExplicit() const;
76   void clear();
77   void swap(LinkProcess &);
78 private:
79   LinkProcess(const LinkProcess &); // undefined
80   void operator=(const LinkProcess &); // undefined
81
82   IList<LinkProcessOpenElement> open_;
83   ConstPtr<ComplexLpd> lpd_;
84   Vector<ConstPtr<Lpd> > activeLpds_;
85   Vector<const AttributeList *> linkAttributes_;
86 };
87
88 inline
89 const StringC &LinkProcess::name() const
90 {
91   return lpd_->name();
92 }
93
94 inline
95 Boolean LinkProcess::isExplicit() const
96 {
97   return lpd_->type() == Lpd::explicitLink;
98 }
99
100 #ifdef SP_NAMESPACE
101 }
102 #endif
103
104 #endif /* not LinkProcess_INCLUDED */