1 /*
2  * camel-imapx-mailbox.h
3  *
4  * This library is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library. If not, see <http://www.gnu.org/licenses/>.
15  *
16  */
17 
18 #ifndef CAMEL_IMAPX_MAILBOX_H
19 #define CAMEL_IMAPX_MAILBOX_H
20 
21 #include "camel-imapx-namespace.h"
22 #include "camel-imapx-list-response.h"
23 #include "camel-imapx-status-response.h"
24 
25 /* Standard GObject macros */
26 #define CAMEL_TYPE_IMAPX_MAILBOX \
27 	(camel_imapx_mailbox_get_type ())
28 #define CAMEL_IMAPX_MAILBOX(obj) \
29 	(G_TYPE_CHECK_INSTANCE_CAST \
30 	((obj), CAMEL_TYPE_IMAPX_MAILBOX, CamelIMAPXMailbox))
31 #define CAMEL_IMAPX_MAILBOX_CLASS(cls) \
32 	(G_TYPE_CHECK_CLASS_CAST \
33 	((cls), CAMEL_TYPE_IMAPX_MAILBOX, CamelIMAPXMailboxClass))
34 #define CAMEL_IS_IMAPX_MAILBOX(obj) \
35 	(G_TYPE_CHECK_INSTANCE_TYPE \
36 	((obj), CAMEL_TYPE_IMAPX_MAILBOX))
37 #define CAMEL_IS_IMAPX_MAILBOX_CLASS(cls) \
38 	(G_TYPE_CHECK_CLASS_TYPE \
39 	((cls), CAMEL_TYPE_IMAPX_MAILBOX))
40 #define CAMEL_IMAPX_MAILBOX_GET_CLASS(obj) \
41 	(G_TYPE_INSTANCE_GET_CLASS \
42 	((obj), CAMEL_TYPE_IMAPX_MAILBOX, CamelIMAPXMailboxClass))
43 
44 G_BEGIN_DECLS
45 
46 typedef struct _CamelIMAPXMailbox CamelIMAPXMailbox;
47 typedef struct _CamelIMAPXMailboxClass CamelIMAPXMailboxClass;
48 typedef struct _CamelIMAPXMailboxPrivate CamelIMAPXMailboxPrivate;
49 
50 typedef enum {
51 	CAMEL_IMAPX_MAILBOX_STATE_UNKNOWN,
52 	CAMEL_IMAPX_MAILBOX_STATE_CREATED,
53 	CAMEL_IMAPX_MAILBOX_STATE_UPDATED,
54 	CAMEL_IMAPX_MAILBOX_STATE_RENAMED
55 } CamelIMAPXMailboxState;
56 
57 /**
58  * CamelIMAPXMailbox:
59  *
60  * Contains only private data that should be read and manipulated using the
61  * functions below.
62  *
63  * Since: 3.12
64  **/
65 struct _CamelIMAPXMailbox {
66 	/*< private >*/
67 	GObject parent;
68 	CamelIMAPXMailboxPrivate *priv;
69 };
70 
71 struct _CamelIMAPXMailboxClass {
72 	GObjectClass parent_class;
73 
74 	/* Padding for future expansion */
75 	gpointer reserved[20];
76 };
77 
78 GType		camel_imapx_mailbox_get_type
79 					(void) G_GNUC_CONST;
80 CamelIMAPXMailbox *
81 		camel_imapx_mailbox_new	(CamelIMAPXListResponse *response,
82 					 CamelIMAPXNamespace *namespace_);
83 CamelIMAPXMailbox *
84 		camel_imapx_mailbox_clone
85 					(CamelIMAPXMailbox *mailbox,
86 					 const gchar *new_mailbox_name);
87 CamelIMAPXMailboxState
88 		camel_imapx_mailbox_get_state
89 					(CamelIMAPXMailbox *mailbox);
90 void		camel_imapx_mailbox_set_state
91 					(CamelIMAPXMailbox *mailbox,
92 					 CamelIMAPXMailboxState state);
93 gboolean	camel_imapx_mailbox_exists
94 					(CamelIMAPXMailbox *mailbox);
95 gint		camel_imapx_mailbox_compare
96 					(CamelIMAPXMailbox *mailbox_a,
97 					 CamelIMAPXMailbox *mailbox_b);
98 gboolean	camel_imapx_mailbox_matches
99 					(CamelIMAPXMailbox *mailbox,
100 					 const gchar *pattern);
101 const gchar *	camel_imapx_mailbox_get_name
102 					(CamelIMAPXMailbox *mailbox);
103 gchar		camel_imapx_mailbox_get_separator
104 					(CamelIMAPXMailbox *mailbox);
105 gchar *		camel_imapx_mailbox_dup_folder_path
106 					(CamelIMAPXMailbox *mailbox);
107 CamelIMAPXNamespace *
108 		camel_imapx_mailbox_get_namespace
109 					(CamelIMAPXMailbox *mailbox);
110 guint32		camel_imapx_mailbox_get_messages
111 					(CamelIMAPXMailbox *mailbox);
112 void		camel_imapx_mailbox_set_messages
113 					(CamelIMAPXMailbox *mailbox,
114 					 guint32 messages);
115 guint32		camel_imapx_mailbox_get_recent
116 					(CamelIMAPXMailbox *mailbox);
117 void		camel_imapx_mailbox_set_recent
118 					(CamelIMAPXMailbox *mailbox,
119 					 guint32 recent);
120 guint32		camel_imapx_mailbox_get_unseen
121 					(CamelIMAPXMailbox *mailbox);
122 void		camel_imapx_mailbox_set_unseen
123 					(CamelIMAPXMailbox *mailbox,
124 					 guint32 unseen);
125 guint32		camel_imapx_mailbox_get_uidnext
126 					(CamelIMAPXMailbox *mailbox);
127 void		camel_imapx_mailbox_set_uidnext
128 					(CamelIMAPXMailbox *mailbox,
129 					 guint32 uidnext);
130 guint32		camel_imapx_mailbox_get_uidvalidity
131 					(CamelIMAPXMailbox *mailbox);
132 void		camel_imapx_mailbox_set_uidvalidity
133 					(CamelIMAPXMailbox *mailbox,
134 					 guint32 uidvalidity);
135 guint64		camel_imapx_mailbox_get_highestmodseq
136 					(CamelIMAPXMailbox *mailbox);
137 void		camel_imapx_mailbox_set_highestmodseq
138 					(CamelIMAPXMailbox *mailbox,
139 					 guint64 highestmodseq);
140 guint32		camel_imapx_mailbox_get_permanentflags
141 					(CamelIMAPXMailbox *mailbox);
142 void		camel_imapx_mailbox_set_permanentflags
143 					(CamelIMAPXMailbox *mailbox,
144 					 guint32 permanentflags);
145 gchar **	camel_imapx_mailbox_dup_quota_roots
146 					(CamelIMAPXMailbox *mailbox);
147 void		camel_imapx_mailbox_set_quota_roots
148 					(CamelIMAPXMailbox *mailbox,
149 					 const gchar **quota_roots);
150 GSequence *	camel_imapx_mailbox_copy_message_map
151 					(CamelIMAPXMailbox *mailbox);
152 void		camel_imapx_mailbox_take_message_map
153 					(CamelIMAPXMailbox *mailbox,
154 					 GSequence *message_map);
155 gboolean	camel_imapx_mailbox_get_msn_for_uid
156 					(CamelIMAPXMailbox *mailbox,
157 					 guint32 uid,
158 					 guint32 *out_msn);
159 gboolean	camel_imapx_mailbox_get_uid_for_msn
160 					(CamelIMAPXMailbox *mailbox,
161 					 guint32 msn,
162 					 guint32 *out_uid);
163 void		camel_imapx_mailbox_deleted
164 					(CamelIMAPXMailbox *mailbox);
165 void		camel_imapx_mailbox_subscribed
166 					(CamelIMAPXMailbox *mailbox);
167 void		camel_imapx_mailbox_unsubscribed
168 					(CamelIMAPXMailbox *mailbox);
169 gboolean	camel_imapx_mailbox_has_attribute
170 					(CamelIMAPXMailbox *mailbox,
171 					 const gchar *attribute);
172 void		camel_imapx_mailbox_handle_list_response
173 					(CamelIMAPXMailbox *mailbox,
174 					 CamelIMAPXListResponse *response);
175 void		camel_imapx_mailbox_handle_lsub_response
176 					(CamelIMAPXMailbox *mailbox,
177 					 CamelIMAPXListResponse *response);
178 void		camel_imapx_mailbox_handle_status_response
179 					(CamelIMAPXMailbox *mailbox,
180 					 CamelIMAPXStatusResponse *response);
181 
182 gint		camel_imapx_mailbox_get_update_count
183 					(CamelIMAPXMailbox *mailbox);
184 void		camel_imapx_mailbox_inc_update_count
185 					(CamelIMAPXMailbox *mailbox,
186 					 gint inc);
187 gint		camel_imapx_mailbox_get_change_stamp
188 					(CamelIMAPXMailbox *mailbox);
189 
190 G_END_DECLS
191 
192 #endif /* CAMEL_IMAPX_MAILBOX_H */
193 
194