remove External Program settings from Common Prefs/Send
[claws.git] / src / addrquery.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 2003 Match Grun
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Functions to define an address query (a request).
22  */
23
24 #ifndef __ADDRQUERY_H__
25 #define __ADDRQUERY_H__
26
27 #include <glib.h>
28 #include <stdio.h>
29 #include <sys/time.h>
30
31 /* Query types */
32 typedef enum {
33         ADDRQUERY_NONE,
34         ADDRQUERY_LDAP
35 } AddrQueryType;
36
37 /* Address search call back function */
38 typedef gint ( AddrSearchCallbackFunc ) ( gint cacheID,
39                                           GList *listEMail,
40                                           gpointer target );
41
42 typedef void ( AddrSearchStaticFunc ) ( gint qid, AddrQueryType qty, gint status );
43
44 /* Data structures */
45 typedef struct {
46         AddrQueryType queryType;
47         gint     queryID;
48         gint     idleID;
49         gchar    *searchTerm;
50         time_t   timeStart;
51         AddrSearchStaticFunc *callBack;
52         gpointer target;
53         gpointer serverObject;
54         gpointer queryObject;
55 }
56 AddrQuery;
57
58 /* Function prototypes */
59 AddrQuery *addrqry_create       ( void );
60 void addrqry_clear              ( AddrQuery *qry );
61 void addrqry_free               ( AddrQuery *qry );
62 void addrqry_set_query_type     ( AddrQuery *qry, const AddrQueryType value );
63 void addrqry_set_idle_id        ( AddrQuery *qry, const guint value );
64 void addrqry_set_search_term    ( AddrQuery* qry, const gchar *value );
65 void addrqry_set_server         ( AddrQuery* qry, const gpointer server );
66 void addrqry_set_query          ( AddrQuery* qry, const gpointer query );
67 void addrqry_print              ( const AddrQuery *qry, FILE *stream );
68
69 void qrymgr_initialize          ( void );
70 void qrymgr_teardown            ( void );
71 AddrQuery *qrymgr_add_query(
72                 const gint queryID, const gchar *searchTerm,
73                 void *callBack, gpointer target );
74
75 AddrQuery *qrymgr_find_query    ( const gint queryID );
76 void qrymgr_delete_query        ( const gint queryID );
77 void qrymgr_print               ( FILE *stream );
78
79 #endif /* __ADDRQUERY_H__ */
80
81 /*
82 * End of Source.
83 */