1 /******************************************************************************/
3 /* GPL license, Copyright (c) 2005-2006 by: */
6 /* Michael Dominic K. <michaldominik@gmail.com> */
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 */
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. */
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. */
22 /******************************************************************************/
24 #ifndef __NFLICKWORKER_H__
25 #define __NFLICKWORKER_H__
29 #include "nflick-api-response.h"
30 #include "nflick-types.h"
35 NFlickWorkerPrivate *Private;
38 struct _NFlickWorkerClass
40 GObjectClass ParentClass;
41 NFlickWorkerThreadFunc ThreadFunc;
44 GType nflick_worker_get_type (void);
46 void nflick_worker_start (NFlickWorker *self);
48 void nflick_worker_set_error (NFlickWorker *self, const gchar *error);
50 void nflick_worker_set_custom_data (NFlickWorker *self, gpointer data);
52 void nflick_worker_set_aborted_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
54 void nflick_worker_set_ok_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
56 void nflick_worker_set_error_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
58 void nflick_worker_set_msg_change_idle (NFlickWorker *self, NFlickWorkerIdleFunc func);
60 void nflick_worker_set_message (NFlickWorker *self, const gchar *msg);
62 void nflick_worker_request_abort (NFlickWorker *self);
64 gboolean nflick_worker_is_aborted (NFlickWorker *self);
66 void nflick_worker_set_network_error (NFlickWorker *self);
68 gboolean nflick_worker_parse_api_response (NFlickWorker *self, NFlickApiResponse *response);