diff options
Diffstat (limited to 'include/netsurf/misc.h')
-rw-r--r-- | include/netsurf/misc.h | 74 |
1 files changed, 47 insertions, 27 deletions
diff --git a/include/netsurf/misc.h b/include/netsurf/misc.h index 2647b9a1c..00ac705cc 100644 --- a/include/netsurf/misc.h +++ b/include/netsurf/misc.h @@ -22,12 +22,12 @@ * Interface to platform-specific miscellaneous browser operation table. */ -#ifndef _NETSURF_MISC_H_ -#define _NETSURF_MISC_H_ +#ifndef NETSURF_MISC_H_ +#define NETSURF_MISC_H_ struct form_control; struct gui_window; -struct ssl_cert_info; +struct cert_chain; struct nsurl; /** @@ -57,17 +57,6 @@ struct gui_misc_table { */ nserror (*schedule)(int t, void (*callback)(void *p), void *p); - /** - * Warn the user of an event. - * - * \param[in] message A warning looked up in the message - * translation table - * \param[in] detail Additional text to be displayed or NULL. - * \return NSERROR_OK on success or error code if there was a - * faliure displaying the message to the user. - */ - nserror (*warning)(const char *message, const char *detail); - /* Optional entries */ @@ -82,28 +71,59 @@ struct gui_misc_table { nserror (*launch_url)(struct nsurl *url); /** - * Prompt the user to verify a certificate with issuse. + * Retrieve username/password for a given url+realm if there is one + * stored in a frontend-specific way (e.g. gnome-keyring) + * + * To respond, call the callback with the url, realm, username, + * and password. Pass "" if the empty string + * is required. + * + * To keep hold of the url, remember to nsurl_ref() it, and to keep + * the realm, you will need to strdup() it. + * + * If the front end returns NSERROR_OK for this function, they may, + * at some future time, call the `cb` with `cbpw` callback exactly once. + * + * If the front end returns other than NSERROR_OK, they should not + * call the `cb` callback. + * + * The callback should not be called immediately upon receipt of this + * call as the browser window may not be reentered. * - * \param url The URL being verified. - * \param certs The certificate to be verified - * \param num The number of certificates to be verified. - * \param cb Callback upon user decision. - * \param cbpw Context pointer passed to cb + * **NOTE** The lifetime of the cbpw is not well defined. In general + * do not use the cb if *any* browser window has navigated or been + * destroyed. + * + * \param url The URL being verified. + * \param realm The authorization realm. + * \param username Any current username (or empty string). + * \param password Any current password (or empty string). + * \param cb Callback upon user decision. + * \param cbpw Context pointer passed to cb * \return NSERROR_OK on sucess else error and cb never called */ - nserror (*cert_verify)(struct nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror (*cb)(bool proceed, void *pw), void *cbpw); - - /** - * Prompt user for login - */ - void (*login)(struct nsurl *url, const char *realm, - nserror (*cb)(bool proceed, void *pw), void *cbpw); + nserror (*login)(struct nsurl *url, const char *realm, + const char *username, const char *password, + nserror (*cb)(struct nsurl *url, + const char *realm, + const char *username, + const char *password, + void *pw), + void *cbpw); /** * Prompt the user for a password for a PDF. */ void (*pdf_password)(char **owner_pass, char **user_pass, char *path); + /** + * Request that the cookie manager be displayed + * + * \param search_term The search term to be set (NULL if no search) + * + * \return NSERROR_OK on success + */ + nserror (*present_cookies)(const char *search_term); }; #endif |