Updated Traditional Chinese translation(Hong Kong and Taiwan)
[evolution.git] / libemail-engine / mail-folder-cache.h
blob5f464a6bd0d7a081bd17a6683aefe358cb76defb
1 /*
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/>
16 * Authors:
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))
50 G_BEGIN_DECLS
52 /* Avoid a circular dependency. */
53 struct _EMailSession;
55 typedef struct _MailFolderCache MailFolderCache;
56 typedef struct _MailFolderCacheClass MailFolderCacheClass;
57 typedef struct _MailFolderCachePrivate MailFolderCachePrivate;
59 /**
60 * NoteDoneFunc:
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,
66 CamelStore *store,
67 CamelFolderInfo *info,
68 gpointer data);
70 /**
71 * MailFolderCache:
73 * Contains only private data that should be read and manipulated using the
74 * functions below.
76 struct _MailFolderCache {
77 GObject parent;
78 MailFolderCachePrivate *priv;
81 struct _MailFolderCacheClass {
82 GObjectClass parent_class;
84 /* Signals */
85 void (*folder_available) (MailFolderCache *cache,
86 CamelStore *store,
87 const gchar *folder_name);
88 void (*folder_unavailable) (MailFolderCache *cache,
89 CamelStore *store,
90 const gchar *folder_name);
91 void (*folder_deleted) (MailFolderCache *cache,
92 CamelStore *store,
93 const gchar *folder_name);
94 void (*folder_renamed) (MailFolderCache *cache,
95 CamelStore *store,
96 const gchar *old_folder_name,
97 const gchar *new_folder_name);
98 void (*folder_unread_updated)
99 (MailFolderCache *cache,
100 CamelStore *store,
101 const gchar *folder_name,
102 gint unread);
103 void (*folder_changed) (MailFolderCache *cache,
104 CamelStore *store,
105 gint new_messages,
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;
112 MailFolderCache *
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,
117 CamelStore *store,
118 GCancellable *cancellable,
119 NoteDoneFunc done,
120 gpointer data);
121 void mail_folder_cache_note_folder (MailFolderCache *cache,
122 CamelFolder *folder);
123 gboolean mail_folder_cache_get_folder_from_uri
124 (MailFolderCache *cache,
125 const gchar *uri,
126 CamelFolder **folderp);
127 gboolean mail_folder_cache_get_folder_info_flags
128 (MailFolderCache *cache,
129 CamelFolder *folder,
130 CamelFolderInfoFlags *flags);
131 gboolean mail_folder_cache_get_folder_has_children
132 (MailFolderCache *cache,
133 CamelFolder *folder,
134 gboolean *found);
135 void mail_folder_cache_get_local_folder_uris
136 (MailFolderCache *cache,
137 GQueue *out_queue);
138 void mail_folder_cache_get_remote_folder_uris
139 (MailFolderCache *cache,
140 GQueue *out_queue);
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);
153 G_END_DECLS
155 #endif /* MAIL_FOLDER_CACHE_H */