00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _NNTPGRAB_H_
00020 #define _NNTPGRAB_H_
00021
00022 #include "nntpgrab_types.h"
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 #define NNTPGRAB_API_VERSION 20090505
00029
00030 typedef struct NNTPGrabCore NNTPGrabCore;
00031 typedef struct NNTPGrabCoreClass NNTPGrabCoreClass;
00032
00044 NNTPGrabCore *nntpgrab_core_init(int version, char **err, char **warnings);
00045
00051 void nntpgrab_core_cleanup(NNTPGrabCore *obj);
00052
00059 NGList *nntpgrab_core_config_get_avail_servers(NNTPGrabCore *obj);
00060
00067 void nntpgrab_core_config_free_avail_servers(NNTPGrabCore *obj, NGList *servers);
00068
00077 ngboolean nntpgrab_core_config_get_server_info(NNTPGrabCore *obj, const char *servername, ConfigServer *server);
00078
00087 ngboolean nntpgrab_core_config_add_server(NNTPGrabCore *obj, ConfigServer new_server, char **errmsg);
00088
00097 ngboolean nntpgrab_core_config_del_server(NNTPGrabCore *obj, const char *servername, char **errmsg);
00098
00108 ngboolean nntpgrab_core_config_edit_server(NNTPGrabCore *obj, const char *servername, ConfigServer server, char **errmsg);
00109
00116 ConfigOpts nntpgrab_core_config_get_opts(NNTPGrabCore *obj);
00117
00124 void nntpgrab_core_config_set_opts(NNTPGrabCore *obj, ConfigOpts opts);
00125
00134 ngboolean nntpgrab_core_config_get_folder_listing(NNTPGrabCore *obj, const char *parent, NGList **folders);
00135
00142 void nntpgrab_core_config_free_folder_listing(NNTPGrabCore *obj, NGList *folders);
00143
00150 ngboolean nntpgrab_core_schedular_start(NNTPGrabCore *obj);
00151
00159 ngboolean nntpgrab_core_schedular_stop(NNTPGrabCore *obj, ngboolean wait);
00160
00167 SchedularState nntpgrab_core_schedular_get_state(NNTPGrabCore *obj);
00168
00183 ngboolean nntpgrab_core_schedular_add_task_to_queue(NNTPGrabCore *obj, const char *collection_name, const char *subject, const char *poster, time_t stamp, nguint64 file_size, NGList *groups, NGList *parts, char **errmsg);
00184
00194 ngboolean nntpgrab_core_schedular_del_task_from_queue(NNTPGrabCore *obj, const char *collection_name, const char *subject, char **errmsg);
00195
00205 ngboolean nntpgrab_core_schedular_restart_task(NNTPGrabCore *obj, const char *collection_name, const char *subject, char **errmsg);
00206
00216 ngboolean nntpgrab_core_schedular_save_queue(NNTPGrabCore *obj, char **errmsg);
00217
00227 void nntpgrab_core_schedular_foreach_task(NNTPGrabCore *obj, ForeachCollectionFunc collection_func, ForeachFileFunc file_func, ForeachGroupFunc group_func, void *data);
00228
00239 ngboolean nntpgrab_core_schedular_move_task(NNTPGrabCore *obj, const char *collection_name_src, const char *subject_src, const char *collection_name_dest, int position_dest);
00240
00249 ngboolean nntpgrab_core_schedular_move_collection(NNTPGrabCore *obj, const char *collection_name, int new_position);
00250
00251 #ifdef __cplusplus
00252 }
00253 #endif
00254
00255 #endif