]> git.notmuchmail.org Git - notmuch/blobdiff - lib/notmuch.h
have _notmuch_thread_create mark which messages matched the query
[notmuch] / lib / notmuch.h
index bbeec559f0f8fdd95018d57c21f2330f6fcebd1d..3974820c0d3573305f8b5a168e8a414fd357bdfa 100644 (file)
@@ -139,7 +139,7 @@ notmuch_database_create (const char *path);
 
 typedef enum {
     NOTMUCH_DATABASE_MODE_READ_ONLY = 0,
-    NOTMUCH_DATABASE_MODE_READ_Write
+    NOTMUCH_DATABASE_MODE_READ_WRITE
 } notmuch_database_mode_t;
 
 /* XXX: I think I'd like this to take an extra argument of
@@ -322,14 +322,6 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
  * object is owned by the query and as such, will only be valid until
  * notmuch_query_destroy.
  *
- * The 'first' and 'max_threads' arguments can be used to obtain
- * partial results from the search. For example, to get results 10 at
- * a time, pass 'max_threads' as 10 and for 'first' pass the values 0,
- * 10, 20, etc. As a special case, a value of -1 for 'max_threads'
- * indicates that no limiting is to be performed. So a search with
- * 'first' == 0 and 'max_threads' == -1 will return the complete
- * results of the search.
- *
  * Typical usage might be:
  *
  *     notmuch_query_t *query;
@@ -362,22 +354,13 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
  * to call it if the query is about to be destroyed).
  */
 notmuch_threads_t *
-notmuch_query_search_threads (notmuch_query_t *query,
-                             int first, int max_threads);
+notmuch_query_search_threads (notmuch_query_t *query);
 
 /* Execute a query for messages, returning a notmuch_messages_t object
  * which can be used to iterate over the results. The returned
  * messages object is owned by the query and as such, will only be
  * valid until notmuch_query_destroy.
  *
- * The 'first' and 'max_messages' arguments can be used to obtain
- * partial results from the search. For example, to get results 10 at
- * a time, pass 'max_messages' as 10 and for 'first' pass the values
- * 0, 10, 20, etc. As a special case, a value of -1 for 'max_messages'
- * indicates that no limiting is to be performed. So a search with
- * 'first' == 0 and 'max_messages' == -1 will return the complete
- * results of the search.
- *
  * Typical usage might be:
  *
  *     notmuch_query_t *query;
@@ -410,8 +393,7 @@ notmuch_query_search_threads (notmuch_query_t *query,
  * reason to call it if the query is about to be destroyed).
  */
 notmuch_messages_t *
-notmuch_query_search_messages (notmuch_query_t *query,
-                              int first, int max_messages);
+notmuch_query_search_messages (notmuch_query_t *query);
 
 /* Destroy a notmuch_query_t along with any associated resources.
  *
@@ -468,6 +450,14 @@ notmuch_threads_advance (notmuch_threads_t *threads);
 void
 notmuch_threads_destroy (notmuch_threads_t *threads);
 
+/* Return an estimate of the number of messages matching a search
+ *
+ * This function performs a search and returns Xapian's best
+ * guess as to number of matching messages.
+ */
+unsigned
+notmuch_query_count_messages (notmuch_query_t *query);
 /* Get the thread ID of 'thread'.
  *
  * The returned string belongs to 'thread' and as such, should not be
@@ -694,6 +684,21 @@ notmuch_message_get_replies (notmuch_message_t *message);
 const char *
 notmuch_message_get_filename (notmuch_message_t *message);
 
+/* Message flags */
+typedef enum _notmuch_message_flag {
+    NOTMUCH_MSG_FLAG_MATCHING_SEARCH,
+} notmuch_message_flag_t;
+
+/* Get a value of a flag for the email corresponding to 'message'. */
+notmuch_bool_t
+notmuch_message_get_flag (notmuch_message_t *message,
+                         notmuch_message_flag_t flag);
+
+/* Set a value of a flag for the email corresponding to 'message'. */
+void
+notmuch_message_set_flag (notmuch_message_t *message,
+                         notmuch_message_flag_t flag, notmuch_bool_t value);
+
 /* Get the date of 'message' as a time_t value.
  *
  * For the original textual representation of the Date header from the