Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtinfo / dtinfogen / infolib / etc / NodeTask.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: NodeTask.h /main/3 1996/07/18 15:16:53 drk $ */
24
25 #ifndef __NodeTask_h
26 #define __NodeTask_h
27
28 #include "Task.h"
29
30 class LcfTask;
31 class SearchStorage;
32 class BookCaseTask;
33 class BookTask;
34 class OL_Data;
35 class NodeData;
36
37 class NodeTask : public ComplexTask{
38   /*
39    * The NodeTask builds the NodeMeta table:
40    *
41    *  Table name: NodeMeta
42    *   Fields:
43    *    STRING node contents ("balanced tag" string) -- "" on first pass
44    *    STRING book/toc locator
45    *    STRING node locator
46    *    STRING node "ordinal", e.g. 2.3.1
47    *    STRING node title
48    *    STRING node stitle
49    */
50   
51 public:
52   
53   NodeTask(BookTask *book, class NodeTask *parent);
54
55   
56   ~NodeTask();
57   void markup(const Token& t);
58   void data( const char *, size_t);
59
60   const char *locator(); /* throw(Unexpected) if no locator yet */
61   BookTask   *book()     { return ( f_book ); }
62
63
64   const char *styleName();
65   const char *title();   /* throw(Unexpected) if no title available yet */
66   int   start_node_level() const { return(f_base); }
67
68 protected:
69   void write_record();
70
71   void reset();
72
73   void endSubNode(const Token& t);
74
75   int checkNodeAF(const Token& t);
76
77   int formatOrd(char * buf, int max);  /* for TOC gen, debugging */
78
79 private:
80   int f_base;
81   char *section_element_name;
82   int ord; /* for TOC gen, debugging */
83
84   BookTask *f_book;
85   LcfTask  *f_lcf;
86
87   OL_Data *f_shortTitle;
88   OL_Data *f_title;
89   OL_Data *f_locator;
90
91   int        subnode_pending;
92   NodeTask  *f_subnode;
93   NodeTask  *f_parent;
94   NodeData  *f_data;
95
96   OL_Data   *f_style;
97 };
98
99 #endif /* __NodeTask_h */