ELinks 0.18.0
|
The user has navigated to a resource that ELinks does not display automatically because of its MIME type, and ELinks is asking what to do. More...
#include <download.h>
Public Member Functions | |
LIST_HEAD_EL (struct type_query) |
Data Fields | |
struct download | download |
After ELinks has downloaded enough of the resource to see that a type query is needed, it moves the download here and continues it while the user decides what to do. | |
struct cache_entry * | cached |
Cache entry loaded from uri. | |
struct session * | ses |
The session in which the user navigated to uri. | |
struct uri * | uri |
The URI of the resource about which ELinks is asking. | |
char * | target_frame |
The name of the frame in which the user navigated to uri. | |
char * | inpext |
input filename extension | |
char * | outext |
output filename extension | |
char * | external_handler |
Command line for an external handler, to be run when the download finishes. | |
int | block |
Whether the external handler is going to use the terminal. | |
unsigned int | cgi:1 |
Whether the resource was generated by ELinks running a local CGI program. | |
unsigned int | dgi:1 |
unsigned int | copiousoutput:1 |
mailcap entry with copiousoutput |
Related Symbols | |
(Note that these are not member symbols.) | |
static struct type_query * | find_type_query (struct session *ses) |
static struct type_query * | init_type_query (struct session *ses, struct download *download, struct cache_entry *cached) |
Prepare to ask the user what to do with a file, but don't display the window yet. | |
void | done_type_query (struct type_query *type_query) |
Cancel any download started for type_query, remove the structure from the session.type_queries list, and free it. | |
void | tp_cancel (void *data) |
The user chose "Cancel" when asked what to do with a file, or the type query was cancelled for some other reason. | |
void | tp_save (struct type_query *type_query) |
The user chose "Save" when asked what to do with a file. | |
static widget_handler_status_T | tp_show_header (struct dialog_data *dlg_data, struct widget_data *widget_data) |
The user chose "Show header" when asked what to do with a file. | |
void | tp_display (struct type_query *type_query) |
The user chose "Display" when asked what to do with a file, or she chose "Open" and there is no external handler. | |
static void | tp_open (struct type_query *type_query) |
The user chose "Open" when asked what to do with a file. | |
static void | do_type_query (struct type_query *type_query, char *ct, struct mime_handler *handler) |
int | setup_download_handler (struct session *ses, struct download *loading, struct cache_entry *cached, int frame) |
The user has navigated to a resource that ELinks does not display automatically because of its MIME type, and ELinks is asking what to do.
These structures are kept in the session.type_queries list, and destroy_session() calls done_type_query() to destroy them too.
type_query::LIST_HEAD_EL | ( | struct type_query | ) |
|
Ask the user what to do with a file.
This function does not support BitTorrent downloads. For those, query_bittorrent_dialog() must be called instead. setup_download_handler() takes care of this.
|
Cancel any download started for type_query, remove the structure from the session.type_queries list, and free it.
|
|
Prepare to ask the user what to do with a file, but don't display the window yet.
To display it, do_type_query() must be called separately. setup_download_handler() takes care of that.
|
|
The user chose "Cancel" when asked what to do with a file, or the type query was cancelled for some other reason.
do_type_query() and bittorrent_query_callback() pass this function as a done_handler_T to add_dlg_ok_button(), and tp_save() passes this function as a cancel
callback to query_file().
|
The user chose "Display" when asked what to do with a file, or she chose "Open" and there is no external handler.
do_type_query() and bittorrent_query_callback() pass this function as a done_handler_T to add_dlg_ok_button().
|
The user chose "Open" when asked what to do with a file.
Or an external handler was found and it has been configured to run without asking.
do_type_query() passes this function as a done_handler_T to add_dlg_ok_button().
|
The user chose "Save" when asked what to do with a file.
Now ask her where to save the file.
do_type_query() and bittorrent_query_callback() pass this function as a done_handler_T to add_dlg_ok_button().
|
The user chose "Show header" when asked what to do with a file.
do_type_query() passes this function as a widget_handler_T to add_dlg_button(). Unlike with add_dlg_ok_button(), pressing this button does not close the dialog box. This way, the user can first examine the header and then choose what to do.
int type_query::block |
Whether the external handler is going to use the terminal.
When ELinks displays the type query, it copies this from mime_handler.block of the default handler of the type. The user can then change the flag with a checkbox.
struct cache_entry* type_query::cached |
Cache entry loaded from uri.
Apparently used only for displaying the header.
unsigned int type_query::cgi |
Whether the resource was generated by ELinks running a local CGI program.
If the user chooses to open the resource with an external handler, ELinks normally saves the resource to a temporary file and passes the name of that to the external handler. However, if the resource is from a "file" URI that does not refer to a local CGI, then Elinks need not copy the file.
unsigned int type_query::copiousoutput |
mailcap entry with copiousoutput
unsigned int type_query::dgi |
struct download type_query::download |
After ELinks has downloaded enough of the resource to see that a type query is needed, it moves the download here and continues it while the user decides what to do.
char* type_query::external_handler |
Command line for an external handler, to be run when the download finishes.
When ELinks displays the type query, it copies this from mime_handler.program of the default handler of the type. The user can then edit the string. This string must be freed with mem_free().
char* type_query::inpext |
input filename extension
char* type_query::outext |
output filename extension
struct session* type_query::ses |
The session in which the user navigated to uri.
The type_query is in the session.type_queries list of this session.
char* type_query::target_frame |
The name of the frame in which the user navigated to uri.
If the user chooses to display the resource, it goes into this frame. This string must be freed with mem_free().
struct uri* type_query::uri |
The URI of the resource about which ELinks is asking.
This reference must be released with done_uri().