00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _NNTPGRAB_GLUE_H_
00020 #define _NNTPGRAB_GLUE_H_
00021
00022 #include "nntpgrab_types.h"
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 #define NNTPGRAB_GLUE_VERSION 20090505
00029
00030 typedef struct NNTPGrabGlue NNTPGrabGlue;
00031 typedef struct NNTPGrabGlueClass NNTPGrabGlueClass;
00032
00041 NNTPGrabGlue *nntpgrab_glue_init(int glue_version, char **err);
00042
00048 void nntpgrab_glue_cleanup(NNTPGrabGlue *obj);
00049
00057 void
00058 nntpgrab_glue_kill_server(NNTPGrabGlue *obj);
00059
00075 ngboolean nntpgrab_glue_connect(NNTPGrabGlue *obj, const char *hostname, int port, const char *username, const char *password, ngboolean use_ssl, char **err, char **warnings);
00076
00082 ngboolean nntpgrab_glue_get_is_connected(NNTPGrabGlue *obj);
00083
00089 ngboolean nntpgrab_glue_get_is_standalone(NNTPGrabGlue *core);
00090
00097 NGList *nntpgrab_config_get_avail_servers(NNTPGrabGlue *obj);
00098
00105 void nntpgrab_config_free_avail_servers(NNTPGrabGlue *obj, NGList *servers);
00106
00115 ngboolean nntpgrab_config_get_server_info(NNTPGrabGlue *obj, const char *servername, ConfigServer *server);
00116
00125 ngboolean nntpgrab_config_add_server(NNTPGrabGlue *obj, ConfigServer new_server, char **errmsg);
00126
00135 ngboolean nntpgrab_config_del_server(NNTPGrabGlue *obj, const char *servername, char **errmsg);
00136
00146 ngboolean nntpgrab_config_edit_server(NNTPGrabGlue *obj, const char *servername, ConfigServer server, char **errmsg);
00147
00154 ConfigOpts nntpgrab_config_get_opts(NNTPGrabGlue *obj);
00155
00162 void nntpgrab_config_set_opts(NNTPGrabGlue *obj, ConfigOpts opts);
00163
00172 ngboolean nntpgrab_config_get_folder_listing(NNTPGrabGlue *obj, const char *parent, NGList **folders);
00173
00180 void nntpgrab_config_free_folder_listing(NNTPGrabGlue *obj, NGList *folders);
00181
00188 ngboolean nntpgrab_schedular_start(NNTPGrabGlue *obj);
00189
00197 ngboolean nntpgrab_schedular_stop(NNTPGrabGlue *obj, ngboolean wait);
00198
00205 SchedularState nntpgrab_schedular_get_state(NNTPGrabGlue *obj);
00206
00221 ngboolean nntpgrab_schedular_add_task_to_queue(NNTPGrabGlue *obj, const char *collection_name, const char *subject, const char *poster, time_t stamp, nguint64 file_size, NGList *groups, NGList *parts, char **errmsg);
00222
00232 ngboolean nntpgrab_schedular_del_task_from_queue(NNTPGrabGlue *obj, const char *collection_name, const char *subject, char **errmsg);
00233
00243 ngboolean nntpgrab_schedular_restart_task(NNTPGrabGlue *obj, const char *collection_name, const char *subject, char **errmsg);
00244
00254 ngboolean nntpgrab_schedular_save_queue(NNTPGrabGlue *obj, char **errmsg);
00255
00265 void nntpgrab_schedular_foreach_task(NNTPGrabGlue *obj, ForeachCollectionFunc collection_func, ForeachFileFunc file_func, ForeachGroupFunc group_func, void *data);
00266
00277 ngboolean nntpgrab_schedular_move_task(NNTPGrabGlue *obj, const char *collection_name_src, const char *subject_src, const char *collection_name_dest, int position_dest);
00278
00287 ngboolean nntpgrab_schedular_move_collection(NNTPGrabGlue *obj, const char *collection_name, int new_position);
00288
00289 #ifdef __cplusplus
00290 }
00291 #endif
00292
00293 #endif