![]() |
![]() |
![]() |
Reference Manual of the tinymail framework | ![]() |
---|---|---|---|---|
#define TNY_TYPE_HEADER_FLAGS TnyHeader; TnyHeaderIface; #define TNY_TYPE_HEADER_PRIORITY_FLAGS GType tny_header_flags_get_type (void); const gchar* tny_header_get_uid (TnyHeader *self); const gchar* tny_header_get_bcc (TnyHeader *self); const gchar* tny_header_get_cc (TnyHeader *self); time_t tny_header_get_date_received (TnyHeader *self); time_t tny_header_get_date_sent (TnyHeader *self); const gchar* tny_header_get_message_id (TnyHeader *self); guint tny_header_get_message_size (TnyHeader *self); const gchar* tny_header_get_from (TnyHeader *self); const gchar* tny_header_get_to (TnyHeader *self); const gchar* tny_header_get_subject (TnyHeader *self); const gchar* tny_header_get_replyto (TnyHeader *self); void tny_header_set_bcc (TnyHeader *self, const gchar *bcc); void tny_header_set_cc (TnyHeader *self, const gchar *cc); void tny_header_set_from (TnyHeader *self, const gchar *from); void tny_header_set_subject (TnyHeader *self, const gchar *subject); void tny_header_set_to (TnyHeader *self, const gchar *to); void tny_header_set_replyto (TnyHeader *self, const gchar *to); TnyFolder* tny_header_get_folder (TnyHeader *self); TnyHeaderFlags tny_header_get_flags (TnyHeader *self); void tny_header_set_flags (TnyHeader *self, TnyHeaderFlags mask); void tny_header_unset_flags (TnyHeader *self, TnyHeaderFlags mask);
A header of a TnyMsg instance is the non-body information. It contains for example the "to", the "from", the "subject" and the "sent-date" information. It's typically used by a summary view to give the user an overview of the available messages in a folder.
One TnyHeader means all the typical headers. Not all headers but only the typical ones (like subject, from, dates and to). For getting all headers, wait for or implement an API in TnyMsg as you will need to fetch the entire message for that.
typedef struct { GTypeInterface g; const gchar* (*get_uid_func) (TnyHeader *self); const gchar* (*get_bcc_func) (TnyHeader *self); const gchar* (*get_cc_func) (TnyHeader *self); const gchar* (*get_subject_func) (TnyHeader *self); const gchar* (*get_to_func) (TnyHeader *self); const gchar* (*get_from_func) (TnyHeader *self); const gchar* (*get_replyto_func) (TnyHeader *self); const gchar* (*get_message_id_func) (TnyHeader *self); guint (*get_message_size_func) (TnyHeader *self); time_t (*get_date_received_func) (TnyHeader *self); time_t (*get_date_sent_func) (TnyHeader *self); void (*set_bcc_func) (TnyHeader *self, const gchar *bcc); void (*set_cc_func) (TnyHeader *self, const gchar *cc); void (*set_from_func) (TnyHeader *self, const gchar *from); void (*set_subject_func) (TnyHeader *self, const gchar *subject); void (*set_to_func) (TnyHeader *self, const gchar *to); void (*set_replyto_func) (TnyHeader *self, const gchar *to); TnyFolder* (*get_folder_func) (TnyHeader *self); TnyHeaderFlags (*get_flags_func) (TnyHeader *self); void (*set_flags_func) (TnyHeader *self, TnyHeaderFlags mask); void (*unset_flags_func) (TnyHeader *self, TnyHeaderFlags mask); } TnyHeaderIface;
#define TNY_TYPE_HEADER_PRIORITY_FLAGS (tny_header_priority_flags_get_type())
GType tny_header_flags_get_type (void);
GType system helper function
Returns : | a GType |
const gchar* tny_header_get_uid (TnyHeader *self);
Get an unique id of the message of which self is a message header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | Unique follow-up uid as a read-only string, or NULL if not found |
const gchar* tny_header_get_bcc (TnyHeader *self);
Get the BCC header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | bcc header as a read-only string, or NULL if not found |
const gchar* tny_header_get_cc (TnyHeader *self);
Get the CC header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | cc header as a read-only string, or NULL if not found |
time_t tny_header_get_date_received (TnyHeader *self);
Get the Date Received header as a time_t
self : |
a TnyHeader object |
Returns : | date received header |
time_t tny_header_get_date_sent (TnyHeader *self);
Get the Date Sent header as a time_t
self : |
a TnyHeader object |
Returns : | date sent header |
const gchar* tny_header_get_message_id (TnyHeader *self);
Get an unique id of the message of which self is a message header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | message-id header as a read-only string, or NULL if not found |
guint tny_header_get_message_size (TnyHeader *self);
Get the expected message size
self : |
a TnyHeader object |
Returns : | expected message size |
const gchar* tny_header_get_from (TnyHeader *self);
Get the from header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | from header as a read-only string, or NULL if not found |
const gchar* tny_header_get_to (TnyHeader *self);
Get the to header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | to header as a read-only string, or NULL if not found |
const gchar* tny_header_get_subject (TnyHeader *self);
Get the subject header. The returned value should not be freed.
self : |
a TnyHeader object |
Returns : | subject header as a read-only string, or NULL if not found |
const gchar* tny_header_get_replyto (TnyHeader *self);
Get the reply-to header
self : |
a TnyHeader object |
Returns : | reply-to header, or NULL if not found |
void tny_header_set_bcc (TnyHeader *self, const gchar *bcc);
Set the bcc header. Look at the to header for more information about formatting.
self : |
a TnyHeader object |
bcc : |
the bcc header in a comma separated list |
void tny_header_set_cc (TnyHeader *self, const gchar *cc);
Set the cc header. Look at the to header for more information about formatting.
self : |
a TnyHeader object |
cc : |
the cc header in a comma separated list |
void tny_header_set_from (TnyHeader *self, const gchar *from);
Set the from header
self : |
a TnyHeader object |
from : |
the from header |
void tny_header_set_subject (TnyHeader *self, const gchar *subject);
Set the subject header
self : |
a TnyHeader object |
subject : |
the subject header |
void tny_header_set_to (TnyHeader *self, const gchar *to);
Set the to header.
The format is a comma separated list like this:
Full name >userdomain
<, Full name >userdomain
<
There are no quotes nor anything special. Just commas.
self : |
a TnyHeader object |
to : |
the to header in a comma separated list |
void tny_header_set_replyto (TnyHeader *self, const gchar *to);
Set the reply-to header
self : |
a TnyHeader object |
to : |
the reply-to header |
TnyFolder* tny_header_get_folder (TnyHeader *self);
Get the parent folder where this message header is located. This method can return NULL in case the folder isn't know. The returned value,i if not NULL, must be unreferenced after use.
self : |
a TnyHeader object |
Returns : | The folder of the message header or NULL |
TnyHeaderFlags tny_header_get_flags (TnyHeader *self);
Get message information flags.
self : |
a TnyHeader object |
Returns : | flag bitmask |
void tny_header_set_flags (TnyHeader *self, TnyHeaderFlags mask);
Modify message flags. Modifying the TNY_HEADER_FLAG_SEEN will trigger the
notification of folder observers if self
was originated from a folder.
self : |
a TnyHeader object |
mask : |
A TnyHeaderFlags bitmask of flags to set. |
void tny_header_unset_flags (TnyHeader *self, TnyHeaderFlags mask);
Reset message flags. Modifying the TNY_HEADER_FLAG_SEEN will trigger the
notification of folder observers if self
was originated from a folder.
self : |
a TnyHeader object |
mask : |
A TnyHeaderFlags bitmask of flags to clear. |