2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU Lesser General Public License as published by
4 * the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful, but
7 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
8 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Peter Williams <peterw@ximian.com>
17 * Michael Zucchi <notzed@ximian.com>
18 * Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>
20 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
21 * Copyright (C) 2009 Intel Corporation
25 #if !defined (__LIBEMAIL_ENGINE_H_INSIDE__) && !defined (LIBEMAIL_ENGINE_COMPILATION)
26 #error "Only <libemail-engine/libemail-engine.h> should be included directly."
29 #ifndef MAIL_FOLDER_CACHE_H
30 #define MAIL_FOLDER_CACHE_H
32 #include <camel/camel.h>
34 /* Standard GObject macros */
35 #define MAIL_TYPE_FOLDER_CACHE \
36 (mail_folder_cache_get_type ())
37 #define MAIL_FOLDER_CACHE(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST \
39 ((obj), MAIL_TYPE_FOLDER_CACHE, MailFolderCache))
40 #define MAIL_FOLDER_CACHE_CLASS(cls) \
41 (G_TYPE_CHECK_CLASS_CAST \
42 ((cls), MAIL_TYPE_FOLDER_CACHE, MailFolderCacheClass))
43 #define MAIL_IS_FOLDER_CACHE(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE \
45 ((obj), MAIL_TYPE_FOLDER_CACHE))
46 #define MAIL_IS_FOLDER_CACHE_CLASS(cls) \
47 (G_TYPE_CHECK_CLASS_TYPE \
48 ((cls), MAIL_TYPE_FOLDER_CACHE))
49 #define MAIL_FOLDER_CACHE_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS \
51 ((obj), MAIL_TYPE_FOLDER_CACHE, MailFolderCacheClass))
55 typedef struct _MailFolderCache MailFolderCache
;
56 typedef struct _MailFolderCacheClass MailFolderCacheClass
;
57 typedef struct _MailFolderCachePrivate MailFolderCachePrivate
;
62 * Contains only private data that should be read and manipulated using the
65 struct _MailFolderCache
{
67 MailFolderCachePrivate
*priv
;
70 struct _MailFolderCacheClass
{
71 GObjectClass parent_class
;
74 void (*folder_available
) (MailFolderCache
*cache
,
76 const gchar
*folder_name
);
77 void (*folder_unavailable
) (MailFolderCache
*cache
,
79 const gchar
*folder_name
);
80 void (*folder_deleted
) (MailFolderCache
*cache
,
82 const gchar
*folder_name
);
83 void (*folder_renamed
) (MailFolderCache
*cache
,
85 const gchar
*old_folder_name
,
86 const gchar
*new_folder_name
);
87 void (*folder_unread_updated
)
88 (MailFolderCache
*cache
,
90 const gchar
*folder_name
,
92 void (*folder_changed
) (MailFolderCache
*cache
,
96 const gchar
*msg_sender
,
97 const gchar
*msg_subject
);
100 GType
mail_folder_cache_get_type (void) G_GNUC_CONST
;
102 mail_folder_cache_new (void);
103 GMainContext
* mail_folder_cache_ref_main_context
104 (MailFolderCache
*cache
);
105 void mail_folder_cache_note_store (MailFolderCache
*cache
,
107 GCancellable
*cancellable
,
108 GAsyncReadyCallback callback
,
110 gboolean mail_folder_cache_note_store_finish
111 (MailFolderCache
*cache
,
112 GAsyncResult
*result
,
113 CamelFolderInfo
**out_info
,
115 void mail_folder_cache_note_folder (MailFolderCache
*cache
,
116 CamelFolder
*folder
);
117 gboolean mail_folder_cache_has_folder_info
118 (MailFolderCache
*cache
,
120 const gchar
*folder_name
);
121 CamelFolder
* mail_folder_cache_ref_folder (MailFolderCache
*cache
,
123 const gchar
*folder_name
);
124 gboolean mail_folder_cache_get_folder_info_flags
125 (MailFolderCache
*cache
,
127 const gchar
*folder_name
,
128 CamelFolderInfoFlags
*flags
);
129 void mail_folder_cache_get_local_folder_uris
130 (MailFolderCache
*cache
,
132 void mail_folder_cache_get_remote_folder_uris
133 (MailFolderCache
*cache
,
135 void mail_folder_cache_service_removed
136 (MailFolderCache
*cache
,
137 CamelService
*service
);
138 void mail_folder_cache_service_enabled
139 (MailFolderCache
*cache
,
140 CamelService
*service
);
141 void mail_folder_cache_service_disabled
142 (MailFolderCache
*cache
,
143 CamelService
*service
);
147 #endif /* MAIL_FOLDER_CACHE_H */