NetSurf
|
Cookie Manager (interface). More...
Go to the source code of this file.
Functions | |
nserror | cookie_manager_init (void *core_window_handle) |
Initialise the cookie manager. More... | |
nserror | cookie_manager_fini (void) |
Finalise the cookie manager. More... | |
bool | cookie_manager_add (const struct cookie_data *data) |
Add/update a cookie to the viewer. More... | |
void | cookie_manager_remove (const struct cookie_data *data) |
Remove a cookie from viewer. More... | |
nserror | cookie_manager_set_search_string (const char *string) |
Set the cookie manager search string. More... | |
void | cookie_manager_redraw (int x, int y, struct rect *clip, const struct redraw_context *ctx) |
Redraw the cookies manager. More... | |
void | cookie_manager_mouse_action (enum browser_mouse_state mouse, int x, int y) |
Handles all kinds of mouse action. More... | |
bool | cookie_manager_keypress (uint32_t key) |
Key press handling. More... | |
bool | cookie_manager_has_selection (void) |
Determine whether there is a selection. More... | |
nserror | cookie_manager_expand (bool only_folders) |
Expand the treeview's nodes. More... | |
nserror | cookie_manager_contract (bool all) |
Contract the treeview's nodes. More... | |
Cookie Manager (interface).
Definition in file cookie_manager.h.
bool cookie_manager_add | ( | const struct cookie_data * | data | ) |
Add/update a cookie to the viewer.
(Called by urldb.)
data | Data of cookie being added/updated. |
Definition at line 467 of file cookie_manager.c.
References cm_ctx, cookie_manager_create_cookie_node(), cookie_manager_create_domain_folder(), cookie_manager_find_entry(), cookie_manager_find_folder(), cookie_manager_update_cookie_node(), cookie_manager_entry::data, NSERROR_OK, parent, and cookie_manager_ctx::tree.
Referenced by cookie_manager_init(), urldb_get_cookie(), and urldb_insert_cookie().
nserror cookie_manager_contract | ( | bool | all | ) |
Contract the treeview's nodes.
all | Iff false, only entries are contracted. |
Definition at line 917 of file cookie_manager.c.
References cm_ctx, cookie_manager_ctx::tree, and treeview_contract().
Referenced by cookie_menu_select(), cookie_toolbar_click(), HOOKF(), and MENUHANDLER().
nserror cookie_manager_expand | ( | bool | only_folders | ) |
Expand the treeview's nodes.
only_folders | Iff true, only folders are expanded. |
Definition at line 910 of file cookie_manager.c.
References cm_ctx, cookie_manager_ctx::tree, and treeview_expand().
Referenced by cookie_menu_select(), cookie_toolbar_click(), HOOKF(), and MENUHANDLER().
nserror cookie_manager_fini | ( | void | ) |
Finalise the cookie manager.
This destroys the cookie manager treeview and the cookie manager module's internal data. After calling this if the cookie manager is required again, cookie_manager_init must be called.
Definition at line 846 of file cookie_manager.c.
References cookie_manager_ctx::built, cm_ctx, COOKIE_M_N_FIELDS, COOKIE_M_N_VALUES, treeview_field_desc::field, cookie_manager_ctx::fields, NSERROR_OK, NSLOG, cookie_manager_ctx::tree, treeview_destroy(), treeview_fini(), treeview_field_data::value, and cookie_manager_ctx::values.
Referenced by ami_cookies_destroy(), atari_cookie_manager_finish(), nsgtk_cookies_destroy(), nsw32_cookies_finalise(), and ro_gui_cookies_finalise().
bool cookie_manager_has_selection | ( | void | ) |
Determine whether there is a selection.
Definition at line 903 of file cookie_manager.c.
References cm_ctx, cookie_manager_ctx::tree, and treeview_has_selection().
Referenced by cookie_menu_prepare(), and cookie_toolbar_update().
nserror cookie_manager_init | ( | void * | core_window_handle | ) |
Initialise the cookie manager.
This iterates through the URL database, enumerating the cookies and creates a treeview.
This must be called before any other cookie_manager_* function.
core_window_handle | The core_window in which the cookie view is shown |
Definition at line 791 of file cookie_manager.c.
References cookie_manager_ctx::built, cm_ctx, cm_tree_cb_t, COOKIE_M_N_FIELDS, cookie_manager_add(), cookie_manager_init_common_values(), cookie_manager_init_entry_fields(), cookie_manager_ctx::fields, NSERROR_OK, NSLOG, cookie_manager_ctx::tree, treeview_create(), TREEVIEW_DEL_EMPTY_DIRS, treeview_get_height(), treeview_init(), TREEVIEW_NO_MOVES, TREEVIEW_SEARCHABLE, and urldb_iterate_cookies().
Referenced by ami_cookies_present(), atari_cookie_manager_init_phase2(), nsgtk_cookies_init(), nsw32_cookie_init(), and ro_cookie_init().
bool cookie_manager_keypress | ( | uint32_t | key | ) |
Key press handling.
key | The ucs4 character codepoint |
Definition at line 896 of file cookie_manager.c.
References cm_ctx, cookie_manager_ctx::tree, and treeview_keypress().
Referenced by ami_cookies_key(), atari_cookie_manager_keypress(), cookie_key(), cookie_menu_select(), cookie_toolbar_click(), HOOKF(), MENUHANDLER(), nsgtk_cookies_key(), nsw32_cookie_key(), and ro_gui_window_menu_select().
void cookie_manager_mouse_action | ( | enum browser_mouse_state | mouse, |
int | x, | ||
int | y | ||
) |
Handles all kinds of mouse action.
mouse | The current mouse state |
x | X coordinate |
y | Y coordinate |
Definition at line 889 of file cookie_manager.c.
References cm_ctx, cookie_manager_ctx::tree, and treeview_mouse_action().
Referenced by ami_cookies_mouse(), atari_cookie_manager_mouse_action(), cookie_mouse(), nsgtk_cookies_mouse(), and nsw32_cookie_mouse().
void cookie_manager_redraw | ( | int | x, |
int | y, | ||
struct rect * | clip, | ||
const struct redraw_context * | ctx | ||
) |
Redraw the cookies manager.
x | X coordinate to render treeview at |
y | Y coordinate to render treeview at |
clip | Current clip rectangle (wrt tree origin) |
ctx | Current redraw context |
Definition at line 881 of file cookie_manager.c.
References clip(), cm_ctx, cookie_manager_ctx::tree, and treeview_redraw().
Referenced by ami_cookies_draw(), atari_cookie_manager_draw(), cookie_draw(), nsgtk_cookies_draw(), and nsw32_cookie_draw().
void cookie_manager_remove | ( | const struct cookie_data * | data | ) |
Remove a cookie from viewer.
(Called by urldb.)
data | Data of cookie being removed. |
Definition at line 511 of file cookie_manager.c.
References cm_ctx, cookie_manager_find_entry(), cookie_manager_find_folder(), cookie_manager_entry::data, cookie_manager_entry::entry, NSERROR_OK, parent, cookie_manager_ctx::tree, TREE_OPTION_NONE, and treeview_delete_node().
Referenced by urldb_insert_cookie().
nserror cookie_manager_set_search_string | ( | const char * | string | ) |
Set the cookie manager search string.
string | Sering to set as search string. |
Definition at line 543 of file cookie_manager.c.
References cm_ctx, NSERROR_NOT_FOUND, cookie_manager_ctx::tree, and treeview_set_search_string().
Referenced by ami_cookies_present(), nsgtk_cookies_present(), nsw32_cookies_present(), and ro_gui_cookies_present().