Annotation of libwww/Library/src/HTDialog.html, revision 2.5

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.4       frystyk     3: <TITLE>W3C Reference Library libwww messages and dialogs</TITLE>
2.5     ! frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
2.1       frystyk     5: <NEXTID N="z11">
                      6: </HEAD>
                      7: <BODY>
                      8: 
                      9: <H1>Application side Error Messages And the like</H1>
                     10: 
                     11: <PRE>
                     12: /*
                     13: **     (c) COPYRIGHT MIT 1995.
                     14: **     Please first read the full copyright statement in the file COPYRIGH.
                     15: */
                     16: </PRE>
                     17: 
                     18: This module provides some "make life easier" functions in order to get
                     19: the application going. The functionality of this module was originally
                     20: in <A HREF="HTAccess.html">HTAccess</A>, but now It is part of the <A
                     21: HREF="WWWApp.html">application interface</A> which the application
                     22: <EM>may</EM> use it if desired.<P>
                     23: 
                     24: This module is implemented by <A HREF="HTHome.c">HTHome.c</A>, and it
                     25: is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C
                     26: Reference Library</A>. <P>
                     27: 
                     28: <PRE>
                     29: #ifndef HTMSG_H
                     30: #define HTMSG_H
                     31: #include "WWWLib.h"
                     32: </PRE>
                     33: 
                     34: You can register a set of callback functions to handle user prompting,
                     35: error messages, confimations etc. Here we give a set of functions that
                     36: can be used on almost anu thinkable platform. If you want to provide
                     37: your own platform dependent inoplementation then fine :-)
                     38: 
                     39: <H3>Display a message, then wait for 'YES' or 'NO'</H3>
                     40: 
                     41: This function prompts the user for a confirmation on the message
                     42: passed as a parameter. If the user reacts in the affirmative, returns
                     43: <EM>TRUE</EM>, returns <EM>FALSE</EM> otherwise.
                     44: 
                     45: <PRE>
                     46: extern HTAlertCallback HTConfirm;
                     47: </PRE>
                     48: 
                     49: <H3>Prompt the User a Question</H3>
                     50: 
                     51: Prompt for answer and get text back. Reply text is either NULL on
                     52: error or a dynamic string which the caller must free.
                     53: 
                     54: <PRE>          
                     55: extern HTAlertCallback HTPrompt;
                     56: </PRE>
                     57: 
                     58: <H3>Prompt for a Password</H3>
                     59: 
                     60: Prompt for password without echoing the reply. Reply text is weither
                     61: NULL on error or a dynamic string which the caller must free. <P>
                     62: 
                     63: <B>NOTE:</B> The current version uses <EM>getpass</EM> which on many
                     64: systems returns a string of 8 or 16 bytes.
                     65: 
                     66: <PRE>
                     67: extern HTAlertCallback HTPromptPassword;
                     68: </PRE>
                     69: 
                     70: <H3>Prompt for a UserID and a Password</H3>
                     71: 
                     72: This is just a composite function using <EM>HTPrompt</EM> and
                     73: <EM>HTPromptPassword</EM>. The strings returned must be freed by
                     74: caller.
                     75: 
                     76: <PRE>
                     77: extern HTAlertCallback HTPromptUsernameAndPassword;
                     78: </PRE>
                     79: 
                     80: <H3>Display a Message</H3>
                     81: 
                     82: This function simply puts out the message passed.
                     83: 
                     84: <PRE>
                     85: extern HTAlertCallback HTAlert;
                     86: </PRE>
                     87: 
                     88: <H3>Progress Notification</H3>
                     89: 
                     90: This function can be used to indicate the current status of a certain
                     91: action. In order to avoid having strings directly in the core parts of
                     92: the Library, this function is passed a "state" argument from which the
                     93: message can be generated in this module. The "param" argument is for
                     94: additional information to be passed.
                     95: 
                     96: <PRE>
                     97: extern HTAlertCallback HTProgress;
                     98: </PRE>
                     99: 
2.2       frystyk   100: <H3>Generating a User Error Message of a request</H3>
2.1       frystyk   101: 
                    102: This function outputs the content of the error list to standard output
                    103: (used in Line Mode Browser), but smart clients and servers might
                    104: overwrite this function so that the error messages can be handled to
                    105: the user in a nice(r) way. That is the reason for putting the actual
                    106: implementation in <A HREF="HTAlert.c">HTAlert.c</A>.<P>
                    107: 
                    108: <PRE>
                    109: extern HTAlertCallback HTError_print;
2.2       frystyk   110: </PRE>
                    111: 
                    112: <H3>Generating a Server Error Message of a request</H3>
                    113: 
                    114: Default function that creates an error message using HTAlert() to
                    115: put out the contents of the error_stack messages. Furthermore, the
                    116: error_info structure contains a name of a help file that might be put
                    117: up as a link. This file can then be multi-linguistic.
                    118: 
                    119: <PRE>
                    120: extern BOOL HTError_response (HTRequest * request, HTAlertOpcode op,
2.3       frystyk   121:                              int msgnum, const char * dfault, void * input,
2.2       frystyk   122:                              HTAlertPar * reply);
2.1       frystyk   123: </PRE>
                    124: 
                    125: <PRE>
                    126: #endif /* HTHOME_H */
                    127: </PRE>
                    128: 
2.5     ! frystyk   129: <HR>
        !           130: <ADDRESS>
        !           131: @(#) $Id: Date Author State $
        !           132: </ADDRESS>
2.1       frystyk   133: </BODY>
                    134: </HTML>

Webmaster