NetSurf
toolbar.h
Go to the documentation of this file.
1/*
2 * Copyright 2009 Mark Benjamin <netsurf-browser.org.MarkBenjamin@dfgh.net>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef NETSURF_GTK_TOOLBAR_H_
20#define NETSURF_GTK_TOOLBAR_H_
21
22/**
23 * control toolbar context
24 */
25struct nsgtk_toolbar;
27
28/**
29 * create a control toolbar
30 *
31 * \param[in] builder The gtk builder object the toolbar is being created from
32 * \param[out] toolbar a pointer to receive the result.
33 * \return NSERROR_OK and toolbar updated on success else error code
34 */
36 struct browser_window *(*get_bw)(void *ctx),
37 void *get_bw_ctx,
38 bool want_location_focus,
39 struct nsgtk_toolbar **toolbar);
40
41
42/**
43 * Update the toolbar items being shown based on current settings
44 *
45 * \param toolbar A toolbar returned from a creation
46 * \return NSERROR_OK on success
47 */
49
50
51/**
52 * Update toolbar style and size based on current settings
53 *
54 * \param toolbar A toolbar returned from a creation
55 * \return NSERROR_OK on success
56 */
58
59
60/**
61 * Start or stop a throbber in a toolbar
62 *
63 * \param toolbar A toolbar returned from a creation
64 * \param active True if the throbber animation should play.
65 * \return NSERROR_OK on success
66 */
67nserror nsgtk_toolbar_throbber(struct nsgtk_toolbar *tb, bool active);
68
69
70/**
71 * Page info has changed state
72 *
73 * \param toolbar A toolbar returned from a creation
74 * \return NSERROR_OK on success
75 */
77
78
79/**
80 * Update the toolbar url entry
81 *
82 * \param toolbar A toolbar returned from a creation
83 * \param url The URL to set
84 * \return NSERROR_OK on success
85 */
87
88
89/**
90 * set the websearch image
91 *
92 * \param toolbar A toolbar returned from a creation
93 * \param pixbuf The pixel buffer data to use to set the web search icon
94 * \return NSERROR_OK on success
95 */
96nserror nsgtk_toolbar_set_websearch_image(struct nsgtk_toolbar *tb, GdkPixbuf *pixbuf);
97
98
99/**
100 * activate the handler for a toolbar item
101 *
102 * This allows the same action to be performed for menu enties as if
103 * the user had clicked the toolbar widget.
104 *
105 * \param toolbar A toolbar returned from a creation
106 * \param itemid the id of the item to activate
107 * \return NSERROR_OK on success
108 */
110
111/**
112 * set the toolbar to be shown or hidden
113 *
114 * \param toolbar A toolbar returned from a creation
115 * \param show true to show the toolbar and false to hide it.
116 * \return NSERROR_OK on success
117 */
118nserror nsgtk_toolbar_show(struct nsgtk_toolbar *tb, bool show);
119
120/**
121 * position the page info window appropriately
122 *
123 * \param tb The toolbar to position relative to
124 * \param win The page-info window to position
125 */
127 struct nsgtk_pi_window *win);
128
129/**
130 * position the local history window appropriately
131 *
132 * \param tb The toolbar to position relative to
133 */
135
136/**
137 * Initialise customization of toolbar entries
138 */
140
141
142#endif
nserror
Enumeration of error codes.
Definition: errors.h:29
void nsgtk_toolbar_customization_init(struct nsgtk_scaffolding *g)
Initialise customization of toolbar entries.
nserror nsgtk_toolbar_item_activate(struct nsgtk_toolbar *tb, nsgtk_toolbar_button itemid)
activate the handler for a toolbar item
Definition: toolbar.c:3740
nserror nsgtk_toolbar_restyle(struct nsgtk_toolbar *tb)
Update toolbar style and size based on current settings.
Definition: toolbar.c:3505
nserror nsgtk_toolbar_set_websearch_image(struct nsgtk_toolbar *tb, GdkPixbuf *pixbuf)
set the websearch image
Definition: toolbar.c:3713
nserror nsgtk_toolbar_set_url(struct nsgtk_toolbar *tb, nsurl *url)
Update the toolbar url entry.
Definition: toolbar.c:3662
nserror nsgtk_toolbar_create(GtkBuilder *builder, struct browser_window *(*get_bw)(void *ctx), void *get_bw_ctx, bool want_location_focus, struct nsgtk_toolbar **toolbar)
create a control toolbar
Definition: toolbar.c:3447
nserror nsgtk_toolbar_position_page_info(struct nsgtk_toolbar *tb, struct nsgtk_pi_window *win)
position the page info window appropriately
Definition: toolbar.c:3857
nserror nsgtk_toolbar_position_local_history(struct nsgtk_toolbar *tb)
position the local history window appropriately
Definition: toolbar.c:3874
nserror nsgtk_toolbar_page_info_change(struct nsgtk_toolbar *tb)
Page info has changed state.
Definition: toolbar.c:3607
nserror nsgtk_toolbar_show(struct nsgtk_toolbar *tb, bool show)
set the toolbar to be shown or hidden
Definition: toolbar.c:3771
nserror nsgtk_toolbar_update(struct nsgtk_toolbar *tb)
Update the toolbar items being shown based on current settings.
Definition: toolbar.c:3783
nserror nsgtk_toolbar_throbber(struct nsgtk_toolbar *tb, bool active)
Start or stop a throbber in a toolbar.
Definition: toolbar.c:3550
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
Browser window data.
GTK certificate viewing window context.
Definition: page_info.c:47
Core scaffolding structure.
Definition: scaffolding.c:64
GtkBuilder * builder
Builder object scaffold was created from.
Definition: scaffolding.c:72
control toolbar context
Definition: toolbar.c:170
nsgtk_toolbar_button
Definition: toolbar_items.h:22