NetSurf
Data Structures | Macros | Typedefs | Enumerations | Functions
query.h File Reference
#include <stdbool.h>
#include "oslib/wimp.h"
Include dependency graph for query.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  query_callback
 

Macros

#define QUERY_INVALID   ((query_id)-1)
 

Typedefs

typedef int query_id
 

Enumerations

enum  query_response { QUERY_CONTINUE , QUERY_YES , QUERY_NO , QUERY_ESCAPE }
 

Functions

query_id query_user_xy (const char *query, const char *detail, const query_callback *cb, void *pw, const char *yes, const char *no, int x, int y)
 Display a query to the user, requesting a response, at a specified screen position (x,y). More...
 
void ro_gui_query_init (void)
 
void ro_gui_query_window_bring_to_front (query_id id)
 
query_id query_user (const char *query, const char *detail, const query_callback *cb, void *pw, const char *yes, const char *no)
 Display a query to the user, requesting a response, near the current pointer position to keep the required mouse travel small, but also protecting against spurious mouse clicks. More...
 
void query_close (query_id)
 Close a query window without waiting for a response from the user. More...
 

Macro Definition Documentation

◆ QUERY_INVALID

#define QUERY_INVALID   ((query_id)-1)

Definition at line 34 of file query.h.

Typedef Documentation

◆ query_id

typedef int query_id

Definition at line 32 of file query.h.

Enumeration Type Documentation

◆ query_response

Enumerator
QUERY_CONTINUE 
QUERY_YES 
QUERY_NO 
QUERY_ESCAPE 

Definition at line 25 of file query.h.

Function Documentation

◆ query_close()

void query_close ( query_id  id)

Close a query window without waiting for a response from the user.

(should normally only be called if the user has responded in some other way of which the query window in unaware.)

Parameters
idid of query window to close

Definition at line 293 of file query.c.

References ro_gui_query_close(), ro_gui_query_window_lookup_id(), and gui_query_window::window.

Referenced by ro_gui_download_window_destroy(), ro_gui_download_window_destroy_wrapper(), and ro_gui_hotlist_remove_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_user()

query_id query_user ( const char *  query,
const char *  detail,
const query_callback cb,
void *  pw,
const char *  yes,
const char *  no 
)

Display a query to the user, requesting a response, near the current pointer position to keep the required mouse travel small, but also protecting against spurious mouse clicks.

Parameters
querymessage token of query
detailparameter used in expanding tokenised message
cbtable of callback functions to be called when user responds
pwhandle to be passed to callback functions
yestext to use for 'Yes' button' (or NULL for default)
notext to use for 'No' button (or NULL for default)
Returns
id number of the query (or QUERY_INVALID if it failed)

Definition at line 112 of file query.c.

References gui_query_window::cb, gui_query_window::pw, and query_user_xy().

Referenced by ro_gui_download_save(), ro_gui_download_window_destroy(), ro_gui_hotlist_remove_page(), and ro_gui_save_content().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_user_xy()

query_id query_user_xy ( const char *  query,
const char *  detail,
const query_callback cb,
void *  pw,
const char *  yes,
const char *  no,
int  x,
int  y 
)

Display a query to the user, requesting a response, at a specified screen position (x,y).

The window is positioned relative to the given location such that the required mouse travel is small, but non-zero for protection spurious double-clicks.

Parameters
querymessage token of query
detailparameter used in expanding tokenised message
cbtable of callback functions to be called when user responds
pwhandle to be passed to callback functions
yestext to use for 'Yes' button' (or NULL for default)
notext to use for 'No' button (or NULL for default)
xx position in screen coordinates (-1 = centred on screen)
yy position in screen coordinates (-1 = centred on screen)
Returns
id number of the query (or QUERY_INVALID if it failed)

Definition at line 142 of file query.c.

References gui_query_window::cb, gui_query_window::default_confirm, gui_query_window_list, ICON_QUERY_HELP, ICON_QUERY_MESSAGE, ICON_QUERY_NO, ICON_QUERY_YES, gui_query_window::id, max, messages_get(), gui_query_window::next, next_id, NSERROR_BAD_ENCODING, NSERROR_OK, NSLOG, gui_query_window::prev, gui_query_window::pw, QUERY_INVALID, query_no_width, query_template, query_yes_width, ro_gui_dialog_open(), ro_gui_dialog_open_xy(), ro_gui_query_apply(), ro_gui_query_click(), ro_gui_query_close(), ro_gui_set_icon_string(), ro_gui_wimp_event_register_cancel(), ro_gui_wimp_event_register_close_window(), ro_gui_wimp_event_register_mouse_click(), ro_gui_wimp_event_register_ok(), ro_gui_wimp_event_set_user_data(), ro_warn_user(), utf8_to_local_encoding(), width, and gui_query_window::window.

Referenced by query_user().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_query_init()

void ro_gui_query_init ( void  )

Definition at line 76 of file query.c.

References query_template, and ro_gui_dialog_load_template().

Referenced by gui_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_query_window_bring_to_front()

void ro_gui_query_window_bring_to_front ( query_id  id)

Definition at line 303 of file query.c.

References NSLOG, ro_gui_dialog_open(), ro_gui_query_window_lookup_id(), ro_warn_user(), and gui_query_window::window.

Referenced by ro_gui_download_window_destroy().

Here is the call graph for this function:
Here is the caller graph for this function: