Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-disco-diary.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * camel-disco-diary.h: class for logging disconnected operation
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_DIARY_H
25 #define CAMEL_DISCO_DIARY_H 1
26
27 #include "camel-object.h"
28 #include <stdarg.h>
29 #include <stdio.h>
30
31 #define CAMEL_DISCO_DIARY_TYPE     (camel_disco_diary_get_type ())
32 #define CAMEL_DISCO_DIARY(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_DISCO_DIARY_TYPE, CamelDiscoDiary))
33 #define CAMEL_DISCO_DIARY_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_DIARY_TYPE, CamelDiscoDiaryClass))
34 #define CAMEL_IS_DISCO_DIARY(o)    (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_DIARY_TYPE))
35
36 G_BEGIN_DECLS
37
38 typedef enum {
39         CAMEL_DISCO_DIARY_END = 0,
40
41         CAMEL_DISCO_DIARY_FOLDER_EXPUNGE,
42         CAMEL_DISCO_DIARY_FOLDER_APPEND,
43         CAMEL_DISCO_DIARY_FOLDER_TRANSFER,
44 } CamelDiscoDiaryAction;
45
46 typedef enum {
47         CAMEL_DISCO_DIARY_ARG_NONE = 0,
48
49         CAMEL_DISCO_DIARY_ARG_FOLDER,
50         CAMEL_DISCO_DIARY_ARG_UID,
51         CAMEL_DISCO_DIARY_ARG_UID_LIST
52 } CamelDiscoDiaryArgType;
53
54 struct _CamelDiscoDiary {
55         CamelObject parent_object;
56
57         CamelDiscoStore *store;
58         FILE *file;
59         GHashTable *folders, *uidmap;
60 };
61
62 typedef struct {
63         CamelObjectClass parent_class;
64
65 } CamelDiscoDiaryClass;
66
67
68 /* public methods */
69 CamelDiscoDiary *camel_disco_diary_new    (CamelDiscoStore *store,
70                                            const char *filename,
71                                            CamelException *ex);
72
73 gboolean         camel_disco_diary_empty  (CamelDiscoDiary *diary);
74
75 void             camel_disco_diary_log    (CamelDiscoDiary *diary,
76                                            CamelDiscoDiaryAction action,
77                                            ...);
78 void             camel_disco_diary_replay (CamelDiscoDiary *diary,
79                                            CamelException *ex);
80
81 /* Temporary->Permanent UID map stuff */
82 void        camel_disco_diary_uidmap_add    (CamelDiscoDiary *diary,
83                                              const char *old_uid,
84                                              const char *new_uid);
85 const char *camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary,
86                                              const char *uid);
87
88 /* Standard Camel function */
89 CamelType camel_disco_diary_get_type (void);
90
91 G_END_DECLS
92
93 #endif /* CAMEL_DISCO_DIARY_H */