Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-disco-folder.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * camel-disco-folder.h: Abstract class for a disconnectable folder
4  *
5  * Authors: Dan Winship <danw@ximian.com>
6  *
7  * Copyright 2001 Ximian, Inc.
8  *
9  * This program is free software; you can redistribute it and/or 
10  * modify it under the terms of version 2 of the GNU Lesser General Public 
11  * License as published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
21  * USA
22  */
23
24 #ifndef CAMEL_DISCO_FOLDER_H
25 #define CAMEL_DISCO_FOLDER_H 1
26
27 #include "camel-folder.h"
28
29 #define CAMEL_DISCO_FOLDER_TYPE     (camel_disco_folder_get_type ())
30 #define CAMEL_DISCO_FOLDER(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_FOLDER_TYPE, CamelDiscoFolder))
31 #define CAMEL_DISCO_FOLDER_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_FOLDER_TYPE, CamelDiscoFolderClass))
32 #define CAMEL_IS_DISCO_FOLDER(o)    (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_FOLDER_TYPE))
33
34 G_BEGIN_DECLS
35
36 enum {
37         CAMEL_DISCO_FOLDER_ARG_OFFLINE_SYNC = CAMEL_FOLDER_ARG_LAST,
38
39         CAMEL_DISCO_FOLDER_ARG_LAST = CAMEL_FOLDER_ARG_LAST + 0x100
40 };
41
42 enum {
43         CAMEL_DISCO_FOLDER_OFFLINE_SYNC = CAMEL_DISCO_FOLDER_ARG_OFFLINE_SYNC | CAMEL_ARG_BOO,
44 };
45
46 struct _CamelDiscoFolder {
47         CamelFolder parent_object;
48
49         unsigned int offline_sync:1;
50 };
51
52 typedef struct {
53         CamelFolderClass parent_class;
54
55         void (*refresh_info_online) (CamelFolder *folder, CamelException *ex);
56
57         void (*sync_online)    (CamelFolder *folder, CamelException *ex);
58         void (*sync_offline)   (CamelFolder *folder, CamelException *ex);
59         void (*sync_resyncing) (CamelFolder *folder, CamelException *ex);
60
61         void (*expunge_uids_online)    (CamelFolder *folder, GPtrArray *uids,
62                                         CamelException *ex);
63         void (*expunge_uids_offline)   (CamelFolder *folder, GPtrArray *uids,
64                                         CamelException *ex);
65         void (*expunge_uids_resyncing) (CamelFolder *folder, GPtrArray *uids,
66                                         CamelException *ex);
67
68         void (*append_online)    (CamelFolder *folder,
69                                   CamelMimeMessage *message,
70                                   const CamelMessageInfo *info,
71                                   char **appended_uid,
72                                   CamelException *ex);
73         void (*append_offline)   (CamelFolder *folder,
74                                   CamelMimeMessage *message,
75                                   const CamelMessageInfo *info,
76                                   char **appended_uid,
77                                   CamelException *ex);
78         void (*append_resyncing) (CamelFolder *folder,
79                                   CamelMimeMessage *message,
80                                   const CamelMessageInfo *info,
81                                   char **appended_uid,
82                                   CamelException *ex);
83
84         void (*transfer_online)    (CamelFolder *source, GPtrArray *uids,
85                                     CamelFolder *destination,
86                                     GPtrArray **transferred_uids,
87                                     gboolean delete_originals,
88                                     CamelException *ex);
89         void (*transfer_offline)   (CamelFolder *source, GPtrArray *uids,
90                                     CamelFolder *destination,
91                                     GPtrArray **transferred_uids,
92                                     gboolean delete_originals,
93                                     CamelException *ex);
94         void (*transfer_resyncing) (CamelFolder *source, GPtrArray *uids,
95                                     CamelFolder *destination,
96                                     GPtrArray **transferred_uids,
97                                     gboolean delete_originals,
98                                     CamelException *ex);
99
100         void (*cache_message)       (CamelDiscoFolder *disco_folder,
101                                      const char *uid, CamelException *ex);
102         void (*prepare_for_offline) (CamelDiscoFolder *disco_folder,
103                                      const char *expression,
104                                      CamelException *ex);
105
106         void (*update_uid) (CamelFolder *folder, const char *old_uid,
107                             const char *new_uid);
108 } CamelDiscoFolderClass;
109
110
111 /* public methods */
112 void camel_disco_folder_expunge_uids (CamelFolder *folder, GPtrArray *uids,
113                                       CamelException *ex);
114
115 void camel_disco_folder_cache_message       (CamelDiscoFolder *disco_folder,
116                                              const char *uid,
117                                              CamelException *ex);
118 void camel_disco_folder_prepare_for_offline (CamelDiscoFolder *disco_folder,
119                                              const char *expression,
120                                              CamelException *ex);
121
122 /* Standard Camel function */
123 CamelType camel_disco_folder_get_type (void);
124
125 G_END_DECLS
126
127 #endif /* CAMEL_DISCO_FOLDER_H */