Updated Traditional Chinese translation(Hong Kong and Taiwan)
[evolution.git] / libemail-engine / mail-folder-cache.h
blobc7bbb60f0a882fb1f76d6ddf202b46677abb9170
1 /*
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
9 * for more details.
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/>.
15 * Authors:
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."
27 #endif
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))
53 G_BEGIN_DECLS
55 typedef struct _MailFolderCache MailFolderCache;
56 typedef struct _MailFolderCacheClass MailFolderCacheClass;
57 typedef struct _MailFolderCachePrivate MailFolderCachePrivate;
59 /**
60 * MailFolderCache:
62 * Contains only private data that should be read and manipulated using the
63 * functions below.
65 struct _MailFolderCache {
66 GObject parent;
67 MailFolderCachePrivate *priv;
70 struct _MailFolderCacheClass {
71 GObjectClass parent_class;
73 /* Signals */
74 void (*folder_available) (MailFolderCache *cache,
75 CamelStore *store,
76 const gchar *folder_name);
77 void (*folder_unavailable) (MailFolderCache *cache,
78 CamelStore *store,
79 const gchar *folder_name);
80 void (*folder_deleted) (MailFolderCache *cache,
81 CamelStore *store,
82 const gchar *folder_name);
83 void (*folder_renamed) (MailFolderCache *cache,
84 CamelStore *store,
85 const gchar *old_folder_name,
86 const gchar *new_folder_name);
87 void (*folder_unread_updated)
88 (MailFolderCache *cache,
89 CamelStore *store,
90 const gchar *folder_name,
91 gint unread);
92 void (*folder_changed) (MailFolderCache *cache,
93 CamelStore *store,
94 gint new_messages,
95 const gchar *msg_uid,
96 const gchar *msg_sender,
97 const gchar *msg_subject);
100 GType mail_folder_cache_get_type (void) G_GNUC_CONST;
101 MailFolderCache *
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,
106 CamelStore *store,
107 GCancellable *cancellable,
108 GAsyncReadyCallback callback,
109 gpointer user_data);
110 gboolean mail_folder_cache_note_store_finish
111 (MailFolderCache *cache,
112 GAsyncResult *result,
113 CamelFolderInfo **out_info,
114 GError **error);
115 void mail_folder_cache_note_folder (MailFolderCache *cache,
116 CamelFolder *folder);
117 gboolean mail_folder_cache_has_folder_info
118 (MailFolderCache *cache,
119 CamelStore *store,
120 const gchar *folder_name);
121 CamelFolder * mail_folder_cache_ref_folder (MailFolderCache *cache,
122 CamelStore *store,
123 const gchar *folder_name);
124 gboolean mail_folder_cache_get_folder_info_flags
125 (MailFolderCache *cache,
126 CamelStore *store,
127 const gchar *folder_name,
128 CamelFolderInfoFlags *flags);
129 void mail_folder_cache_get_local_folder_uris
130 (MailFolderCache *cache,
131 GQueue *out_queue);
132 void mail_folder_cache_get_remote_folder_uris
133 (MailFolderCache *cache,
134 GQueue *out_queue);
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);
145 G_END_DECLS
147 #endif /* MAIL_FOLDER_CACHE_H */