Camel.FolderSearch¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Camel.FolderSearch(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
A new
Camel.FolderSearch
intstance.- Return type:
Create a new
Camel.FolderSearch
object.A
Camel.FolderSearch
is a subclassable, extensible s-exp evaluator which enforces a particular set of s-expressions. Particular methods may be overriden by an implementation to implement a search for any sort of backend.
- classmethod util_add_months(t, months)¶
- Parameters:
- Returns:
a new #time_t value
- Return type:
Increases time t by the given number of months (or decreases, if months is negative).
New in version 3.2.
- classmethod util_compare_date(datetime1, datetime2)¶
- Parameters:
- Returns:
0 when the dates are equal, < 0 when first is before second and > 0 when the first is after the second date
- Return type:
Compares date portion of the two date-time values, first converted into the local time zone. The returned value is like with strcmp().
New in version 3.30.
- classmethod util_hash_message_id(message_id, needs_decode)¶
- Parameters:
message_id (
str
) – a raw Message-ID header valueneeds_decode (
bool
) – whether the message_id requiresCamel.header_msgid_decode
() first
- Returns:
hash of the message_id, or 0 on any error.
- Return type:
Calculates a hash of the Message-ID header value message_id.
New in version 3.40.
- classmethod util_make_time(argc, argv)¶
- Parameters:
argc (
int
) – number of arguments in argvargv (
Camel.SExpResult
) – array or arguments
- Returns:
time_t equivalent of the passed in argument, or (time_t) -1 on error.
- Return type:
Implementation of ‘make-time’ function, which expects one argument, a string or an integer, to be converted into time_t.
New in version 3.30.
- count(expr, cancellable)¶
- Parameters:
expr (
str
) – a search expression to runcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
- Raises:
- Returns:
Number of messages that match the query.
- Return type:
Run a search. Search must have had Folder already set on it, and it must implement summaries.
New in version 2.26.
- free_result(result)¶
-
Frees result of
Camel.FolderSearch.search
() call.
- get_current_message_info()¶
- Returns:
the currently processing
Camel.MessageInfo
- Return type:
New in version 3.24.
- get_current_summary()¶
- Returns:
the current summary, and array of message info UID-s to use.
- Return type:
[
str
]
New in version 3.24.
- get_folder()¶
- Returns:
a
Camel.Folder
for which the self is currently running.- Return type:
New in version 3.24.
- get_only_cached_messages()¶
- Returns:
Whether only cached messages can be searched. See
Camel.FolderSearch.set_only_cached_messages
() for more information what it means.- Return type:
New in version 3.24.
- get_summary()¶
- Returns:
A summary of UID-s of
Camel.MessageInfo
previously set byCamel.FolderSearch.set_summary
().- Return type:
[
str
]
New in version 3.24.
- get_summary_empty()¶
- Returns:
Whether the summary (as returned by
Camel.FolderSearch.get_summary
()) is empty. It returnsFalse
when the summary is set and contains at least one item.- Return type:
- search(expr, uids, cancellable)¶
- Parameters:
expr (
str
) – a search expression to runcancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
- Raises:
- Returns:
a
GLib.PtrArray
with matching UIDs, orNone
on error. UseCamel.FolderSearch.free_result
() to free it when no longer needed.- Return type:
[
str
]
Run a search. Search must have had Folder already set on it, and it must implement summaries.
- set_body_index(body_index)¶
- Parameters:
body_index (
Camel.Index
orNone
) – aCamel.Index
Set the index representing the contents of all messages in this folder. If this is not set, then the folder implementation should sub-class the
Camel.FolderSearch
and provide its own body-contains function.
- set_current_message_info(info)¶
- Parameters:
info (
Camel.MessageInfo
orNone
) – aCamel.MessageInfo
Sets, or unsets, the info as the currently processing
Camel.MessageInfo
. The function adds its own reference to info, if notNone
.New in version 3.24.
- set_folder(folder)¶
- Parameters:
folder (
Camel.Folder
) – aCamel.Folder
Set the folder attribute of the search. This can be used to perform a slow-search when indexes and so forth are not available. Or for use by subclasses.
- set_only_cached_messages(only_cached_messages)¶
- Parameters:
only_cached_messages (
bool
) – a value to set
Sets whether only locally cached messages can be searched. The default value is
False
, which means that when a message is required and it is not available locally, then it is downloaded from the server, if possible.New in version 3.24.
- set_summary(summary)¶
- Parameters:
summary ([
str
]) – An array of UID-s ofCamel.MessageInfo
.
Set the array of summary objects representing the span of the search.
If this is not set, then a subclass must provide the functions for searching headers and for the match-all operator.
- take_current_message_info(info)¶
- Parameters:
info (
Camel.MessageInfo
orNone
) – aCamel.MessageInfo
Sets, or unsets, the info as the currently processing
Camel.MessageInfo
. UnlikeCamel.FolderSearch.set_current_message_info
(), this function assumes ownership of the info, if notNone
.New in version 3.24.