source: trunk/gsdl/src/recpt/formattools.h@ 1079

Last change on this file since 1079 was 1079, checked in by sjboddie, 24 years ago

Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.
from DocumentColumns stuff. I'll move the DocumentColumns stuff to a
separate development branch (New_Config_Format-branch) for now. The plan
is to redesign the configuration file format a bit and limit the number of
distributions floating around that take different configuration formats).

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/**********************************************************************
2 *
3 * formattools.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * A component of the Greenstone digital library software
7 * from the New Zealand Digital Library Project at the
8 * University of Waikato, New Zealand.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * $Id: formattools.h 1079 2000-04-07 04:40:45Z sjboddie $
25 *
26 *********************************************************************/
27
28
29#ifndef FORMATTOOLS_H
30#define FORMATTOOLS_H
31
32#include "text_t.h"
33#include "comtypes.h"
34
35enum command_t {comIf, comOr, comMeta, comText, comLink, comEndLink, comNum, comIcon,
36 comDoc, comHighlight, comEndHighlight};
37enum pcommand_t {pNone, pImmediate, pTop, pAll};
38enum dcommand_t {dMeta};
39enum mcommand_t {mNone, mCgiSafe};
40
41struct metadata_t {
42 void clear();
43 metadata_t () {clear();}
44
45 text_t metaname;
46 mcommand_t metacommand;
47 pcommand_t parentcommand;
48 text_t parentoptions;
49};
50
51struct decision_t {
52 void clear();
53 decision_t () {clear();}
54
55 dcommand_t command;
56 metadata_t meta;
57};
58
59struct format_t {
60 void clear();
61 format_t () {clear();}
62
63 command_t command;
64 decision_t decision;
65 text_t text;
66 metadata_t meta;
67 format_t *nextptr;
68 format_t *ifptr;
69 format_t *elseptr;
70 format_t *orptr;
71};
72
73// the format structure used by this receptionist
74struct formatinfo_t {
75 void clear();
76 formatinfo_t () {clear();}
77
78 bool DocumentImages;
79 bool DocumentTitles;
80 text_t DocumentHeading;
81 bool DocumentContents;
82 bool DocumentArrowsBottom;
83 text_tarray DocumentButtons;
84 text_t DocumentText;
85 text_tmap formatstrings;
86 bool DocumentUseHTML;
87};
88
89bool is_table_content (const text_t &formatstring);
90bool is_table_content (const format_t *formatlistptr);
91
92bool get_formatstring (const text_t &key, const text_tmap &formatstringmap,
93 text_t &formatstring);
94bool get_formatstring (const text_t &key1, const text_t &key2,
95 const text_tmap &formatstringmap,
96 text_t &formatstring);
97
98text_t format_date (const text_t &date);
99
100bool parse_formatstring (const text_t &formatstring, format_t *formatlistptr,
101 text_tset &metadata, bool &getParents);
102
103text_t get_formatted_string (ResultDocInfo_t &docinfo, format_t *formatlistptr,
104 const text_t &link, const text_t &icon);
105
106text_t get_formatted_string (ResultDocInfo_t &docinfo, format_t *formatlistptr);
107
108text_t get_formatted_string (ResultDocInfo_t &docinfo, format_t *formatlistptr,
109 const text_t &text);
110
111text_t get_formatted_string (ResultDocInfo_t &docinfo, format_t *formatlistptr,
112 const text_t &link, const text_t &icon, const text_t &text);
113
114text_t get_formatted_string (ResultDocInfo_t &docinfo, format_t *formatlistptr,
115 const text_t &link, const text_t &icon, bool highlight);
116
117text_t get_formatted_string (ResultDocInfo_t &docinfo, format_t *formatlistptr,
118 const text_t &link, const text_t &icon,
119 const text_t &text, bool highlight);
120
121
122#endif
Note: See TracBrowser for help on using the repository browser.