Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

html.h

Go to the documentation of this file.
00001 /*
00002  * html.h
00003  *
00004  * HyperText Markup Language stream classes.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-2002 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Log: html.h,v $
00027  * Revision 1.23  2002/11/06 22:47:23  robertj
00028  * Fixed header comment (copyright etc)
00029  *
00030  * Revision 1.22  2002/09/16 01:08:59  robertj
00031  * Added #define so can select if #pragma interface/implementation is used on
00032  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00033  *
00034  * Revision 1.21  2001/02/13 04:39:08  robertj
00035  * Fixed problem with operator= in container classes. Some containers will
00036  *   break unless the copy is virtual (eg PStringStream's buffer pointers) so
00037  *   needed to add a new AssignContents() function to all containers.
00038  *
00039  * Revision 1.20  1999/03/09 08:01:46  robertj
00040  * Changed comments for doc++ support (more to come).
00041  *
00042  * Revision 1.19  1999/02/16 08:07:10  robertj
00043  * MSVC 6.0 compatibility changes.
00044  *
00045  * Revision 1.18  1998/09/23 06:19:27  robertj
00046  * Added open source copyright license.
00047  *
00048  * Revision 1.17  1997/07/08 13:15:31  robertj
00049  * DLL support.
00050  *
00051  * Revision 1.16  1997/06/16 13:18:02  robertj
00052  * Set Is() function to be const as it should have been.
00053  *
00054  * Revision 1.15  1996/08/17 10:00:18  robertj
00055  * Changes for Windows DLL support.
00056  *
00057  * Revision 1.14  1996/06/28 13:08:41  robertj
00058  * Changed PHTML class so can create html fragments.
00059  * Fixed nesting problem in tables.
00060  *
00061  * Revision 1.13  1996/06/01 04:18:40  robertj
00062  * Fixed bug in RadioButton, having 2 VALUE fields
00063  *
00064  * Revision 1.12  1996/04/14 02:52:02  robertj
00065  * Added hidden fields to HTML.
00066  *
00067  * Revision 1.11  1996/03/12 11:30:00  robertj
00068  * Fixed resetting of HTML output using operator=.
00069  *
00070  * Revision 1.10  1996/03/10 13:14:53  robertj
00071  * Simplified some of the classes and added catch all string for attributes.
00072  *
00073  * Revision 1.9  1996/03/03 07:36:44  robertj
00074  * Added missing public's to standard character attribute classes.
00075  *
00076  * Revision 1.8  1996/02/25 11:14:19  robertj
00077  * Radio button support for forms.
00078  *
00079  * Revision 1.7  1996/02/19 13:18:25  robertj
00080  * Removed MSC_VER test as now completely removed from WIN16 library.
00081  *
00082  * Revision 1.6  1996/02/08 11:50:38  robertj
00083  * More implementation.
00084  *
00085  * Revision 1.5  1996/02/03 11:01:25  robertj
00086  * Further implementation.
00087  *
00088  * Revision 1.4  1996/01/28 14:15:56  robertj
00089  * More comments.
00090  *
00091  * Revision 1.3  1996/01/28 02:45:38  robertj
00092  * Further implementation.
00093  *
00094  * Revision 1.2  1996/01/26 02:24:24  robertj
00095  * Further implemetation.
00096  *
00097  * Revision 1.1  1996/01/24 23:45:37  robertj
00098  * Initial revision
00099  *
00100  */
00101 
00102 #ifndef _PHTML
00103 #define _PHTML
00104 
00105 #ifdef P_USE_PRAGMA
00106 #pragma interface
00107 #endif
00108 
00109 
00110 
00112 // PHTML
00113 
00120 class PHTML : public PStringStream
00121 {
00122   PCLASSINFO(PHTML, PStringStream)
00123 
00124   public:
00125     enum ElementInSet {
00126       InHTML,
00127       InHead,
00128       InBody,
00129       InTitle,
00130       InHeading,
00131       InDivision,
00132       InPreFormat,
00133       InAnchor,
00134       InNote,
00135       InAddress,
00136       InBlockQuote,
00137       InCredit,
00138       InBold,
00139       InItalic,
00140       InTeleType,
00141       InUnderline,
00142       InStrikeThrough,
00143       InBig,
00144       InSmall,
00145       InSubscript,
00146       InSuperscript,
00147       InEmphasis,
00148       InCite,
00149       InStrong,
00150       InCode,
00151       InSample,
00152       InKeyboard,
00153       InVariable,
00154       InDefinition,
00155       InQuote,
00156       InAuthor,
00157       InPerson,
00158       InAcronym,
00159       InAbbrev,
00160       InInsertedText,
00161       InDeletedText,
00162       InList,
00163       InListHeading,
00164       InDefinitionTerm,
00165       InTable,
00166       InForm,
00167       InSelect,
00168       InTextArea,
00169       NumElementsInSet
00170     };
00171 
00176     PHTML(
00177       ElementInSet initialState = NumElementsInSet
00178     );
00179     PHTML(
00180       const char * cstr     // C string representation of the title string.
00181     );
00182     PHTML(
00183       const PString & str   // String representation of the title string.
00184     );
00185 
00186     ~PHTML();
00187 
00192     PHTML & operator=(
00193       const PHTML & html     // HTML stream to make a copy of.
00194     ) { AssignContents(html); return *this; }
00195     PHTML & operator=(
00196       const PString & str    // String for title in restating HTML.
00197     ) { AssignContents(str); return *this; }
00198     PHTML & operator=(
00199       const char * cstr    // String for title in restating HTML.
00200     ) { AssignContents(PString(cstr)); return *this; }
00201     PHTML & operator=(
00202       char ch    // String for title in restating HTML.
00203     ) { AssignContents(PString(ch)); return *this; }
00204 
00205 
00206   // New functions for class.
00207     BOOL Is(ElementInSet elmt) const;
00208     void Set(ElementInSet elmt);
00209     void Clr(ElementInSet elmt);
00210     void Toggle(ElementInSet elmt);
00211 
00212 
00213     class Element {
00214       protected:
00215         enum OptionalCRLF { NoCRLF, OpenCRLF, CloseCRLF, BothCRLF };
00216         Element(
00217           const char * nam,
00218           const char * att,
00219           ElementInSet elmt,
00220           ElementInSet req,
00221           OptionalCRLF opt
00222         ) { name = nam; attr= att; inElement = elmt; reqElement = req; crlf = opt; }
00223         virtual void Output(PHTML & html) const;
00224         virtual void AddAttr(PHTML & html) const;
00225       private:
00226         const char * name;
00227         const char * attr;
00228         ElementInSet inElement;
00229         ElementInSet reqElement;
00230         OptionalCRLF crlf;
00231       friend ostream & operator<<(ostream & strm, const Element & elmt)
00232         { elmt.Output((PHTML&)strm); return strm; }
00233     };
00234 
00235     class HTML : public Element {
00236       public:
00237         HTML(const char * attr = NULL);
00238     };
00239 
00240     class Head : public Element {
00241       public:
00242         Head();
00243       protected:
00244         virtual void Output(PHTML & html) const;
00245     };
00246 
00247     class Body : public Element {
00248       public:
00249         Body(const char * attr = NULL);
00250       protected:
00251         virtual void Output(PHTML & html) const;
00252     };
00253 
00254     class Title : public Element {
00255       public:
00256         Title();
00257         Title(const char * titleCStr);
00258         Title(const PString & titleStr);
00259       protected:
00260         virtual void Output(PHTML & html) const;
00261       private:
00262         const char * titleString;
00263     };
00264 
00265     class Banner : public Element {
00266       public:
00267         Banner(const char * attr = NULL);
00268     };
00269 
00270     class Division : public Element {
00271       public:
00272         Division(const char * attr = NULL);
00273     };
00274 
00275     class Heading : public Element {
00276       public:
00277         Heading(int number,
00278                 int sequence = 0,
00279                 int skip = 0,
00280                 const char * attr = NULL);
00281         Heading(int number,
00282                 const char * image,
00283                 int sequence = 0,
00284                 int skip = 0,
00285                 const char * attr = NULL);
00286         Heading(int number,
00287                 const PString & imageStr,
00288                 int sequence = 0,
00289                 int skip = 0,
00290                 const char * attr = NULL);
00291       protected:
00292         virtual void AddAttr(PHTML & html) const;
00293       private:
00294         int num;
00295         const char * srcString;
00296         int seqNum, skipSeq;
00297     };
00298 
00299     class BreakLine : public Element {
00300       public:
00301         BreakLine(const char * attr = NULL);
00302     };
00303 
00304     class Paragraph : public Element {
00305       public:
00306         Paragraph(const char * attr = NULL);
00307     };
00308 
00309     class PreFormat : public Element {
00310       public:
00311         PreFormat(int widthInChars = 0,
00312                   const char * attr = NULL);
00313       protected:
00314         virtual void AddAttr(PHTML & html) const;
00315       private:
00316         int width;
00317     };
00318 
00319     class HotLink : public Element {
00320       public:
00321         HotLink(const char * href = NULL, const char * attr = NULL);
00322       protected:
00323         virtual void AddAttr(PHTML & html) const;
00324       private:
00325         const char * hrefString;
00326     };
00327 
00328     class Target : public Element {
00329       public:
00330         Target(const char * name = NULL, const char * attr = NULL);
00331       protected:
00332         virtual void AddAttr(PHTML & html) const;
00333       private:
00334         const char * nameString;
00335     };
00336 
00337     class ImageElement : public Element {
00338       protected:
00339         ImageElement(const char * nam,
00340                      const char * attr,
00341                      ElementInSet elmt,
00342                      ElementInSet req,
00343                      OptionalCRLF opt,
00344                      const char * image);
00345         virtual void AddAttr(PHTML & html) const;
00346         const char * srcString;
00347     };
00348 
00349     class Image : public ImageElement {
00350       public:
00351         Image(const char * src,
00352               int width = 0,
00353               int height = 0,
00354               const char * attr = NULL);
00355         Image(const char * src,
00356               const char * alt,
00357               int width = 0,
00358               int height = 0,
00359               const char * attr = NULL);
00360       protected:
00361         virtual void AddAttr(PHTML & html) const;
00362       private:
00363         const char * altString;
00364         int width, height;
00365     };
00366 
00367     class HRule : public ImageElement {
00368       public:
00369         HRule(const char * image = NULL, const char * attr = NULL);
00370     };
00371 
00372     class Note : public ImageElement {
00373       public:
00374         Note(const char * image = NULL, const char * attr = NULL);
00375     };
00376 
00377     class Address : public Element {
00378       public:
00379         Address(const char * attr = NULL);
00380     };
00381 
00382     class BlockQuote : public Element {
00383       public:
00384         BlockQuote(const char * attr = NULL);
00385     };
00386 
00387     class Credit : public Element {
00388       public:
00389         Credit(const char * attr = NULL);
00390     };
00391 
00392     class SetTab : public Element {
00393       public:
00394         SetTab(const char * id, const char * attr = NULL);
00395       protected:
00396         virtual void AddAttr(PHTML & html) const;
00397       private:
00398         const char * ident;
00399     };
00400 
00401     class Tab : public Element {
00402       public:
00403         Tab(int indent, const char * attr = NULL);
00404         Tab(const char * id, const char * attr = NULL);
00405       protected:
00406         virtual void AddAttr(PHTML & html) const;
00407       private:
00408         const char * ident;
00409         int indentSize;
00410     };
00411 
00412 
00413     class Bold : public Element {
00414       public: Bold() : Element("B", NULL, InBold, InBody, NoCRLF) { }
00415     };
00416     class Italic : public Element {
00417       public: Italic() : Element("I", NULL, InItalic, InBody, NoCRLF) { }
00418     };
00419     class TeleType : public Element {
00420       public: TeleType() : Element("TT", NULL, InTeleType, InBody, NoCRLF) { }
00421     };
00422     class Underline : public Element {
00423       public: Underline() : Element("U", NULL, InUnderline, InBody, NoCRLF) { }
00424     };
00425     class StrikeThrough : public Element {
00426       public: StrikeThrough()
00427                       : Element("S", NULL, InStrikeThrough, InBody, NoCRLF) { }
00428     };
00429     class Big : public Element {
00430       public: Big() : Element("BIG", NULL, InBig, InBody, NoCRLF) { }
00431     };
00432     class Small : public Element {
00433       public: Small() : Element("SMALL", NULL, InSmall, InBody, NoCRLF) { }
00434     };
00435     class Subscript : public Element {
00436       public: Subscript()
00437                         : Element("SUB", NULL, InSubscript, InBody, NoCRLF) { }
00438     };
00439     class Superscript : public Element {
00440       public: Superscript()
00441                       : Element("SUP", NULL, InSuperscript, InBody, NoCRLF) { }
00442     };
00443     class Emphasis : public Element {
00444       public: Emphasis() : Element("EM", NULL, InEmphasis, InBody, NoCRLF) { }
00445     };
00446     class Cite : public Element {
00447       public: Cite() : Element("CITE", NULL, InCite, InBody, NoCRLF) { }
00448     };
00449     class Strong : public Element {
00450       public: Strong() : Element("STRONG", NULL, InStrong, InBody, NoCRLF) { }
00451     };
00452     class Code : public Element {
00453       public: Code() : Element("CODE", NULL, InCode, InBody, NoCRLF) { }
00454     };
00455     class Sample : public Element {
00456       public: Sample() : Element("SAMP", NULL, InSample, InBody, NoCRLF) { }
00457     };
00458     class Keyboard : public Element {
00459       public: Keyboard() : Element("KBD", NULL, InKeyboard, InBody, NoCRLF) { }
00460     };
00461     class Variable : public Element {
00462       public: Variable() : Element("VAR", NULL, InVariable, InBody, NoCRLF) { }
00463     };
00464     class Definition : public Element {
00465       public: Definition()
00466                        : Element("DFN", NULL, InDefinition, InBody, NoCRLF) { }
00467     };
00468     class Quote : public Element {
00469       public: Quote() : Element("Q", NULL, InQuote, InBody, NoCRLF) { }
00470     };
00471     class Author : public Element {
00472       public: Author() : Element("AU", NULL, InAuthor, InBody, NoCRLF) { }
00473     };
00474     class Person : public Element {
00475       public: Person() : Element("PERSON", NULL, InPerson, InBody, NoCRLF) { }
00476     };
00477     class Acronym : public Element {
00478       public: Acronym():Element("ACRONYM", NULL, InAcronym, InBody, NoCRLF) { }
00479     };
00480     class Abbrev : public Element {
00481       public: Abbrev() : Element("ABBREV", NULL, InAbbrev, InBody, NoCRLF) { }
00482     };
00483     class InsertedText : public Element {
00484       public: InsertedText()
00485                      : Element("INS", NULL, InInsertedText, InBody, NoCRLF) { }
00486     };
00487     class DeletedText : public Element {
00488       public: DeletedText()
00489                       : Element("DEL", NULL, InDeletedText, InBody, NoCRLF) { }
00490     };
00491 
00492 
00493     class SimpleList : public Element {
00494       public:
00495         SimpleList(const char * attr = NULL);
00496       protected:
00497         virtual void AddAttr(PHTML & html) const;
00498     };
00499 
00500     class BulletList : public Element {
00501       public:
00502         BulletList(const char * attr = NULL);
00503     };
00504 
00505     class OrderedList : public Element {
00506       public:
00507         OrderedList(int seqNum = 0, const char * attr = NULL);
00508       protected:
00509         virtual void AddAttr(PHTML & html) const;
00510       private:
00511         int sequenceNum;
00512     };
00513 
00514     class DefinitionList : public Element {
00515       public:
00516         DefinitionList(const char * attr = NULL);
00517     };
00518 
00519     class ListHeading : public Element {
00520       public:
00521         ListHeading(const char * attr = NULL);
00522     };
00523 
00524     class ListItem : public Element {
00525       public:
00526         ListItem(int skip = 0, const char * attr = NULL);
00527       protected:
00528         virtual void AddAttr(PHTML & html) const;
00529       private:
00530         int skipSeq;
00531     };
00532 
00533     class DefinitionTerm : public Element {
00534       public:
00535         DefinitionTerm(const char * attr = NULL);
00536       protected:
00537         virtual void Output(PHTML & html) const;
00538     };
00539 
00540     class DefinitionItem : public Element {
00541       public:
00542         DefinitionItem(const char * attr = NULL);
00543       protected:
00544         virtual void Output(PHTML & html) const;
00545     };
00546 
00547 
00548     enum BorderCodes {
00549       NoBorder,
00550       Border
00551     };
00552     class TableStart : public Element {
00553       public:
00554         TableStart(const char * attr = NULL);
00555         TableStart(BorderCodes border, const char * attr = NULL);
00556       protected:
00557         virtual void Output(PHTML & html) const;
00558         virtual void AddAttr(PHTML & html) const;
00559       private:
00560         BOOL borderFlag;
00561     };
00562     friend class TableStart;
00563 
00564     class TableEnd : public Element {
00565       public:
00566         TableEnd();
00567       protected:
00568         virtual void Output(PHTML & html) const;
00569     };
00570     friend class TableEnd;
00571 
00572     class TableRow : public Element {
00573       public:
00574         TableRow(const char * attr = NULL);
00575     };
00576 
00577     class TableHeader : public Element {
00578       public:
00579         TableHeader(const char * attr = NULL);
00580     };
00581 
00582     class TableData : public Element {
00583       public:
00584         TableData(const char * attr = NULL);
00585     };
00586 
00587 
00588     class Form : public Element {
00589       public:
00590         Form(
00591           const char * method = NULL,
00592           const char * action = NULL,
00593           const char * encoding = NULL,
00594           const char * script = NULL
00595         );
00596       protected:
00597         virtual void AddAttr(PHTML & html) const;
00598       private:
00599         const char * methodString;
00600         const char * actionString;
00601         const char * mimeTypeString;
00602         const char * scriptString;
00603     };
00604 
00605     enum DisableCodes {
00606       Enabled,
00607       Disabled
00608     };
00609     class FieldElement : public Element {
00610       protected:
00611         FieldElement(
00612           const char * nam,
00613           const char * attr,
00614           ElementInSet elmt,
00615           OptionalCRLF opt,
00616           DisableCodes disabled
00617         );
00618         virtual void AddAttr(PHTML & html) const;
00619       private:
00620         BOOL disabledFlag;
00621     };
00622 
00623     class Select : public FieldElement {
00624       public:
00625         Select(
00626           const char * fname = NULL,
00627           const char * attr = NULL
00628         );
00629         Select(
00630           const char * fname,
00631           DisableCodes disabled,
00632           const char * attr = NULL
00633         );
00634       protected:
00635         virtual void AddAttr(PHTML & html) const;
00636       private:
00637         const char * nameString;
00638     };
00639 
00640     enum SelectionCodes {
00641       NotSelected,
00642       Selected
00643     };
00644     class Option : public FieldElement {
00645       public:
00646         Option(
00647           const char * attr = NULL
00648         );
00649         Option(
00650           SelectionCodes select,
00651           const char * attr = NULL
00652         );
00653         Option(
00654           DisableCodes disabled,
00655           const char * attr = NULL
00656         );
00657         Option(
00658           SelectionCodes select,
00659           DisableCodes disabled,
00660           const char * attr = NULL
00661         );
00662       protected:
00663         virtual void AddAttr(PHTML & html) const;
00664       private:
00665         BOOL selectedFlag;
00666     };
00667 
00668     class FormField : public FieldElement {
00669       protected:
00670         FormField(
00671           const char * nam,
00672           const char * attr,
00673           ElementInSet elmt,
00674           OptionalCRLF opt,
00675           DisableCodes disabled,
00676           const char * fname
00677         );
00678         virtual void AddAttr(PHTML & html) const;
00679       private:
00680         const char * nameString;
00681     };
00682 
00683     class TextArea : public FormField {
00684       public:
00685         TextArea(
00686           const char * fname,
00687           DisableCodes disabled = Enabled,
00688           const char * attr = NULL
00689         );
00690         TextArea(
00691           const char * fname,
00692           int rows, int cols,
00693           DisableCodes disabled = Enabled,
00694           const char * attr = NULL
00695         );
00696       protected:
00697         virtual void AddAttr(PHTML & html) const;
00698       private:
00699         int numRows, numCols;
00700     };
00701 
00702     class InputField : public FormField {
00703       protected:
00704         InputField(
00705           const char * type,
00706           const char * fname,
00707           DisableCodes disabled,
00708           const char * attr
00709         );
00710         virtual void AddAttr(PHTML & html) const;
00711       private:
00712         const char * typeString;
00713     };
00714 
00715     class HiddenField : public InputField {
00716       public:
00717         HiddenField(
00718           const char * fname,
00719           const char * value,
00720           const char * attr = NULL
00721         );
00722       protected:
00723         virtual void AddAttr(PHTML & html) const;
00724       private:
00725         const char * valueString;
00726     };
00727 
00728     class InputText : public InputField {
00729       public:
00730         InputText(
00731           const char * fname,
00732           int size,
00733           const char * init = NULL,
00734           const char * attr = NULL
00735         );
00736         InputText(
00737           const char * fname,
00738           int size,
00739           DisableCodes disabled,
00740           const char * attr = NULL
00741         );
00742         InputText(
00743           const char * fname,
00744           int size,
00745           int maxLength,
00746           DisableCodes disabled = Enabled,
00747           const char * attr = NULL
00748         );
00749         InputText(
00750           const char * fname,
00751           int size,
00752           const char * init,
00753           int maxLength,
00754           DisableCodes disabled = Enabled,
00755           const char * attr = NULL
00756         );
00757       protected:
00758         InputText(
00759           const char * type,
00760           const char * fname,
00761           int size,
00762           const char * init,
00763           int maxLength,
00764           DisableCodes disabled,
00765           const char * attr
00766         );
00767         virtual void AddAttr(PHTML & html) const;
00768       private:
00769         const char * value;
00770         int width, length;
00771     };
00772 
00773     class InputPassword : public InputText {
00774       public:
00775         InputPassword(
00776           const char * fname,
00777           int size,
00778           const char * init = NULL,
00779           const char * attr = NULL
00780         );
00781         InputPassword(
00782           const char * fname,
00783           int size,
00784           DisableCodes disabled,
00785           const char * attr = NULL
00786         );
00787         InputPassword(
00788           const char * fname,
00789           int size,
00790           int maxLength,
00791           DisableCodes disabled = Enabled,
00792           const char * attr = NULL
00793         );
00794         InputPassword(
00795           const char * fname,
00796           int size,
00797           const char * init,
00798           int maxLength,
00799           DisableCodes disabled = Enabled,
00800           const char * attr = NULL
00801         );
00802     };
00803 
00804     enum CheckedCodes {
00805       UnChecked,
00806       Checked
00807     };
00808     class RadioButton : public InputField {
00809       public:
00810         RadioButton(
00811           const char * fname,
00812           const char * value,
00813           const char * attr = NULL
00814         );
00815         RadioButton(
00816           const char * fname,
00817           const char * value,
00818           DisableCodes disabled,
00819           const char * attr = NULL
00820         );
00821         RadioButton(
00822           const char * fname,
00823           const char * value,
00824           CheckedCodes check,
00825           DisableCodes disabled = Enabled,
00826           const char * attr = NULL
00827         );
00828       protected:
00829         RadioButton(
00830           const char * type,
00831           const char * fname,
00832           const char * value,
00833           CheckedCodes check,
00834           DisableCodes disabled,
00835           const char * attr
00836         );
00837         virtual void AddAttr(PHTML & html) const;
00838       private:
00839         const char * valueString;
00840         BOOL checkedFlag;
00841     };
00842 
00843     class CheckBox : public RadioButton {
00844       public:
00845         CheckBox(
00846           const char * fname,
00847           const char * attr = NULL
00848         );
00849         CheckBox(
00850           const char * fname,
00851           DisableCodes disabled,
00852           const char * attr = NULL
00853         );
00854         CheckBox(
00855           const char * fname,
00856           CheckedCodes check,
00857           DisableCodes disabled = Enabled,
00858           const char * attr = NULL
00859         );
00860     };
00861 
00862 
00863     class InputRange : public InputField {
00864       public:
00865         InputRange(
00866           const char * fname,
00867           int min, int max,
00868           int value = 0,
00869           DisableCodes disabled = Enabled,
00870           const char * attr = NULL
00871         );
00872       protected:
00873         virtual void AddAttr(PHTML & html) const;
00874       private:
00875         int minValue, maxValue, initValue;
00876     };
00877 
00878     class InputFile : public InputField {
00879       public:
00880         InputFile(
00881           const char * fname,
00882           const char * accept = NULL,
00883           DisableCodes disabled = Enabled,
00884           const char * attr = NULL
00885         );
00886       protected:
00887         virtual void AddAttr(PHTML & html) const;
00888       private:
00889         const char * acceptString;
00890     };
00891 
00892     class InputImage : public InputField {
00893       public:
00894         InputImage(
00895           const char * fname,
00896           const char * src = NULL,
00897           DisableCodes disabled = Enabled,
00898           const char * attr = NULL
00899         );
00900       protected:
00901         InputImage(
00902           const char * type,
00903           const char * fname,
00904           const char * src,
00905           DisableCodes disabled,
00906           const char * attr
00907         );
00908         virtual void AddAttr(PHTML & html) const;
00909       private:
00910         const char * srcString;
00911     };
00912 
00913     class InputScribble : public InputImage {
00914       public:
00915         InputScribble(
00916           const char * fname,
00917           const char * src = NULL,
00918           DisableCodes disabled = Enabled,
00919           const char * attr = NULL
00920         );
00921     };
00922 
00923     class ResetButton : public InputImage {
00924       public:
00925         ResetButton(
00926           const char * title,
00927           const char * fname = NULL,
00928           const char * src = NULL,
00929           DisableCodes disabled = Enabled,
00930           const char * attr = NULL
00931         );
00932       protected:
00933         ResetButton(
00934           const char * type,
00935           const char * title,
00936           const char * fname = NULL,
00937           const char * src = NULL,
00938           DisableCodes disabled = Enabled,
00939           const char * attr = NULL
00940         );
00941         virtual void AddAttr(PHTML & html) const;
00942       private:
00943         const char * titleString;
00944     };
00945 
00946     class SubmitButton : public ResetButton {
00947       public:
00948         SubmitButton(
00949           const char * title,
00950           const char * fname = NULL,
00951           const char * src = NULL,
00952           DisableCodes disabled = Enabled,
00953           const char * attr = NULL
00954         );
00955     };
00956 
00957 
00958   protected:
00959     virtual void AssignContents(const PContainer & c);
00960 
00961   private:
00962     ElementInSet initialElement;
00963     BYTE elementSet[NumElementsInSet/8+1];
00964     PINDEX tableNestLevel;
00965 };
00966 
00967 
00968 #endif
00969 
00970 
00971 // End Of File ///////////////////////////////////////////////////////////////

Generated on Mon Feb 21 20:43:08 2005 for PWLib by  doxygen 1.4.1