NetSurf
Typedefs | Functions
browser_history.h File Reference

Interface to browser history operations. More...

#include <stdbool.h>
#include "utils/errors.h"
Include dependency graph for browser_history.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef bool(* browser_window_history_enumerate_cb) (const struct browser_window *bw, int x0, int y0, int x1, int y1, const struct history_entry *entry, void *user_data)
 Callback function type for history enumeration. More...
 

Functions

nserror browser_window_history_back (struct browser_window *bw, bool new_window)
 Go back in the history. More...
 
nserror browser_window_history_forward (struct browser_window *bw, bool new_window)
 Go forward in the history. More...
 
bool browser_window_history_back_available (struct browser_window *bw)
 Check whether it is pssible to go back in the history. More...
 
bool browser_window_history_forward_available (struct browser_window *bw)
 Check whether it is pssible to go forwards in the history. More...
 
nserror browser_window_history_get_thumbnail (struct browser_window *bw, struct bitmap **bitmap_out)
 Get the thumbnail bitmap for the current history entry. More...
 
void browser_window_history_enumerate (const struct browser_window *bw, browser_window_history_enumerate_cb cb, void *user_data)
 Enumerate all entries in the history. More...
 
void browser_window_history_enumerate_forward (const struct browser_window *bw, browser_window_history_enumerate_cb cb, void *user_data)
 Enumerate all entries that will be reached by the 'forward' button. More...
 
void browser_window_history_enumerate_back (const struct browser_window *bw, browser_window_history_enumerate_cb cb, void *user_data)
 Enumerate all entries that will be reached by the 'back' button. More...
 
struct nsurlbrowser_window_history_entry_get_url (const struct history_entry *entry)
 Returns the URL to a history entry. More...
 
const char * browser_window_history_entry_get_fragment_id (const struct history_entry *entry)
 Returns the URL to a history entry. More...
 
const char * browser_window_history_entry_get_title (const struct history_entry *entry)
 Returns the title of a history entry. More...
 
nserror browser_window_history_go (struct browser_window *bw, struct history_entry *entry, bool new_window)
 Navigate to specified history entry, optionally in new window. More...
 

Detailed Description

Interface to browser history operations.

The are operations on a browsing contexts history. These interfaces allow navigation forward and backwards in the history as well as enumerating the entries.

The local history viewing is distinct via corewindow defined in desktop/local_history.h

Definition in file browser_history.h.

Typedef Documentation

◆ browser_window_history_enumerate_cb

typedef bool(* browser_window_history_enumerate_cb) (const struct browser_window *bw, int x0, int y0, int x1, int y1, const struct history_entry *entry, void *user_data)

Callback function type for history enumeration.

Parameters
bwThe browser window with history being enumerated
x0,y0,x1,y1Coordinates of entry in history tree view
entryCurrent history entry
Returns
true to continue enumeration, false to cancel enumeration

Definition at line 96 of file browser_history.h.

Function Documentation

◆ browser_window_history_back()

nserror browser_window_history_back ( struct browser_window bw,
bool  new_window 
)

Go back in the history.

Parameters
bwA browser window to navigate the history in.
new_windowwhether to open in new window.
Returns
NSERROR_OK or error code on faliure.

Definition at line 518 of file browser_history.c.

References history_entry::back, browser_window__reload_current_parameters(), browser_window_history_go(), browser_window_navigate(), BW_NAVIGATE_HISTORY, history::current, browser_window::current_parameters, browser_window::history, browser_window::internal_nav, NSERROR_BAD_PARAMETER, and browser_fetch_parameters::url.

Referenced by ami_gui_history(), back_button_clicked_cb(), fb_leftarrow_click(), mouse_action_drag_none(), nsbeos_scaffolding_dispatch_event(), nsws_window_command(), ro_gui_window_menu_select(), ro_gui_window_toolbar_click(), and toolbar_back_click().

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

◆ browser_window_history_back_available()

bool browser_window_history_back_available ( struct browser_window bw)

Check whether it is pssible to go back in the history.

Parameters
bwA browser window to check the history navigation in.
Returns
true if the history can go back, false otherwise

Definition at line 562 of file browser_history.c.

References history_entry::back, history::current, and browser_window::history.

Referenced by back_button_clicked_cb(), browser_window_back_available(), forward_button_clicked_cb(), nsbeos_scaffolding_dispatch_event(), nsbeos_window_update_back_forward(), nsgtk_toolbar_throbber(), nsws_window_command(), nsws_window_update_forward_back(), and scaffolding_update_context().

Here is the caller graph for this function:

◆ browser_window_history_entry_get_fragment_id()

const char * browser_window_history_entry_get_fragment_id ( const struct history_entry entry)

Returns the URL to a history entry.

Parameters
entrythe history entry to retrieve the fragment id from
Returns
the fragment id

Definition at line 700 of file browser_history.c.

References history_page::frag_id, and history_entry::page.

◆ browser_window_history_entry_get_title()

const char * browser_window_history_entry_get_title ( const struct history_entry entry)

Returns the title of a history entry.

Parameters
entryThe history entry to retrieve the title from
Returns
the title

Definition at line 708 of file browser_history.c.

References history_entry::page, and history_page::title.

◆ browser_window_history_entry_get_url()

struct nsurl * browser_window_history_entry_get_url ( const struct history_entry entry)

Returns the URL to a history entry.

Parameters
entrythe history entry to retrieve the URL from
Returns
A referenced nsurl URL

Definition at line 693 of file browser_history.c.

References nsurl_ref(), history_entry::page, and history_page::url.

Here is the call graph for this function:

◆ browser_window_history_enumerate()

void browser_window_history_enumerate ( const struct browser_window bw,
browser_window_history_enumerate_cb  cb,
void *  user_data 
)

Enumerate all entries in the history.

Do not change the history while it is being enumerated.

Parameters
bwThe browser window to enumerate history of
cbcallback function
user_datacontext pointer passed to cb

Definition at line 682 of file browser_history.c.

References browser_window_history__enumerate_entry(), browser_window::history, and history::start.

Here is the call graph for this function:

◆ browser_window_history_enumerate_back()

void browser_window_history_enumerate_back ( const struct browser_window bw,
browser_window_history_enumerate_cb  cb,
void *  user_data 
)

Enumerate all entries that will be reached by the 'back' button.

Parameters
bwThe browser window to enumerate history of
cbThe callback function
user_dataData passed to the callback

Definition at line 664 of file browser_history.c.

References history_entry::back, history::current, browser_window::history, LOCAL_HISTORY_HEIGHT, LOCAL_HISTORY_WIDTH, history_entry::x, and history_entry::y.

◆ browser_window_history_enumerate_forward()

void browser_window_history_enumerate_forward ( const struct browser_window bw,
browser_window_history_enumerate_cb  cb,
void *  user_data 
)

Enumerate all entries that will be reached by the 'forward' button.

Parameters
bwThe browser window to enumerate history of
cbThe callback function
user_dataData passed to the callback

Definition at line 645 of file browser_history.c.

References history::current, history_entry::forward_pref, browser_window::history, LOCAL_HISTORY_HEIGHT, LOCAL_HISTORY_WIDTH, history_entry::x, and history_entry::y.

◆ browser_window_history_forward()

nserror browser_window_history_forward ( struct browser_window bw,
bool  new_window 
)

Go forward in the history.

Parameters
bwA browser window to navigate the history in.
new_windowwhether to open in new window.
Returns
NSERROR_OK or error code on faliure.

Definition at line 549 of file browser_history.c.

References browser_window_history_go(), history::current, history_entry::forward_pref, browser_window::history, and NSERROR_BAD_PARAMETER.

Referenced by ami_gui_history(), fb_rightarrow_click(), forward_button_clicked_cb(), mouse_action_drag_none(), nsbeos_scaffolding_dispatch_event(), nsws_window_command(), ro_gui_window_menu_select(), ro_gui_window_toolbar_click(), and toolbar_forward_click().

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

◆ browser_window_history_forward_available()

bool browser_window_history_forward_available ( struct browser_window bw)

Check whether it is pssible to go forwards in the history.

Parameters
bwA browser window to check the history navigation in.
Returns
true if the history can go forwards, false otherwise

Definition at line 570 of file browser_history.c.

References history::current, history_entry::forward_pref, and browser_window::history.

Referenced by back_button_clicked_cb(), browser_window_forward_available(), forward_button_clicked_cb(), nsbeos_scaffolding_dispatch_event(), nsbeos_window_update_back_forward(), nsgtk_toolbar_throbber(), nsws_window_command(), nsws_window_update_forward_back(), and scaffolding_update_context().

Here is the caller graph for this function:

◆ browser_window_history_get_thumbnail()

nserror browser_window_history_get_thumbnail ( struct browser_window bw,
struct bitmap **  bitmap_out 
)

Get the thumbnail bitmap for the current history entry.

Parameters
bwThe browser window
bitmapThe bitmat for the current history entry.
Returns
NSERROR_OK or error code on faliure.

Definition at line 578 of file browser_history.c.

References history_page::bitmap, bitmap(), content_get_bitmap(), history::current, browser_window::current_content, browser_window::history, NSERROR_INVALID, NSERROR_OK, and history_entry::page.

Referenced by ami_gui_event().

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

◆ browser_window_history_go()

nserror browser_window_history_go ( struct browser_window bw,
struct history_entry entry,
bool  new_window 
)

Navigate to specified history entry, optionally in new window.

Parameters
bwbrowser window
entryentry to open
new_windowopen entry in new window
Returns
NSERROR_OK or error code on faliure.

Definition at line 599 of file browser_history.c.

References browser_window_create(), browser_window_history_update(), browser_window_navigate(), BW_CREATE_CLONE, BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE, history::current, browser_window::current_content, history_page::frag_id, browser_window::history, NSERROR_OK, nsurl_ref(), nsurl_refragment(), nsurl_unref(), history_entry::page, and history_page::url.

Referenced by browser_window_history_back(), browser_window_history_forward(), local_history_keypress(), and local_history_mouse_action().

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