Xbase Class Library  2.0.0
html.h
Go to the documentation of this file.
1 /* $Id: html.h,v 1.7 2000/11/10 19:04:17 dbryson Exp $
2 
3  Xbase project source code
4 
5  This file contains a header file for the HTML object which is used
6  for HTML generation.
7 
8  Copyright (C) 1997 StarTech, Gary A. Kunkel
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library 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 GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 
24  Contact:
25 
26  Mail:
27 
28  Technology Associates, Inc.
29  XBase Project
30  1455 Deming Way #11
31  Sparks, NV 89434
32  USA
33 
34  Email:
35 
36  xbase@techass.com
37 
38  See our website at:
39 
40  xdb.sourceforge.net
41 
42 
43  V 1.0 10/10/97 - Initial release of software
44  V 1.5 1/2/98 - Added memo field support
45  V 1.6a 4/1/98 - Added expression support
46  V 1.6b 4/8/98 - Numeric index keys
47  V 1.7.4c 10/26/98 - Added GenFormFields, SetCookie, GetCookie
48  V 1.8 11/29/98 - Version 1.8 upgrade
49 */
50 
51 #ifndef __XB_HTML_H__
52 #define __XB_HTML_H__
53 
54 #ifdef __GNUG__
55 #pragma interface
56 #endif
57 
58 #ifdef __WIN32__
59 #include <xbase/xbconfigw32.h>
60 #else
61 #include <xbase/xbconfig.h>
62 #endif
63 
64 #include <stdlib.h>
65 #include <string.h>
66 
67 #include <xbase/xtypes.h>
68 
72 
76 struct xbFieldList{
77  char * Label; /* field label on form */
78  char * FieldName; /* form field name */
79  xbShort FieldLen; /* form display length */
80  xbShort FieldNo; /* database field no */
81  xbShort Option; /* field option */
82 };
83 
84 typedef char **xbArrayPtr;
85 
87 
90 public:
91  xbHtml ( void );
93 
95  void BoldOff( void ) { cout << "</b>\n"; };
97 
99  void BoldOn( void ) { cout << "<b>"; };
101 
103  void Bullet( void ) { cout << "<li>"; };
104  void DumpArray( void );
106 
108  void EmphasizeOff( void ) { cout << "</em>\n"; };
110 
112  void EmphasizeOn( void ) { cout << "<em>"; };
114 
116  void EndHtmlPage( void ) { cout << "</BODY>\n</HTML>\n"; }
117  xbShort GenFormFields(xbDbf *d, xbShort Option,const char * Title,xbFieldList *fl);
118  xbShort GetArrayNo( const char * FieldName );
119  const char * GetCookie( const char *CookieName );
120  char * GetData( xbShort );
121  char * GetDataForField( const char *FieldName );
122  char * GetEnv( char * s ){ return getenv( s ); }
123  xbShort GetMethod( void );
125 
127  void HeaderOff( xbShort i ){ cout << "</h" << i << ">\n"; };
129 
131  void HeaderOn( xbShort i ){ cout << "<h" << i << ">\n"; };
133 
135  void ItalicOff( void ) { cout << "</i>\n"; };
137 
139  void ItalicOn( void ) { cout << "<i>"; };
141 
143  void NewLine( void ) { cout << "<br>"; }
144  xbShort PostMethod( void );
145  void PrintEncodedChar( char );
146  void PrintEncodedString( const char *s );
148 
150  void PrintHtml( char * s ) { cout << s; };
152 
154  void PrintHtml( xbLong l ) { cout << l; };
156 
158  void PrintHtml( xbShort i ) { cout << i; };
160 
162  void PrintHtml( int i ) { cout << i; };
163  void StartHtmlPage( const char *Title );
165 
167  void StartTextPage( void ) { cout << "Content-type: text/plain\n\n"; }
168  void TextOut( const char *String );
169  xbLong Tally( const char *FileName );
170  xbShort SetCookie(const char *Name, const char *Value, const char *ExpDate,
171  const char *ExpTime,const char *TimeZone, const char *Path,
172  const char *Domain, xbShort Secure );
173  void SpaceToPlus( char * );
174  void PlusToSpace( char * );
175  void SendRedirect( char * ) const;
176 
177 protected:
181  char * HtmlWorkBuf;
183  void LoadArray( void );
184  void DeleteEscChars( char *String );
185  void InitVals( void );
186 };
187 
188 #endif // __XB_HTML_H__
char ** xbArrayPtr
Definition: html.h:84
void BoldOn(void)
Short description.
Definition: html.h:99
void StartTextPage(void)
Short description.
Definition: html.h:167
void HeaderOff(xbShort i)
Short description.
Definition: html.h:127
void HeaderOn(xbShort i)
Short description.
Definition: html.h:131
void NewLine(void)
Short description.
Definition: html.h:143
#define XBDLLEXPORT
Definition: xbase.h:101
void PrintHtml(char *s)
Short description.
Definition: html.h:150
xbArrayPtr FieldNameArray
Definition: html.h:178
void EndHtmlPage(void)
Short description.
Definition: html.h:116
void ItalicOff(void)
Short description.
Definition: html.h:135
xbShort FieldNo
Definition: html.h:80
void BoldOff(void)
Short description.
Definition: html.h:95
char * FieldName
Definition: html.h:78
xbHtml class
Definition: html.h:89
void EmphasizeOn(void)
Short description.
Definition: html.h:112
void PrintHtml(int i)
Short description.
Definition: html.h:162
xbShort FieldLen
Definition: html.h:79
#define xbLong
Definition: xtypes.h:67
xbArrayPtr DataValueArray
Definition: html.h:179
short int xbShort
xbShort type
Definition: xtypes.h:65
xbShort NoOfDataFields
Definition: html.h:180
void ItalicOn(void)
Short description.
Definition: html.h:139
void EmphasizeOff(void)
Short description.
Definition: html.h:108
void PrintHtml(xbShort i)
Short description.
Definition: html.h:158
void PrintHtml(xbLong l)
Short description.
Definition: html.h:154
xbShort HtmlBufLen
Definition: html.h:182
xbFieldList struct
Definition: html.h:76
xbMH struct
Definition: dbf.h:201
xbShort Option
Definition: html.h:81
char * GetEnv(char *s)
Definition: html.h:122
char * Label
Definition: html.h:77
char * HtmlWorkBuf
Definition: html.h:181
void Bullet(void)
Short description.
Definition: html.h:103