1 /* The Ruby interface to the notmuch mail library
3 * Copyright © 2010 Ali Polatel
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see http://www.gnu.org/licenses/ .
18 * Author: Ali Polatel <alip@exherbo.org>
27 VALUE notmuch_rb_cDatabase;
28 VALUE notmuch_rb_cDirectory;
29 VALUE notmuch_rb_cFileNames;
30 VALUE notmuch_rb_cQuery;
31 VALUE notmuch_rb_cThreads;
32 VALUE notmuch_rb_cThread;
33 VALUE notmuch_rb_cMessages;
34 VALUE notmuch_rb_cMessage;
35 VALUE notmuch_rb_cTags;
37 VALUE notmuch_rb_eBaseError;
38 VALUE notmuch_rb_eDatabaseError;
39 VALUE notmuch_rb_eMemoryError;
40 VALUE notmuch_rb_eReadOnlyError;
41 VALUE notmuch_rb_eXapianError;
42 VALUE notmuch_rb_eFileError;
43 VALUE notmuch_rb_eFileNotEmailError;
44 VALUE notmuch_rb_eNullPointerError;
45 VALUE notmuch_rb_eTagTooLongError;
46 VALUE notmuch_rb_eUnbalancedFreezeThawError;
53 notmuch_database_t *nm_db;
54 } notmuch_rb_database_t;
57 notmuch_directory_t *nm_dir;
59 } notmuch_rb_directory_t;
62 notmuch_filenames_t *nm_flist;
64 } notmuch_rb_filenames_t;
67 notmuch_query_t *nm_query;
72 notmuch_threads_t *nm_threads;
74 } notmuch_rb_threads_t;
77 notmuch_messages_t *nm_messages;
79 } notmuch_rb_messages_t;
82 notmuch_thread_t *nm_thread;
84 } notmuch_rb_thread_t;
87 notmuch_message_t *nm_message;
89 } notmuch_rb_message_t;
92 notmuch_tags_t *nm_tags;
98 notmuch_rb_status_raise(notmuch_status_t status);
102 notmuch_rb_database_free(notmuch_rb_database_t *db);
105 notmuch_rb_directory_mark(notmuch_rb_directory_t *dir);
108 notmuch_rb_directory_free(notmuch_rb_directory_t *dir);
111 notmuch_rb_filenames_mark(notmuch_rb_filenames_t *flist);
114 notmuch_rb_filenames_free(notmuch_rb_filenames_t *flist);
117 notmuch_rb_query_mark(notmuch_rb_query_t *query);
120 notmuch_rb_query_free(notmuch_rb_query_t *query);
123 notmuch_rb_threads_mark(notmuch_rb_threads_t *threads);
126 notmuch_rb_threads_free(notmuch_rb_threads_t *threads);
129 notmuch_rb_messages_mark(notmuch_rb_messages_t *messages);
132 notmuch_rb_messages_free(notmuch_rb_messages_t *messages);
135 notmuch_rb_thread_mark(notmuch_rb_thread_t *thread);
138 notmuch_rb_thread_free(notmuch_rb_thread_t *thread);
141 notmuch_rb_message_mark(notmuch_rb_message_t *message);
144 notmuch_rb_message_free(notmuch_rb_message_t *message);
147 notmuch_rb_tags_mark(notmuch_rb_tags_t *tags);
150 notmuch_rb_tags_free(notmuch_rb_tags_t *tags);
154 notmuch_rb_database_new(int argc, VALUE *argv, VALUE klass);
157 notmuch_rb_database_close(VALUE self);
160 notmuch_rb_database_path(VALUE self);
163 notmuch_rb_database_version(VALUE self);
166 notmuch_rb_database_needs_upgrade(VALUE self);
169 notmuch_rb_database_upgrade(VALUE self);
172 notmuch_rb_database_get_directory(VALUE self, VALUE pathv);
175 notmuch_rb_database_add_message(VALUE self, VALUE pathv);
178 notmuch_rb_database_remove_message(VALUE self, VALUE pathv);
181 notmuch_rb_database_query_create(VALUE self, VALUE qstrv);
185 notmuch_rb_directory_get_mtime(VALUE self);
188 notmuch_rb_directory_set_mtime(VALUE self, VALUE mtimev);
191 notmuch_rb_directory_get_child_files(VALUE self);
194 notmuch_rb_directory_get_child_directories(VALUE self);
198 notmuch_rb_filenames_each(VALUE self);
202 notmuch_rb_query_set_sort(VALUE self, VALUE sortv);
205 notmuch_rb_query_search_threads(VALUE self);
208 notmuch_rb_query_search_messages(VALUE self);
212 notmuch_rb_threads_each(VALUE self);
216 notmuch_rb_messages_each(VALUE self);
219 notmuch_rb_messages_collect_tags(VALUE self);
223 notmuch_rb_thread_get_thread_id(VALUE self);
226 notmuch_rb_thread_get_total_messages(VALUE self);
229 notmuch_rb_thread_get_toplevel_messages(VALUE self);
232 notmuch_rb_thread_get_matched_messages(VALUE self);
235 notmuch_rb_thread_get_authors(VALUE self);
238 notmuch_rb_thread_get_subject(VALUE self);
241 notmuch_rb_thread_get_oldest_date(VALUE self);
244 notmuch_rb_thread_get_newest_date(VALUE self);
247 notmuch_rb_thread_get_tags(VALUE self);
251 notmuch_rb_message_get_message_id(VALUE self);
254 notmuch_rb_message_get_thread_id(VALUE self);
257 notmuch_rb_message_get_replies(VALUE self);
260 notmuch_rb_message_get_filename(VALUE self);
263 notmuch_rb_message_get_flag(VALUE self, VALUE flagv);
266 notmuch_rb_message_set_flag(VALUE self, VALUE flagv, VALUE valuev);
269 notmuch_rb_message_get_date(VALUE self);
272 notmuch_rb_message_get_header(VALUE self, VALUE headerv);
275 notmuch_rb_message_get_tags(VALUE self);
278 notmuch_rb_message_add_tag(VALUE self, VALUE tagv);
281 notmuch_rb_message_remove_tag(VALUE self, VALUE tagv);
284 notmuch_rb_message_remove_all_tags(VALUE self);
287 notmuch_rb_message_freeze(VALUE self);
290 notmuch_rb_message_thaw(VALUE self);
294 notmuch_rb_tags_each(VALUE self);