TnyFolderChange

TnyFolderChange — A type with the changes between two states of a folder

Synopsis




#define             TNY_TYPE_FOLDER_CHANGE_CHANGED
                    TnyFolderChange;
TnyFolderChange*    tny_folder_change_new               (TnyFolder *folder);
const gchar*        tny_folder_change_get_rename        (TnyFolderChange *self,
                                                         const gchar **oldname);
void                tny_folder_change_set_rename        (TnyFolderChange *self,
                                                         const gchar *newname);
void                tny_folder_change_set_received_msg  (TnyFolderChange *self,
                                                         TnyMsg *msg);
TnyMsg*             tny_folder_change_get_received_msg  (TnyFolderChange *self);
void                tny_folder_change_set_new_all_count (TnyFolderChange *self,
                                                         guint new_all_count);
void                tny_folder_change_set_new_unread_count
                                                        (TnyFolderChange *self,
                                                         guint new_unread_count);
guint               tny_folder_change_get_new_unread_count
                                                        (TnyFolderChange *self);
guint               tny_folder_change_get_new_all_count (TnyFolderChange *self);
void                tny_folder_change_add_added_header  (TnyFolderChange *self,
                                                         TnyHeader *header);
void                tny_folder_change_add_expunged_header
                                                        (TnyFolderChange *self,
                                                         TnyHeader *header);
void                tny_folder_change_get_added_headers (TnyFolderChange *self,
                                                         TnyList *headers);
void                tny_folder_change_get_expunged_headers
                                                        (TnyFolderChange *self,
                                                         TnyList *headers);
void                tny_folder_change_reset             (TnyFolderChange *self);
TnyFolder*          tny_folder_change_get_folder        (TnyFolderChange *self);
TnyFolderChangeChanged tny_folder_change_get_changed    (TnyFolderChange *self);

Object Hierarchy


  GObject
   +----TnyFolderChange

Description

A type with the delta or changes between two states of a TnyFolder. The TnyFolderObserver will receive instances of this type as information about what got changed.

Details

TNY_TYPE_FOLDER_CHANGE_CHANGED

#define TNY_TYPE_FOLDER_CHANGE_CHANGED (tny_folder_change_changed_get_type())


TnyFolderChange

typedef struct _TnyFolderChange TnyFolderChange;


tny_folder_change_new ()

TnyFolderChange*    tny_folder_change_new               (TnyFolder *folder);

Creates a changeset for folder

folder : a TnyFolder instance
Returns : a new TnyFolderChange instance

tny_folder_change_get_rename ()

const gchar*        tny_folder_change_get_rename        (TnyFolderChange *self,
                                                         const gchar **oldname);

Get the new name of the folder in case of a rename. This will return NULL of no rename happened. You can pass a pointer if you need the old folder name too.

You should not free the returned value nor the oldname pointer.

self : a TnyFolderChange instance
oldname : a pointer to a string (by reference)
Returns : The new folder name or NULL

tny_folder_change_set_rename ()

void                tny_folder_change_set_rename        (TnyFolderChange *self,
                                                         const gchar *newname);

Mark the change in such a way that the user can know that a rename has happened. The TnyFolderChange will copy your newname internally, so you can do whatever you want with what you passed afterwards (like freeing it).

self : a TnyFolderChange instance
newname : the new name of the folder

tny_folder_change_set_received_msg ()

void                tny_folder_change_set_received_msg  (TnyFolderChange *self,
                                                         TnyMsg *msg);

Set the message that got received

self : a TnyFolderChange instance
msg : a TnyMsg instance

tny_folder_change_get_received_msg ()

TnyMsg*             tny_folder_change_get_received_msg  (TnyFolderChange *self);

Get the message that got received, if the change includes receiving a message. If no message was received, NULL will be returned. If not NULL, the returned value must be unreferenced after use.

self : a TnyFolderChange instance
Returns : the message that got received or NULL if no message was received during this change.

tny_folder_change_set_new_all_count ()

void                tny_folder_change_set_new_all_count (TnyFolderChange *self,
                                                         guint new_all_count);

Set the all count of the changeset

self : a TnyFolderChange instance
new_all_count : the new all count of the folder

tny_folder_change_set_new_unread_count ()

void                tny_folder_change_set_new_unread_count
                                                        (TnyFolderChange *self,
                                                         guint new_unread_count);

Set the unread count of the changeset

self : a TnyFolderChange instance
new_unread_count : the new unread count of the folder

tny_folder_change_get_new_unread_count ()

guint               tny_folder_change_get_new_unread_count
                                                        (TnyFolderChange *self);

Get the unread count of the changeset

self : a TnyFolderChange instance
Returns : the new unread-count

tny_folder_change_get_new_all_count ()

guint               tny_folder_change_get_new_all_count (TnyFolderChange *self);

Get the all count of the changeset

self : a TnyFolderChange instance
Returns : the new all-count

tny_folder_change_add_added_header ()

void                tny_folder_change_add_added_header  (TnyFolderChange *self,
                                                         TnyHeader *header);

Add header to the changeset of added headers

self : a TnyFolderChange instance
header : the header to add to the changeset

tny_folder_change_add_expunged_header ()

void                tny_folder_change_add_expunged_header
                                                        (TnyFolderChange *self,
                                                         TnyHeader *header);

Add header to the changeset of expunged headers

self : a TnyFolderChange instance
header : the header to add to the changeset

tny_folder_change_get_added_headers ()

void                tny_folder_change_get_added_headers (TnyFolderChange *self,
                                                         TnyList *headers);

Get the added headers in this changeset

self : a TnyFolderChange instance
headers : the TnyList where the added headers will be put it

tny_folder_change_get_expunged_headers ()

void                tny_folder_change_get_expunged_headers
                                                        (TnyFolderChange *self,
                                                         TnyList *headers);

Get the removed headers in this changeset

self : a TnyFolderChange instance
headers : the TnyList where the removed headers will be put it

tny_folder_change_reset ()

void                tny_folder_change_reset             (TnyFolderChange *self);

Reset the state of self

self : a TnyFolderChange instance

tny_folder_change_get_folder ()

TnyFolder*          tny_folder_change_get_folder        (TnyFolderChange *self);

Get the folder of self. The return value of this method must be unreferenced after use.

self : a TnyFolderChange instance
Returns : the TnyFolder related to this changeset

tny_folder_change_get_changed ()

TnyFolderChangeChanged tny_folder_change_get_changed    (TnyFolderChange *self);

Get an enum with all the changed things

self : a TnyFolderChange instance
Returns : the changed-flags

See Also

TnyFolderObserver, TnyFolder, TnyFolderMonitor