~ubuntu-branches/ubuntu/vivid/liferea/vivid-proposed

« back to all changes in this revision

Viewing changes to src/ui/item_list_view.h

  • Committer: Package Import Robot
  • Author(s): bojo42
  • Date: 2012-03-29 14:17:21 UTC
  • mfrom: (1.3.9) (3.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20120329141721-tbfopcrc5797wxt7
Tags: 1.8.3-0.1ubuntu1
* New upstream release (LP: #290666, #371754, #741543, #716688)
* Merge from Debian unstable (LP: #935147), remaining changes:
* debian/patches:
  - drop gtk-status-icon.patch & notification-append as in upstream
  - drop fix_systray_behavior as mostly upstreamed and rest seems unused
  - 01_ubuntu_feedlists: update & rename, move planets to "Open Source"  
  - add_X-Ubuntu-Gettext-Domain: rebase
  - libunity.patch: rebase, apply before indicator patch (liferea_shell.c)
  - libindicate_increase_version.patch: exclude from libindicate.patch
  - deactivate libindicate.patch, seems partly upstreamed and needs rework
* debian/control: libindicate-dev, libindicate-gtk-dev & libunity-dev
* debian/liferea.indicate & liferea.install: ship indicator desktop file
* debian/rules: enable libindicate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file item_list_view.h  presenting items in a GtkTreeView
 
3
 *
 
4
 * Copyright (C) 2004-2010 Lars Lindner <lars.lindner@gmail.com>
 
5
 * Copyright (C) 2004-2005 Nathan J. Conrad <t98502@users.sourceforge.net>
 
6
 *            
 
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.
 
11
 * 
 
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.
 
16
 * 
 
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.
 
21
 */
 
22
 
 
23
#ifndef _ITEM_LIST_VIEW_H
 
24
#define _ITEM_LIST_VIEW_H
 
25
 
 
26
#include <glib-object.h>
 
27
#include <glib.h>
 
28
#include <gtk/gtk.h>
 
29
 
 
30
#include "item.h"
 
31
#include "node_view.h"
 
32
 
 
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. */
 
36
 
 
37
G_BEGIN_DECLS
 
38
 
 
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))
 
44
 
 
45
typedef struct ItemListView             ItemListView;
 
46
typedef struct ItemListViewClass        ItemListViewClass;
 
47
typedef struct ItemListViewPrivate      ItemListViewPrivate;
 
48
 
 
49
struct ItemListView
 
50
{
 
51
        GObject         parent;
 
52
        
 
53
        /*< private >*/
 
54
        ItemListViewPrivate     *priv;
 
55
};
 
56
 
 
57
struct ItemListViewClass 
 
58
{
 
59
        GObjectClass parent_class;      
 
60
};
 
61
 
 
62
GType item_list_view_get_type (void);
 
63
 
 
64
/**
 
65
 * Create a new ItemListView instance.
 
66
 *
 
67
 * @param window        parent window widget
 
68
 */
 
69
ItemListView * item_list_view_create (GtkWidget *window);
 
70
 
 
71
/**
 
72
 * Returns the GtkTreeView used by the ItemListView instance.
 
73
 *
 
74
 * @returns a GtkTreeView
 
75
 */
 
76
GtkTreeView * item_list_view_get_widget (ItemListView *ilv);
 
77
 
 
78
/**
 
79
 * Checks wether the given id is in the ItemListView.
 
80
 *
 
81
 * @param ilv   the ItemListView
 
82
 * @param id    the item id
 
83
 *
 
84
 * @returns TRUE if the item is in the ItemListView
 
85
 */
 
86
gboolean item_list_view_contains_id (ItemListView *ilv, gulong id);
 
87
 
 
88
/**
 
89
 * Changes the sorting type (and direction).
 
90
 *
 
91
 * @param ilv           the ItemListView
 
92
 * @param sortType      new sort type
 
93
 * @param sortReversed  TRUE for ascending order
 
94
 */
 
95
void item_list_view_set_sort_column (ItemListView *ilv, nodeViewSortType sortType, gboolean sortReversed);
 
96
 
 
97
/**
 
98
 * Unselect all items in the ItemListView and scroll to top. This 
 
99
 * is typically called when changing feed.
 
100
 *
 
101
 * @param ilv   the ItemListView
 
102
 */
 
103
void item_list_view_prefocus (ItemListView *ilv);
 
104
 
 
105
/**
 
106
 * Selects the given item (if it is in the ItemListView).
 
107
 *
 
108
 * @param ilv   the ItemListView
 
109
 * @param item  the item to select
 
110
 */
 
111
void item_list_view_select (ItemListView *ilv, itemPtr item);
 
112
 
 
113
/**
 
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.
 
117
 *
 
118
 * @param ilv   the ItemListView
 
119
 * @param item  the item to add
 
120
 */
 
121
void item_list_view_add_item (ItemListView *ilv, itemPtr item);
 
122
 
 
123
/**
 
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).
 
127
 *
 
128
 * @param ilv   the ItemListView
 
129
 * @param item  the item to remove
 
130
 */
 
131
void item_list_view_remove_item (ItemListView *ilv, itemPtr item);
 
132
 
 
133
/**
 
134
 * Enable the favicon column of the currently displayed itemlist.
 
135
 *
 
136
 * @param ilv           the ItemListView
 
137
 * @param enabled       TRUE if column is to be visible
 
138
 */
 
139
void item_list_view_enable_favicon_column (ItemListView *ilv, gboolean enabled);
 
140
 
 
141
/**
 
142
 * Remove all items and resets a ItemListView.
 
143
 *
 
144
 * @param ilv   the ItemListView
 
145
 */
 
146
void item_list_view_clear (ItemListView *ilv);
 
147
 
 
148
/**
 
149
 * Update the ItemListView with the newly added items. To be called
 
150
 * after doing a batch of item_list_view_add_item() calls.
 
151
 *
 
152
 * @param ilv   the ItemListView
 
153
 * @param hasEnclosures TRUE if at least one item has an enclosure
 
154
 */
 
155
void item_list_view_update (ItemListView *ilv, gboolean hasEnclosures);
 
156
 
 
157
/* item list callbacks */
 
158
 
 
159
/**
 
160
 * Callback activated when an item is double-clicked. It opens the URL
 
161
 * of the item in a web browser.
 
162
 */
 
163
void on_Itemlist_row_activated (GtkTreeView     *treeview,
 
164
                                GtkTreePath     *path,
 
165
                                GtkTreeViewColumn *column,
 
166
                                gpointer         user_data);
 
167
 
 
168
/**
 
169
 * Callback for column selection change.
 
170
 */
 
171
void itemlist_sort_column_changed_cb (GtkTreeSortable *treesortable, gpointer user_data);
 
172
 
 
173
/**
 
174
 * Callback for item list selection change.
 
175
 */
 
176
void on_itemlist_selection_changed (GtkTreeSelection *selection, gpointer data);
 
177
 
 
178
/* menu callbacks */
 
179
 
 
180
/**
 
181
 * Toggles the unread status of the selected item. This is called from
 
182
 * a menu.
 
183
 */
 
184
void on_toggle_unread_status (GtkMenuItem *menuitem, gpointer user_data);
 
185
 
 
186
/**
 
187
 * Toggles the flag of the selected item. This is called from a menu.
 
188
 */
 
189
void on_toggle_item_flag (GtkMenuItem *menuitem, gpointer user_data);
 
190
 
 
191
/**
 
192
 * Opens the selected item in a browser.
 
193
 */
 
194
void on_popup_launchitem_selected (void);
 
195
 
 
196
/**
 
197
 * Opens the selected item in a browser.
 
198
 */
 
199
void on_popup_launchitem_in_tab_selected (void);
 
200
 
 
201
/**
 
202
 * Toggles the read status of right-clicked item.
 
203
 */
 
204
void on_popup_toggle_read (void);
 
205
 
 
206
/**
 
207
 * Toggles the flag of right-clicked item.
 
208
 */
 
209
void on_popup_toggle_flag (void);
 
210
 
 
211
/**
 
212
 * Removes all items from the selected feed.
 
213
 *
 
214
 * @param menuitem The menuitem that was selected.
 
215
 * @param user_data Unused.
 
216
 */
 
217
void on_remove_items_activate (GtkMenuItem *menuitem, gpointer user_data);
 
218
 
 
219
/**
 
220
 * Removes the selected item from the selected feed.
 
221
 *
 
222
 * @param menuitem The menuitem that was selected.
 
223
 * @param user_data Unused.
 
224
 */  
 
225
void on_remove_item_activate (GtkMenuItem *menuitem, gpointer user_data);
 
226
 
 
227
void on_popup_remove_selected (void);
 
228
 
 
229
/**
 
230
 * Finds and selects the next unread item starting at the given
 
231
 * item in a ItemListView according to the current GtkTreeView sorting order.
 
232
 *
 
233
 * @param ilv           the ItemListView
 
234
 * @param startId       0 or the item id to start from
 
235
 *
 
236
 * @returns unread item (or NULL)
 
237
 */
 
238
itemPtr item_list_view_find_unread_item (ItemListView *ilv, gulong startId);
 
239
 
 
240
/**
 
241
 * Searches the displayed feed and then all feeds for an unread
 
242
 * item. If one it found, it is displayed.
 
243
 *
 
244
 * @param menuitem The menuitem that was selected.
 
245
 * @param user_data Unused.
 
246
 */
 
247
void on_next_unread_item_activate (GtkMenuItem *menuitem, gpointer user_data);
 
248
 
 
249
void on_popup_next_unread_item_selected(gpointer callback_data, guint callback_action, GtkWidget *widget);
 
250
 
 
251
void on_nextbtn_clicked(GtkButton *button, gpointer user_data);
 
252
 
 
253
/**
 
254
 * Update a single item of a ItemListView
 
255
 *
 
256
 * @param ilv   the ItemListView
 
257
 * @param item  the item
 
258
 */
 
259
void item_list_view_update_item (ItemListView *ilv, itemPtr item);
 
260
 
 
261
/**
 
262
 * Update all items of the ItemListView. To be used after 
 
263
 * initial batch loading.
 
264
 *
 
265
 * @param ilv   the ItemListView
 
266
 */
 
267
void item_list_view_update_all_items (ItemListView *ilv);
 
268
 
 
269
/**
 
270
 * Copies the selected items URL to the clipboard.
 
271
 */
 
272
void on_popup_copy_URL_clipboard (void);
 
273
 
 
274
void on_popup_social_bm_item_selected (void);
 
275
 
 
276
#endif