2
* @file item_list_view.h presenting items in a GtkTreeView
4
* Copyright (C) 2004-2010 Lars Lindner <lars.lindner@gmail.com>
5
* Copyright (C) 2004-2005 Nathan J. Conrad <t98502@users.sourceforge.net>
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
17
* You should have received a copy of the GNU Library General Public License
18
* along with this library; see the file COPYING.LIB. If not, write to
19
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
* Boston, MA 02111-1307, USA.
23
#ifndef _ITEM_LIST_VIEW_H
24
#define _ITEM_LIST_VIEW_H
26
#include <glib-object.h>
31
#include "node_view.h"
33
/* This class realizes an GtkTreeView based item view. Instances
34
of ItemListView are managed by the ItemListView. This class hides
35
the GtkTreeView and implements performance optimizations. */
39
#define ITEM_LIST_VIEW_TYPE (item_list_view_get_type ())
40
#define ITEM_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ITEM_LIST_VIEW_TYPE, ItemListView))
41
#define ITEM_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ITEM_LIST_VIEW_TYPE, ItemListViewClass))
42
#define IS_ITEM_LIST_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ITEM_LIST_VIEW_TYPE))
43
#define IS_ITEM_LIST_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ITEM_LIST_VIEW_TYPE))
45
typedef struct ItemListView ItemListView;
46
typedef struct ItemListViewClass ItemListViewClass;
47
typedef struct ItemListViewPrivate ItemListViewPrivate;
54
ItemListViewPrivate *priv;
57
struct ItemListViewClass
59
GObjectClass parent_class;
62
GType item_list_view_get_type (void);
65
* Create a new ItemListView instance.
67
* @param window parent window widget
69
ItemListView * item_list_view_create (GtkWidget *window);
72
* Returns the GtkTreeView used by the ItemListView instance.
74
* @returns a GtkTreeView
76
GtkTreeView * item_list_view_get_widget (ItemListView *ilv);
79
* Checks wether the given id is in the ItemListView.
81
* @param ilv the ItemListView
82
* @param id the item id
84
* @returns TRUE if the item is in the ItemListView
86
gboolean item_list_view_contains_id (ItemListView *ilv, gulong id);
89
* Changes the sorting type (and direction).
91
* @param ilv the ItemListView
92
* @param sortType new sort type
93
* @param sortReversed TRUE for ascending order
95
void item_list_view_set_sort_column (ItemListView *ilv, nodeViewSortType sortType, gboolean sortReversed);
98
* Unselect all items in the ItemListView and scroll to top. This
99
* is typically called when changing feed.
101
* @param ilv the ItemListView
103
void item_list_view_prefocus (ItemListView *ilv);
106
* Selects the given item (if it is in the ItemListView).
108
* @param ilv the ItemListView
109
* @param item the item to select
111
void item_list_view_select (ItemListView *ilv, itemPtr item);
114
* Add an item to an ItemListView. This method is expensive and
115
* is to be used only for new items that need to be inserted
116
* by background updates.
118
* @param ilv the ItemListView
119
* @param item the item to add
121
void item_list_view_add_item (ItemListView *ilv, itemPtr item);
124
* Remove an item from an ItemListView. This method is expensive
125
* and is to be used only for items removed by background updates
126
* (usually cache drops).
128
* @param ilv the ItemListView
129
* @param item the item to remove
131
void item_list_view_remove_item (ItemListView *ilv, itemPtr item);
134
* Enable the favicon column of the currently displayed itemlist.
136
* @param ilv the ItemListView
137
* @param enabled TRUE if column is to be visible
139
void item_list_view_enable_favicon_column (ItemListView *ilv, gboolean enabled);
142
* Remove all items and resets a ItemListView.
144
* @param ilv the ItemListView
146
void item_list_view_clear (ItemListView *ilv);
149
* Update the ItemListView with the newly added items. To be called
150
* after doing a batch of item_list_view_add_item() calls.
152
* @param ilv the ItemListView
153
* @param hasEnclosures TRUE if at least one item has an enclosure
155
void item_list_view_update (ItemListView *ilv, gboolean hasEnclosures);
157
/* item list callbacks */
160
* Callback activated when an item is double-clicked. It opens the URL
161
* of the item in a web browser.
163
void on_Itemlist_row_activated (GtkTreeView *treeview,
165
GtkTreeViewColumn *column,
169
* Callback for column selection change.
171
void itemlist_sort_column_changed_cb (GtkTreeSortable *treesortable, gpointer user_data);
174
* Callback for item list selection change.
176
void on_itemlist_selection_changed (GtkTreeSelection *selection, gpointer data);
181
* Toggles the unread status of the selected item. This is called from
184
void on_toggle_unread_status (GtkMenuItem *menuitem, gpointer user_data);
187
* Toggles the flag of the selected item. This is called from a menu.
189
void on_toggle_item_flag (GtkMenuItem *menuitem, gpointer user_data);
192
* Opens the selected item in a browser.
194
void on_popup_launchitem_selected (void);
197
* Opens the selected item in a browser.
199
void on_popup_launchitem_in_tab_selected (void);
202
* Toggles the read status of right-clicked item.
204
void on_popup_toggle_read (void);
207
* Toggles the flag of right-clicked item.
209
void on_popup_toggle_flag (void);
212
* Removes all items from the selected feed.
214
* @param menuitem The menuitem that was selected.
215
* @param user_data Unused.
217
void on_remove_items_activate (GtkMenuItem *menuitem, gpointer user_data);
220
* Removes the selected item from the selected feed.
222
* @param menuitem The menuitem that was selected.
223
* @param user_data Unused.
225
void on_remove_item_activate (GtkMenuItem *menuitem, gpointer user_data);
227
void on_popup_remove_selected (void);
230
* Finds and selects the next unread item starting at the given
231
* item in a ItemListView according to the current GtkTreeView sorting order.
233
* @param ilv the ItemListView
234
* @param startId 0 or the item id to start from
236
* @returns unread item (or NULL)
238
itemPtr item_list_view_find_unread_item (ItemListView *ilv, gulong startId);
241
* Searches the displayed feed and then all feeds for an unread
242
* item. If one it found, it is displayed.
244
* @param menuitem The menuitem that was selected.
245
* @param user_data Unused.
247
void on_next_unread_item_activate (GtkMenuItem *menuitem, gpointer user_data);
249
void on_popup_next_unread_item_selected(gpointer callback_data, guint callback_action, GtkWidget *widget);
251
void on_nextbtn_clicked(GtkButton *button, gpointer user_data);
254
* Update a single item of a ItemListView
256
* @param ilv the ItemListView
257
* @param item the item
259
void item_list_view_update_item (ItemListView *ilv, itemPtr item);
262
* Update all items of the ItemListView. To be used after
263
* initial batch loading.
265
* @param ilv the ItemListView
267
void item_list_view_update_all_items (ItemListView *ilv);
270
* Copies the selected items URL to the clipboard.
272
void on_popup_copy_URL_clipboard (void);
274
void on_popup_social_bm_item_selected (void);