Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[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 (C) 1999-2008 Novell, Inc. (www.novell.com)
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 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
25 #error "Only <camel/camel.h> can be included directly."
26 #endif
27
28 #ifndef CAMEL_DISABLE_DEPRECATED
29
30 #ifndef CAMEL_DISCO_DIARY_H
31 #define CAMEL_DISCO_DIARY_H
32
33 #include <stdarg.h>
34 #include <stdio.h>
35
36 #include <camel/camel-disco-store.h>
37
38 /* Standard GObject macros */
39 #define CAMEL_TYPE_DISCO_DIARY \
40         (camel_disco_diary_get_type ())
41 #define CAMEL_DISCO_DIARY(obj) \
42         (G_TYPE_CHECK_INSTANCE_CAST \
43         ((obj), CAMEL_TYPE_DISCO_DIARY, CamelDiscoDiary))
44 #define CAMEL_DISCO_DIARY_CLASS(cls) \
45         (G_TYPE_CHECK_CLASS_CAST \
46         ((cls), CAMEL_TYPE_DISCO_DIARY, CamelDiscoDiaryClass))
47 #define CAMEL_IS_DISCO_DIARY(obj) \
48         (G_TYPE_CHECK_INSTANCE_TYPE \
49         ((obj), CAMEL_TYPE_DISCO_DIARY))
50 #define CAMEL_IS_DISCO_DIARY_CLASS(cls) \
51         (G_TYPE_CHECK_CLASS_TYPE \
52         ((cls), CAMEL_TYPE_DISCO_DIARY))
53 #define CAMEL_DISCO_DIARY_GET_CLASS(obj) \
54         (G_TYPE_INSTANCE_GET_CLASS \
55         ((obj), CAMEL_TYPE_DISCO_DIARY, CamelDiscoDiaryClass))
56
57 G_BEGIN_DECLS
58
59 typedef struct _CamelDiscoDiary CamelDiscoDiary;
60 typedef struct _CamelDiscoDiaryClass CamelDiscoDiaryClass;
61
62 typedef enum {
63         CAMEL_DISCO_DIARY_END = 0,
64
65         CAMEL_DISCO_DIARY_FOLDER_EXPUNGE,
66         CAMEL_DISCO_DIARY_FOLDER_APPEND,
67         CAMEL_DISCO_DIARY_FOLDER_TRANSFER
68 } CamelDiscoDiaryAction;
69
70 struct _CamelDiscoDiary {
71         CamelObject parent;
72
73         CamelDiscoStore *store;
74         FILE *file;
75         GHashTable *folders, *uidmap;
76 };
77
78 struct _CamelDiscoDiaryClass {
79         CamelObjectClass parent_class;
80 };
81
82 GType           camel_disco_diary_get_type      (void);
83 CamelDiscoDiary *
84                 camel_disco_diary_new           (CamelDiscoStore *store,
85                                                  const gchar *filename,
86                                                  GError **error);
87 gboolean        camel_disco_diary_empty         (CamelDiscoDiary *diary);
88 void            camel_disco_diary_log           (CamelDiscoDiary *diary,
89                                                  CamelDiscoDiaryAction action,
90                                                  ...);
91 void            camel_disco_diary_replay        (CamelDiscoDiary *diary,
92                                                  GCancellable *cancellable,
93                                                  GError **error);
94
95 /* Temporary->Permanent UID map stuff */
96 void            camel_disco_diary_uidmap_add    (CamelDiscoDiary *diary,
97                                                  const gchar *old_uid,
98                                                  const gchar *new_uid);
99 const gchar *   camel_disco_diary_uidmap_lookup (CamelDiscoDiary *diary,
100                                                  const gchar *uid);
101
102 G_END_DECLS
103
104 #endif /* CAMEL_DISCO_DIARY_H */
105
106 #endif /* CAMEL_DISABLE_DEPRECATED */