2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2 of the License, or (at your option) version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with the program; if not, see <http://www.gnu.org/licenses/>
17 * Peter Williams <peterw@ximian.com>
18 * Michael Zucchi <notzed@ximian.com>
19 * Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>
21 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
22 * Copyright (C) 2009 Intel Corporation
26 #ifndef MAIL_FOLDER_CACHE_H
27 #define MAIL_FOLDER_CACHE_H
29 #include <camel/camel.h>
31 /* Standard GObject macros */
32 #define MAIL_TYPE_FOLDER_CACHE \
33 (mail_folder_cache_get_type ())
34 #define MAIL_FOLDER_CACHE(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST \
36 ((obj), MAIL_TYPE_FOLDER_CACHE, MailFolderCache))
37 #define MAIL_FOLDER_CACHE_CLASS(cls) \
38 (G_TYPE_CHECK_CLASS_CAST \
39 ((cls), MAIL_TYPE_FOLDER_CACHE, MailFolderCacheClass))
40 #define MAIL_IS_FOLDER_CACHE(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE \
42 ((obj), MAIL_TYPE_FOLDER_CACHE))
43 #define MAIL_IS_FOLDER_CACHE_CLASS(cls) \
44 (G_TYPE_CHECK_CLASS_TYPE \
45 ((cls), MAIL_TYPE_FOLDER_CACHE))
46 #define MAIL_FOLDER_CACHE_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS \
48 ((obj), MAIL_TYPE_FOLDER_CACHE, MailFolderCacheClass))
52 /* Avoid a circular dependency. */
55 typedef struct _MailFolderCache MailFolderCache
;
56 typedef struct _MailFolderCacheClass MailFolderCacheClass
;
57 typedef struct _MailFolderCachePrivate MailFolderCachePrivate
;
62 * The signature of a function to be registered as a callback for
63 * mail_folder_cache_note_store()
65 typedef gboolean (*NoteDoneFunc
) (MailFolderCache
*cache
,
67 CamelFolderInfo
*info
,
73 * Contains only private data that should be read and manipulated using the
76 struct _MailFolderCache
{
78 MailFolderCachePrivate
*priv
;
81 struct _MailFolderCacheClass
{
82 GObjectClass parent_class
;
85 void (*folder_available
) (MailFolderCache
*cache
,
87 const gchar
*folder_name
);
88 void (*folder_unavailable
) (MailFolderCache
*cache
,
90 const gchar
*folder_name
);
91 void (*folder_deleted
) (MailFolderCache
*cache
,
93 const gchar
*folder_name
);
94 void (*folder_renamed
) (MailFolderCache
*cache
,
96 const gchar
*old_folder_name
,
97 const gchar
*new_folder_name
);
98 void (*folder_unread_updated
)
99 (MailFolderCache
*cache
,
101 const gchar
*folder_name
,
103 void (*folder_changed
) (MailFolderCache
*cache
,
106 const gchar
*msg_uid
,
107 const gchar
*msg_sender
,
108 const gchar
*msg_subject
);
111 GType
mail_folder_cache_get_type (void) G_GNUC_CONST
;
113 mail_folder_cache_new (struct _EMailSession
*session
);
114 struct _EMailSession
*
115 mail_folder_cache_get_session (MailFolderCache
*cache
);
116 void mail_folder_cache_note_store (MailFolderCache
*cache
,
118 GCancellable
*cancellable
,
121 void mail_folder_cache_note_folder (MailFolderCache
*cache
,
122 CamelFolder
*folder
);
123 gboolean mail_folder_cache_get_folder_from_uri
124 (MailFolderCache
*cache
,
126 CamelFolder
**folderp
);
127 gboolean mail_folder_cache_get_folder_info_flags
128 (MailFolderCache
*cache
,
130 CamelFolderInfoFlags
*flags
);
131 gboolean mail_folder_cache_get_folder_has_children
132 (MailFolderCache
*cache
,
135 void mail_folder_cache_get_local_folder_uris
136 (MailFolderCache
*cache
,
138 void mail_folder_cache_get_remote_folder_uris
139 (MailFolderCache
*cache
,
141 void mail_folder_cache_service_added (MailFolderCache
*cache
,
142 CamelService
*service
);
143 void mail_folder_cache_service_removed
144 (MailFolderCache
*cache
,
145 CamelService
*service
);
146 void mail_folder_cache_service_enabled
147 (MailFolderCache
*cache
,
148 CamelService
*service
);
149 void mail_folder_cache_service_disabled
150 (MailFolderCache
*cache
,
151 CamelService
*service
);
155 #endif /* MAIL_FOLDER_CACHE_H */