📄 httpform_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>httpform.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>httpform.h</h1><a href="httpform_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * httpform.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * Forms management using HTTP User Interface.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-2002 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Contributor(s): ______________________________________.</span>00025 <span class="comment"> *</span>00026 <span class="comment"> * $Log: httpform.h,v $</span>00027 <span class="comment"> * Revision 1.17 2003/03/24 04:30:41 robertj</span>00028 <span class="comment"> * Added function to set and get strings from PConfig in correct format for</span>00029 <span class="comment"> * use with HTTP form array contsructs.</span>00030 <span class="comment"> *</span>00031 <span class="comment"> * Revision 1.16 2002/11/06 22:47:24 robertj</span>00032 <span class="comment"> * Fixed header comment (copyright etc)</span>00033 <span class="comment"> *</span>00034 <span class="comment"> * Revision 1.15 2002/09/16 01:08:59 robertj</span>00035 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00036 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00037 <span class="comment"> *</span>00038 <span class="comment"> * Revision 1.14 2001/10/10 08:07:48 robertj</span>00039 <span class="comment"> * Fixed large memory leak of strings when doing POST to a form.</span>00040 <span class="comment"> *</span>00041 <span class="comment"> * Revision 1.13 2000/12/18 07:12:37 robertj</span>00042 <span class="comment"> * Added ability to have fixed length array fields.</span>00043 <span class="comment"> *</span>00044 <span class="comment"> * Revision 1.12 1999/03/09 08:01:46 robertj</span>00045 <span class="comment"> * Changed comments for doc++ support (more to come).</span>00046 <span class="comment"> *</span>00047 <span class="comment"> * Revision 1.11 1999/02/16 08:07:10 robertj</span>00048 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00049 <span class="comment"> *</span>00050 <span class="comment"> * Revision 1.10 1998/11/30 02:50:48 robertj</span>00051 <span class="comment"> * New directory structure</span>00052 <span class="comment"> *</span>00053 <span class="comment"> * Revision 1.9 1998/09/23 06:19:31 robertj</span>00054 <span class="comment"> * Added open source copyright license.</span>00055 <span class="comment"> *</span>00056 <span class="comment"> * Revision 1.8 1998/08/20 05:45:33 robertj</span>00057 <span class="comment"> * Fixed bug where substitutions did not always occur if near end of macro block.</span>00058 <span class="comment"> *</span>00059 <span class="comment"> * Revision 1.7 1998/01/26 00:25:24 robertj</span>00060 <span class="comment"> * Major rewrite of HTTP forms management.</span>00061 <span class="comment"> *</span>00062 <span class="comment"> * Revision 1.6 1997/08/09 07:46:51 robertj</span>00063 <span class="comment"> * Fixed problems with value of SELECT fields in form</span>00064 <span class="comment"> *</span>00065 <span class="comment"> * Revision 1.5 1997/07/26 11:38:17 robertj</span>00066 <span class="comment"> * Support for overridable pages in HTTP service applications.</span>00067 <span class="comment"> *</span>00068 <span class="comment"> * Revision 1.4 1997/07/08 13:16:12 robertj</span>00069 <span class="comment"> * Major HTTP form enhancements for lists and arrays of fields.</span>00070 <span class="comment"> *</span>00071 <span class="comment"> * Revision 1.3 1997/06/08 04:49:40 robertj</span>00072 <span class="comment"> * Adding new llist based form field.</span>00073 <span class="comment"> *</span>00074 <span class="comment"> * Revision 1.2 1997/04/01 06:01:39 robertj</span>00075 <span class="comment"> * Allowed value list in drop down box to be modified once created.</span>00076 <span class="comment"> *</span>00077 <span class="comment"> * Revision 1.1 1996/06/28 12:55:56 robertj</span>00078 <span class="comment"> * Initial revision</span>00079 <span class="comment"> *</span>00080 <span class="comment"> */</span>00081 00082 <span class="preprocessor">#ifndef _PHTTPFORM</span>00083 <span class="preprocessor"></span><span class="preprocessor">#define _PHTTPFORM</span>00084 <span class="preprocessor"></span>00085 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00086 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00087 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00088 <span class="preprocessor"></span>00089 <span class="preprocessor">#include <<a class="code" href="http_8h.html">ptclib/http.h</a>></span>00090 00091 00093 <span class="comment">// PHTTPField</span>00094 <a name="l00098"></a><a class="code" href="classPHTTPField.html">00098</a> <span class="keyword">class </span><a class="code" href="classPHTTPField.html">PHTTPField</a> : <span class="keyword">public</span> <a class="code" href="classPObject.html">PObject</a>00099 {00100 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPHTTPField.html">PHTTPField</a>, <a class="code" href="classPObject.html">PObject</a>)00101 <span class="keyword">public</span>:00102 <a class="code" href="classPHTTPField.html#a0">PHTTPField</a>(00103 <span class="keyword">const</span> <span class="keywordtype">char</span> * bname, <span class="comment">// base name (identifier) for the field.</span>00104 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classPHTTPField.html#n2">title</a>, <span class="comment">// Title text for field (defaults to name).</span>00105 <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classPHTTPField.html#n3">help</a> <span class="comment">// Help text for the field.</span>00106 );00107 <span class="comment">// Create a new field in a HTTP form.</span>00108 00114 <span class="keyword">virtual</span> <a class="code" href="classPObject.html#z199_0">Comparison</a> <a class="code" href="classPHTTPField.html#a1">Compare</a>(00115 <span class="keyword">const</span> <a class="code" href="classPObject.html">PObject</a> & obj00116 ) <span class="keyword">const</span>;00117 <a name="l00123"></a><a class="code" href="classPHTTPField.html#a2">00123</a> <span class="keyword">const</span> <a class="code" href="classPCaselessString.html">PCaselessString</a> & <a class="code" href="classPHTTPField.html#a2">GetName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPHTTPField.html#n1">fullName</a>; }00124 <a name="l00130"></a><a class="code" href="classPHTTPField.html#a3">00130</a> <span class="keyword">const</span> <a class="code" href="classPCaselessString.html">PCaselessString</a> & <a class="code" href="classPHTTPField.html#a3">GetBaseName</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPHTTPField.html#n0">baseName</a>; }00131 00134 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classPHTTPField.html#a4">SetName</a>(00135 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & newName <span class="comment">// New name for field</span>00136 );00137 00143 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classPHTTPField.html">PHTTPField</a> * <a class="code" href="classPHTTPField.html#a5">LocateName</a>(00144 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & name <span class="comment">// Full field name to locate</span>00145 ) <span class="keyword">const</span>;00146 <a name="l00152"></a><a class="code" href="classPHTTPField.html#a6">00152</a> <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPHTTPField.html#a6">GetTitle</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPHTTPField.html#n2">title</a>; }00153 <a name="l00159"></a><a class="code" href="classPHTTPField.html#a7">00159</a> <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & <a class="code" href="classPHTTPField.html#a7">GetHelp</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classPHTTPField.html#n3">help</a>; }00160 <a name="l00161"></a><a class="code" href="classPHTTPField.html#a8">00161</a> <span class="keywordtype">void</span> <a class="code" href="classPHTTPField.html#a8">SetHelp</a>(00162 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & text <span class="comment">// Help text.</span>00163 ) { <a class="code" href="classPHTTPField.html#n3">help</a> = text; }00164 <span class="keywordtype">void</span> <a class="code" href="classPHTTPField.html#a8">SetHelp</a>(00165 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & hotLinkURL, <span class="comment">// URL for link to help page.</span>00166 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & linkText <span class="comment">// Help text in the link.</span>00167 );00168 <span class="keywordtype">void</span> <a class="code" href="classPHTTPField.html#a8">SetHelp</a>(00169 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & hotLinkURL, <span class="comment">// URL for link to help page.</span>00170 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & imageURL, <span class="comment">// URL for image to be displayed in link.</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -