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

« back to all changes in this revision

Viewing changes to src/item_loader.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_loader.h   Interface for asynchronous item loading
 
3
 *
 
4
 * Copyright (C) 2011 Lars Lindner <lars.lindner@gmail.com>
 
5
 *
 
6
 * This program 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; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
 
 
21
#ifndef _ITEM_LOADER_H
 
22
#define _ITEM_LOADER_H
 
23
 
 
24
#include <glib-object.h>
 
25
 
 
26
#include "node.h"
 
27
 
 
28
/* ItemLoader concept: an ItemLoader instance runs a fetch callback
 
29
   repeatedly collecting the items the fetch callback provides. One
 
30
   each fetch when there were items the loader emits a callback with
 
31
   the itemset as parameter for an item view to present. */
 
32
 
 
33
typedef struct ItemLoaderPrivate        ItemLoaderPrivate;
 
34
 
 
35
typedef struct ItemLoader {
 
36
        GObject parent;
 
37
 
 
38
        /*< private >*/
 
39
        ItemLoaderPrivate       *priv;
 
40
} ItemLoader;
 
41
 
 
42
typedef struct ItemLoaderClass {
 
43
        GObjectClass parent;
 
44
} ItemLoaderClass;
 
45
 
 
46
GType item_loader_get_type();
 
47
 
 
48
#define ITEM_LOADER_TYPE              (item_loader_get_type ())
 
49
#define ITEM_LOADER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), ITEM_LOADER_TYPE, ItemLoader))
 
50
#define ITEM_LOADER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), ITEM_LOADER_TYPE, ItemLoaderClass))
 
51
#define IS_ITEM_LOADER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), ITEM_LOADER_TYPE))
 
52
#define IS_ITEM_LOADER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), ITEM_LOADER_TYPE))
 
53
#define ITEM_LOADER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), ITEM_LOADER_TYPE, ItemLoaderClass))
 
54
 
 
55
/**
 
56
 * Definition of item loader fetch callback to be 
 
57
 * implemented by specific item loaders. This callback
 
58
 * is called multiple times to fetch item batches. The
 
59
 * batch size is determined by the specific implementation.
 
60
 * 
 
61
 * @param user_data     ItemLoader type specific data
 
62
 * @param items         Result items (to be free'd by caller)
 
63
 * 
 
64
 * @returns FALSE if loading has finished
 
65
 */
 
66
typedef gboolean (*fetchCallbackPtr)(gpointer user_data, GSList **items);
 
67
 
 
68
/**
 
69
 * Set up a new item loader with a specific fetch function.
 
70
 *
 
71
 * @param fetchCallback the item fetching function
 
72
 * @param node          the node we are loading items for
 
73
 * @param user_data     ItemLoader type specific data
 
74
 *
 
75
 * @returns the new ItemLoader instance
 
76
 */
 
77
ItemLoader * item_loader_new (fetchCallbackPtr fetchCallback, nodePtr node, gpointer user_data);
 
78
 
 
79
/**
 
80
 * Returns the node an item loader is loading items for.
 
81
 *
 
82
 * @param il            the item loader
 
83
 *
 
84
 * @returns node
 
85
 */
 
86
nodePtr item_loader_get_node (ItemLoader *il);
 
87
 
 
88
/**
 
89
 * Starts the item loader to load items with idle priority.
 
90
 *
 
91
 * @param il    the item loader
 
92
 */
 
93
void item_loader_start (ItemLoader *il);
 
94
 
 
95
#endif