TnyHeader

TnyHeader — A type that defines a header

Synopsis




#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);

Object Hierarchy


  GInterface
   +----TnyHeader

Prerequisites

TnyHeader requires GObject.

Known Implementations

TnyHeader is implemented by TnyCamelHeader and TnyCamelMsgHeader.

Description

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.

Details

TNY_TYPE_HEADER_FLAGS

#define TNY_TYPE_HEADER_FLAGS (tny_header_flags_get_type())


TnyHeader

typedef struct _TnyHeader TnyHeader;


TnyHeaderIface

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;


TNY_TYPE_HEADER_PRIORITY_FLAGS

#define TNY_TYPE_HEADER_PRIORITY_FLAGS (tny_header_priority_flags_get_type())


tny_header_flags_get_type ()

GType               tny_header_flags_get_type           (void);

GType system helper function

Returns : a GType

tny_header_get_uid ()

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

tny_header_get_bcc ()

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

tny_header_get_cc ()

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

tny_header_get_date_received ()

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

tny_header_get_date_sent ()

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

tny_header_get_message_id ()

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

tny_header_get_message_size ()

guint               tny_header_get_message_size         (TnyHeader *self);

Get the expected message size

self : a TnyHeader object
Returns : expected message size

tny_header_get_from ()

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

tny_header_get_to ()

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

tny_header_get_subject ()

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

tny_header_get_replyto ()

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

tny_header_set_bcc ()

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

tny_header_set_cc ()

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

tny_header_set_from ()

void                tny_header_set_from                 (TnyHeader *self,
                                                         const gchar *from);

Set the from header

self : a TnyHeader object
from : the from header

tny_header_set_subject ()

void                tny_header_set_subject              (TnyHeader *self,
                                                         const gchar *subject);

Set the subject header

self : a TnyHeader object
subject : the subject header

tny_header_set_to ()

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

tny_header_set_replyto ()

void                tny_header_set_replyto              (TnyHeader *self,
                                                         const gchar *to);

Set the reply-to header

self : a TnyHeader object
to : the reply-to header

tny_header_get_folder ()

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

tny_header_get_flags ()

TnyHeaderFlags      tny_header_get_flags                (TnyHeader *self);

Get message information flags.

self : a TnyHeader object
Returns : flag bitmask

tny_header_set_flags ()

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.

tny_header_unset_flags ()

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.

See Also

TnyMsg, TnyFolder, TnyGtkHeaderListModel, TnyHeaderFlags