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

Last change on this file since 533 was 533, checked in by sjboddie, 25 years ago

added GPL notice

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 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 533 1999-09-07 04:57:01Z 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, comDoc};
36enum pcommand_t {pNone, pImmediate, pTop, pIndex, pAll};
37enum dcommand_t {dMeta};
38enum mcommand_t {mNone, mCgiSafe};
39
40struct metadata_t {
41 void clear();
42 metadata_t () {clear();}
43
44 text_t metaname;
45 int metaindex;
46 mcommand_t metacommand;
47 pcommand_t parentcommand;
48 int parentindex;
49 text_t parentoptions;
50};
51
52struct decision_t {
53 void clear();
54 decision_t () {clear();}
55
56 dcommand_t command;
57 metadata_t meta;
58};
59
60struct format_t {
61 void clear();
62 format_t () {clear();}
63
64 command_t command;
65 decision_t decision;
66 text_t text;
67 metadata_t meta;
68 format_t *nextptr;
69 format_t *ifptr;
70 format_t *elseptr;
71 format_t *orptr;
72};
73
74// the format structure used by this receptionist
75struct formatinfo_t {
76 void clear();
77 formatinfo_t () {clear();}
78
79 bool DocumentImages;
80 bool DocumentTopPages;
81 text_t DocumentHeading;
82 bool DocumentArrowsTop;
83 bool DocumentArrowsBottom;
84 bool DocumentGoTo;
85 text_tarray DocumentButtons;
86 text_t DocumentText;
87};
88
89
90text_t format_date (const text_t &date);
91
92bool parse_formatstring (const text_t &formatstring, format_t *formatlistptr,
93 text_tarray &metadata, bool &getParents);
94
95text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr,
96 const text_t &link, const text_t &icon);
97
98text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr);
99
100text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr,
101 const text_t &text);
102
103text_t get_formatted_string (const ResultDocInfo_t &docinfo, format_t *formatlistptr,
104 const text_t &link, const text_t &icon, const text_t &text);
105
106
107#endif
Note: See TracBrowser for help on using the repository browser.