![]() |
![]() |
![]() |
Reference Manual of the tinymail framework | ![]() |
---|---|---|---|---|
#define TNY_TYPE_HEADER_FLAGS TnyHeader; TnyHeaderIface; #define TNY_HEADER_FLAG_PRIORITY_MASK 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_flag (TnyHeader *self, TnyHeaderFlags mask); void tny_header_unset_flag (TnyHeader *self, TnyHeaderFlags mask); TnyHeaderFlags tny_header_get_priority (TnyHeader *self); void tny_header_set_priority (TnyHeader *self, TnyHeaderFlags priority);
TnyHeader is implemented by TnyExpungedHeader, TnyCamelHeader, TnyCamelBsMsgHeader and TnyCamelMsgHeader.
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 _TnyHeader TnyHeader;
A summary item, envelope or group of E-mail headers. Depending on how you like to call it.
free-function: g_object_unref
typedef struct { GTypeInterface g; const gchar* (*get_uid) (TnyHeader *self); const gchar* (*get_bcc) (TnyHeader *self); const gchar* (*get_cc) (TnyHeader *self); const gchar* (*get_subject) (TnyHeader *self); const gchar* (*get_to) (TnyHeader *self); const gchar* (*get_from) (TnyHeader *self); const gchar* (*get_replyto) (TnyHeader *self); const gchar* (*get_message_id) (TnyHeader *self); guint (*get_message_size) (TnyHeader *self); time_t (*get_date_received) (TnyHeader *self); time_t (*get_date_sent) (TnyHeader *self); void (*set_bcc) (TnyHeader *self, const gchar *bcc); void (*set_cc) (TnyHeader *self, const gchar *cc); void (*set_from) (TnyHeader *self, const gchar *from); void (*set_subject) (TnyHeader *self, const gchar *subject); void (*set_to) (TnyHeader *self, const gchar *to); void (*set_replyto) (TnyHeader *self, const gchar *to); TnyFolder* (*get_folder) (TnyHeader *self); TnyHeaderFlags (*get_flags) (TnyHeader *self); void (*set_flag) (TnyHeader *self, TnyHeaderFlags mask); void (*unset_flag) (TnyHeader *self, TnyHeaderFlags mask); } TnyHeaderIface;
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. The UID corresponds to the UID in
IMAP and the UIDL in POP if UIDL is supported or the UID if not.
|
a TnyHeader |
Returns : |
(null-ok): unique follow-up uid as a read-only string or NULL |
Since 1.0 audience: application-developer
const gchar* tny_header_get_bcc (TnyHeader *self);
Get the BCC header. The returned value should not be freed.
|
a TnyHeader |
Returns : |
(null-ok): BCC header as a read-only string or NULL |
Since 1.0 audience: application-developer
const gchar* tny_header_get_cc (TnyHeader *self);
Get the CC header. The returned value should not be freed.
|
a TnyHeader |
Returns : |
(null-ok): CC header as a read-only string or NULL |
Since 1.0 audience: application-developer
time_t tny_header_get_date_received (TnyHeader *self);
Get the Date Received header as a time_t
|
a TnyHeader |
Returns : |
date received header |
Since 1.0 audience: application-developer
time_t tny_header_get_date_sent (TnyHeader *self);
Get the Date Sent header as a time_t
|
a TnyHeader |
Returns : |
date sent header |
Since 1.0 audience: application-developer
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. The message-id corresponds to the message-id header in the MIME message.
|
a TnyHeader |
Returns : |
(null-ok): message-id header as a read-only string or NULL |
Since 1.0 audience: application-developer
guint tny_header_get_message_size (TnyHeader *self);
Get the expected message's size (the accuracy of the size prediction depends on the availability of an accurate total size of the message at the service).
|
a TnyHeader |
Returns : |
expected message size |
Since 1.0 audience: application-developer
const gchar* tny_header_get_from (TnyHeader *self);
Get the from header. The returned value should not be freed.
|
a TnyHeader |
Returns : |
(null-ok): from header as a read-only string or NULL |
Since 1.0 audience: application-developer
const gchar* tny_header_get_to (TnyHeader *self);
Get the to header. The returned value should not be freed.
|
a TnyHeader |
Returns : |
(null-ok): to header as a read-only string or NULL |
Since 1.0 audience: application-developer
const gchar* tny_header_get_subject (TnyHeader *self);
Get the subject header. The returned value should not be freed.
|
a TnyHeader |
Returns : |
(null-ok): subject header as a read-only string or NULL |
Since 1.0 audience: application-developer
const gchar* tny_header_get_replyto (TnyHeader *self);
Get the reply-to header
|
a TnyHeader |
Returns : |
(null-ok): reply-to header or NULL |
Since 1.0 audience: application-developer
void tny_header_set_bcc (TnyHeader *self, const gchar *bcc);
Set the BCC header. Look at the To header for more information about formatting.
|
a TnyHeader |
|
(null-ok): the BCC header in a comma separated list or NULL |
Since 1.0 audience: application-developer
void tny_header_set_cc (TnyHeader *self, const gchar *cc);
Set the CC header. Look at the To header for more information about formatting.
|
a TnyHeader |
|
(null-ok): the CC header in a comma separated list or NULL |
Since 1.0 audience: application-developer
void tny_header_set_from (TnyHeader *self, const gchar *from);
Set the from header
|
a TnyHeader |
|
(null-ok): the from header or NULL |
Since 1.0 audience: application-developer
void tny_header_set_subject (TnyHeader *self, const gchar *subject);
Set the subject header
|
a TnyHeader |
|
(null-ok): the subject header or NULL |
Since 1.0 audience: application-developer
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.
|
a TnyHeader |
|
(null-ok): the To header in a comma separated list or NULL |
Since 1.0 audience: application-developer
void tny_header_set_replyto (TnyHeader *self, const gchar *to);
Set the reply-to header
|
a TnyHeader |
|
(null-ok): the reply-to header or NULL |
Since 1.0 audience: application-developer
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, if not NULL, must be unreferenced after use.
|
a TnyHeader |
Returns : |
(null-ok) (caller-owns): The folder of the message header or NULL |
Since 1.0 audience: application-developer
TnyHeaderFlags tny_header_get_flags (TnyHeader *self);
Get message's information flags like the message's read state and whether it's detected that it has attachments.
Note: don't use this method to get priority settings. Use tny_header_get_priority in stead.
|
a TnyHeader object |
Returns : |
flags bitmask |
Since 1.0 audience: application-developer
void tny_header_set_flag (TnyHeader *self, TnyHeaderFlags mask);
Modify message's flag mask
. Modifying the TNY_HEADER_FLAG_SEEN will trigger
the notification of folder observers if self
was originated from a folder.
Do not use this method to set priority settings. Use tny_header_set_priority()
in stead. Don't set more than one flag. Use the labels of the TnyHeaderFlags
as an enum.
|
a TnyHeader |
|
a TnyHeaderFlags bitmask flag to set. |
Since 1.0 audience: application-developer
void tny_header_unset_flag (TnyHeader *self, TnyHeaderFlags mask);
Reset message flag mask
. Modifying the TNY_HEADER_FLAG_SEEN will trigger the
notification of folder observers if self
was originated from a folder.
Don't attempt to unset the priority. Use tny_header_set_priority()
with TNY_HEADER_FLAG_NORMAL_PRIORITY to set the priority of a message to normal
(which is the same as unsetting it). Don't unset multiple flags.
|
a TnyHeader |
|
a TnyHeaderFlags flag to clear. |
Since 1.0 audience: application-developer
TnyHeaderFlags tny_header_get_priority (TnyHeader *self);
Get message's priority
|
a TnyHeader |
Returns : |
priority of the message |
Since 1.0 audience: application-developer
void tny_header_set_priority (TnyHeader *self, TnyHeaderFlags priority);
Set the priority of the message. To unset the priority, you can use
TNY_HEADER_FLAG_NORMAL_PRIORITY as priority
. Don't combine priority
with
other flags. Use additional tny_header_set_flag()
calls if you want to do
that.
|
a TnyHeader |
|
A priority setting (high, low or normal) |
Since 1.0 audience: application-developer