// // Copyright 2003 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wHtml: // Builds a Strbuf containing the requested html data #ifndef p4wHtml_H #define p4wHtml_H #define crlf "\n" #define COOKIEPREFIX "P4W" #include <p4wRequest.h> class p4wHtml : public StrBuf { public: p4wHtml() : StrBuf() { fSuppressCRLF = fSepNeeded = 0; fRequest = NULL; }; p4wHtml( int supp ) : StrBuf() { fSuppressCRLF = supp; fSepNeeded = 0; fRequest = NULL; }; virtual ~p4wHtml() {}; // // http header methods p4wHtml & httpHeader( int code ); p4wHtml & authHeader(); p4wHtml & serverId(); p4wHtml & CacheControl(int secs); p4wHtml & contentType( const char *type, int endHeader =0, const char *charset =0 ); p4wHtml & setCookie( const char *name, const char *value, int clear=0, int endHeader=0, int sessionOnly=0 ); p4wHtml & contentLength( int len ); p4wHtml & location( const char *newLocation ); p4wHtml & beginHeader( const char *charset ); p4wHtml & title( const char *str ); p4wHtml & styleSheet(p4wRequest *fRequest, int bNoJS=0); p4wHtml & styleSheetShowHide(int hide=0, int extraSame=0, int extraOpps=0, int ctr=0); p4wHtml & base( const char *type, int isHTTPS ); p4wHtml & rssHeaderLink( const char *title, const char *href ); p4wHtml & endHeader( const char *faviconhttp=NULL, int isHTTPS=0 ); // // components of the page p4wHtml & beginBody( const char *color =0, const char *link =0, const char *vlink =0, const char *leftMargin =0, const char *topMargin =0, const char *marginWidth =0, const char *marginHeight =0, const char *jshandler =0, const char *jsaction =0 ); p4wHtml & endBody(); p4wHtml & header( const char *txt ); // // html primitives p4wHtml & comment( const char *txt ); p4wHtml & paragraph(); p4wHtml & hline( const char *width, const char *size ); p4wHtml & linebreak(); p4wHtml & beginNobreak(); p4wHtml & endNobreak(); p4wHtml & label( const char *str, const char *labelID, const char *face =0, const char *size =0, const char *color =0 ); p4wHtml & text( const char *str, const char *face =0, const char *size =0, const char *color =0, const char *labelID =0 ); p4wHtml & beginLink( const char *url =0, const char *name =0, const char *cls = 0, const char *mouseOver =0, const char *title =0, const char *id =0, const char *jshandler =0, const char *jsaction =0); p4wHtml & endLink(); p4wHtml & icon( const char *iconName, const char *height, const char *width, const char *alt, int suppressBorder, const char *vspace =0, const char *hspace =0, const char *align =0, const char *cls =0, const char *id=0); p4wHtml & beginUnformatted( const char *cls=0, const char *name=0 ); p4wHtml & endUnformatted(); p4wHtml & font( const char *size =0, const char *color =0, const char *cls =0 ); p4wHtml & endFont(); p4wHtml & face( const char *type ); p4wHtml & endFace( const char *type ); p4wHtml & beginSpan( const char *cls =0, const char *style =0, const char *id =0 ); p4wHtml & endSpan(); p4wHtml & beginDiv( const char *id =0, const char *cls =0, const char *style =0 ); p4wHtml & endDiv(); p4wHtml & beginBlockquote(); p4wHtml & endBlockquote(); // // Lists p4wHtml & beginDList(); p4wHtml & endDList(); p4wHtml & dListTag(); p4wHtml & dListVal(); p4wHtml & beginUList( const char *cls =0 ); p4wHtml & endUList(); p4wHtml & listVal(); p4wHtml & endListVal(); p4wHtml & beginOList(); p4wHtml & endOList(); // // Table elements p4wHtml & beginTable( const char *border =0, const char *width =0, const char *pad =0, const char *spacing =0, const char *bgcolor =0, const char *cls =0 ); p4wHtml & endTable(); p4wHtml & beginTRow( const char *valign =0, const char *align =0, const char *bgcolor =0, const char *cls =0 ); p4wHtml & endTRow(); p4wHtml & beginCol( const char *valign =0, const char *align =0, const char *colspan =0, const char *rowspan =0, const char *bgcolor =0, const char *width =0, const char *height =0, int nowrap =0, const char *cls =0, const char *style =0 ); p4wHtml & endCol(); p4wHtml & beginColHead( const char *valign =0, const char *align =0, const char *colspan =0, const char *rowspan =0, const char *bgcolor =0, const char *width =0, const char *height =0, int nowrap =0, const char *cls =0, const char *style =0 ); p4wHtml & endColHead(); // // Form elements p4wHtml & beginForm( const char *action =0, const char *name =0 ); p4wHtml & endForm(); p4wHtml & textField( const char *name, const char *value =0, int size =0, char *id =0, const char *onClick =0, const char *onFocus=0, const char *onBlur =0, const char *autocomplete =0 ); p4wHtml & checkbox( const char *name, const char *value =0, int checked =0, char *onClick =0, char *id =0 ); p4wHtml & checkboxselectall( const char *formName, const char *fieldName, int checked ); p4wHtml & radio( const char *name, const char *value =0, int checked =0, char *onClick =0, char *id =0 ); p4wHtml & button( const char *name, const char *value ); p4wHtml & reset( const char *value ); p4wHtml & hiddenField( const char *name, const char *value ); p4wHtml & hiddenField( const char *name, int value ); p4wHtml & beginTextbox( const char *name, int rows, int cols, const char *onClick =0 ); p4wHtml & endTextbox(); p4wHtml & beginSelect( const char *name, int size =0, int multiple =0, const char *onChange=0, const char *onFocus=0, const char *id =0 ); p4wHtml & endSelect(); p4wHtml & beginLogin(char *actionURL); p4wHtml & endLogin(char *orgurl); p4wHtml & endJSActionsLink(int iconSz, int bUseIcon=0); p4wHtml & selectOpt( int selected =0, const char *value =0 ); p4wHtml & passwdField( const char *name, const char *value =0, int size =0); // // Popup menus p4wHtml & RenderPathMenu(); p4wHtml & RenderFileMenu(int show); p4wHtml & RenderRevHistMenu(); p4wHtml & beginUrlMenu(p4wRequest *request, char *divname); p4wHtml & renderUrlMenuItem(char *muName, int divctr, AllCommands ac, char *url, char *name, int adddots=0, const char* myicon=0, int myiBig=0, int buXc=0); p4wHtml & endUrlMenu(); void SetSepNeeded(int b) { fSepNeeded = b; }; void RenderMenuItem(char *muName, AllCommands cmd, char *name, int clsctr, char *myicon=0, char *submit=0, char *validate=0); void renderPromptMenuItem(char *muName, char *promptstr, char *urlin, AllCommands cmd, char *name, int divctr ); // // Misc void SetRequest(p4wRequest *r) { fRequest = r; }; private: void inputField( const char *type, const char *name, const char *value =0, int checked =0, int size =0, char *id =0, const char *onClick =0, const char *onFocus =0, const char *onBlur =0, const char *autocomplete =0 ); p4wRequest *fRequest; int fSuppressCRLF; int fSepNeeded; }; #endif // p4wHtml_H
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/util/p4wHtml.h | |||||
#2 | 10416 | Lester Cheung | Using HTTPS for favicon when option -ss (HTTPS mode) is used. | ||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |