Initial Import
[profile/ivi/clutter-toys.git] / attic / fluttr / libnflick / nflick-worker.h
1 /******************************************************************************/
2 /*                                                                            */
3 /* GPL license, Copyright (c) 2005-2006 by:                                   */
4 /*                                                                            */
5 /* Authors:                                                                   */
6 /*      Michael Dominic K. <michaldominik@gmail.com>                          */
7 /*                                                                            */
8 /* This program is free software; you can redistribute it and/or modify it    */
9 /* under the terms of the GNU General Public License as published by the      */
10 /* Free Software Foundation; either version 2, or (at your option) any later  */
11 /* version.                                                                   */
12 /*                                                                            */
13 /* This program is distributed in the hope that it will be useful, but        */
14 /* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY */
15 /* or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   */
16 /* for more details.                                                          */
17 /*                                                                            */
18 /* You should have received a copy of the GNU General Public License along    */
19 /* with this program; if not, write to the Free Software Foundation, Inc., 59 */
20 /* Temple Place - Suite 330, Boston, MA 02111-1307, USA.                      */
21 /*                                                                            */
22 /******************************************************************************/
23
24 #ifndef __NFLICKWORKER_H__
25 #define __NFLICKWORKER_H__
26  
27 #include <gtk/gtk.h>
28 #include <libintl.h>
29 #include "nflick-api-response.h"
30 #include "nflick-types.h"
31
32 struct                          _NFlickWorker
33 {
34         GObject Parent;
35         NFlickWorkerPrivate *Private;
36 };
37
38 struct                          _NFlickWorkerClass 
39 {
40         GObjectClass ParentClass;
41         NFlickWorkerThreadFunc ThreadFunc;
42 };
43
44 GType                           nflick_worker_get_type (void);
45
46 void                            nflick_worker_start (NFlickWorker *self);
47
48 void                            nflick_worker_set_error (NFlickWorker *self, const gchar *error);
49
50 void                            nflick_worker_set_custom_data (NFlickWorker *self, gpointer data);
51
52 void                            nflick_worker_set_aborted_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
53
54 void                            nflick_worker_set_ok_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
55
56 void                            nflick_worker_set_error_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
57
58 void                            nflick_worker_set_msg_change_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
59
60 void                            nflick_worker_set_message (NFlickWorker *self, const gchar *msg);
61
62 void                            nflick_worker_request_abort (NFlickWorker *self);
63
64 gboolean                        nflick_worker_is_aborted (NFlickWorker *self);
65
66 void                            nflick_worker_set_network_error (NFlickWorker *self);
67
68 gboolean                        nflick_worker_parse_api_response (NFlickWorker *self, NFlickApiResponse *response);
69
70 #endif