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