Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

folder.h File Reference

#include <clist.h>
#include <chash.h>
#include "cntree.h"
#include "libetpan.h"
#include "manager.h"
#include "folder-types.h"
#include "mailbox-types.h"

Include dependency graph for folder.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Compounds

struct  XePFolder_s

Typedefs

typedef clist XePFoldersList
typedef void(* XePFolderListCopyCb )(void *user_data)

Enumerations

enum  XePFolderType { XEP_FOLDER_TYPE_REAL, XEP_FOLDER_TYPE_VIRTUAL, XEP_FOLDER_TYPE_MAILBOX }

Functions

clist * a_Folder_list_new (void)
clist * a_Folder_list_new_copy (clist *folders)
void a_Folder_list_free (clist *folders)
void a_Folder_list_free_copy (clist *folders)
void a_Folder_list_copy (clist *source, clist *target, XePMailbox *mailbox, XePFolderListCopyCb user_cb, void *user_data)
XePFoldera_Folder_new (XePFolderType type)
XePFoldera_Folder_new_copy (XePFolder *folder)
void a_Folder_free (XePFolder *folder)
void a_Folder_free_copy (XePFolder *folder)
void a_Folder_copy (XePFolder *source, XePFolder *target)
XePFoldera_Folder_get_from_uid (long uid)
XePFolderType a_Folder_get_type (XePFolder *folder)
void a_Folder_update_id (XePFolder *folder)
const char * a_Folder_get_id (XePFolder *folder)
void a_Folder_set_path (XePFolder *folder, const char *path)
void a_Folder_set_path_p (XePFolder *folder, char *path)
const char * a_Folder_get_path (XePFolder *folder)
void a_Folder_set_mailbox (XePFolder *folder, XePMailbox *mailbox)
XePMailboxa_Folder_get_mailbox (XePFolder *folder)
const char * a_Folder_get_short_name (XePFolder *folder)
void a_Folder_set_folder_refs (XePFolder *folder, clist *folder_refs)
const clist * a_Folder_get_folder_refs (XePFolder *folder)
void a_Folder_set_condition_refs (XePFolder *folder, clist *condition_refs)
const clist * a_Folder_get_condition_refs (XePFolder *folder)
XePFolderRefa_Folder_ref_new (void)
XePFolderRefa_Folder_ref_new_copy (XePFolderRef *folder_ref)
void a_Folder_ref_free (XePFolderRef *folder_ref)
void a_Folder_ref_free_content (XePFolderRef *folder_ref)
clist * a_Folder_ref_list_new (void)
void a_Folder_ref_list_free (clist *folder_refs)
chash * a_Folder_ref_hash_new (void)
void a_Folder_ref_hash_free (void)
chash * a_Folder_ref_hash_get (void)
int a_Folder_register (XePFolder *folder)
int a_Folder_unregister (XePFolder *folder)
int a_Folder_register_list (clist *folders)
int a_Folder_unregister_list (clist *folders)
XePFoldera_Folder_get_from_ref (const char *ref)
void a_Folder_update_rules_links (XePFoldersList *folders)
int a_Folder_ref_link_to_folder (XePFolderRef *folder_ref)
void a_Folder_ref_relink_all (void)
XePManagerThreadState a_Folder_get_thread_state (XePFolder *folder)
int a_Folder_is_locked (XePFolder *folder)
int a_Folder_connect (XePFolder *folder)
int a_Folder_disconnect (XePFolder *folder)
int a_Folder_noop (XePFolder *folder)
int a_Folder_expunge (XePFolder *folder)
int a_Folder_sync (XePFolder *folder)
int a_Folder_check (XePFolder *folder)
int a_Folder_append (XePFolder *folder, const char *data, size_t size)
int a_Folder_mailbox_connect (XePFolder *folder)
int a_Folder_mailbox_disconnect (XePFolder *folder)
int a_Folder_mailbox_list (XePFolder *folder, struct mail_list **mb_list)
int a_Folder_mailbox_lsub (XePFolder *folder, struct mail_list **mb_list)
void a_Folder_append_file_async (XePFolder *folder, const char *filename, XePManagerMsgCb user_cb, void *user_data)
void a_Folder_disconnect_async (XePFolder *folder, XePManagerMsgCb user_cb, void *user_data)
uint32_t a_Folder_tree_get_total_count (XePFolder *folder)
void a_Folder_messages_change_flags_async (XePFolder *folder, carray *messages, XePManagerMsgCb user_cb, void *user_data)


Typedef Documentation

typedef void(* XePFolderListCopyCb)(void *user_data)
 

typedef clist XePFoldersList
 


Enumeration Type Documentation

enum XePFolderType
 

Type of folder.

Enumeration values:
XEP_FOLDER_TYPE_REAL 
XEP_FOLDER_TYPE_VIRTUAL 
XEP_FOLDER_TYPE_MAILBOX 


Function Documentation

int a_Folder_append XePFolder folder,
const char *  data,
size_t  size
 

Append a message to a folder

Parameters:
folder 
data pointer to the rfc2822/822 message
size the size of the message
Returns:
MAIL_NO_ERROR on success and MAIL_ERROR_XXX on error

Here is the call graph for this function:

void a_Folder_append_file_async XePFolder folder,
const char *  filename,
XePManagerMsgCb  user_cb,
void *  user_data
 

Append a file to a folder in an asynchronous way then call the user provided function when finished.

Parameters:
folder the target XePFolder
filename the file containing the RFC2822/822 message to append
user_cb the user callback function called when the operation finishes
user_data the user data to pass to the user callback function

Here is the call graph for this function:

int a_Folder_check XePFolder folder  ) 
 

Checkpoint folder

Here is the call graph for this function:

int a_Folder_connect XePFolder folder  ) 
 

Here is the call graph for this function:

void a_Folder_copy XePFolder source,
XePFolder target
 

Copy the settings of one source folder to the target folder The target has:

  • an identical ID
  • an identitcal path
  • for REAL and MAILBOX types: a copy of source's rule_refs (target's original rule_refs are freeed)
  • for VIRTUAL type: a copy of source's folder_refs and condition_refs (target's original ones are freeed)

Here is the call graph for this function:

int a_Folder_disconnect XePFolder folder  ) 
 

void a_Folder_disconnect_async XePFolder folder,
XePManagerMsgCb  user_cb,
void *  user_data
 

Here is the call graph for this function:

int a_Folder_expunge XePFolder folder  ) 
 

Here is the call graph for this function:

void a_Folder_free XePFolder folder  ) 
 

Unregister and free a folder. Must not be used for folders created with a_Folder_new_copy()

void a_Folder_free_copy XePFolder folder  ) 
 

Free a folder (without unregistering) To be used for folders created with a_Folder_new_copy

const clist* a_Folder_get_condition_refs XePFolder folder  ) 
 

const clist* a_Folder_get_folder_refs XePFolder folder  ) 
 

XePFolder* a_Folder_get_from_ref const char *  ref  ) 
 

Return the XePFolder registered with the given ID (ref)

Returns:
pointer to the XePFolder if found, NULL otherwise.

XePFolder* a_Folder_get_from_uid long  uid  ) 
 

Find the folder associated to the given Unique Identifier (uid)

Parameters:
uid unique identifier
Returns:
the XePFolder associated to it, or NULL if there is no folder with this uid

const char* a_Folder_get_id XePFolder folder  ) 
 

Return the folder's ID

Parameters:
folder the folder which ID is sought

XePMailbox* a_Folder_get_mailbox XePFolder folder  ) 
 

const char* a_Folder_get_path XePFolder folder  ) 
 

const char* a_Folder_get_short_name XePFolder folder  ) 
 

Get a short name for the folder For VIRTUAL folders, this is its path (i.e. name) For MAILBOX folders, this is Mailbox ID For REAL folders:

  • IMAP: last part of the path
  • MH: idem
  • everything else, the complete path

XePManagerThreadState a_Folder_get_thread_state XePFolder folder  ) 
 

Get the state of the thread associated with the folder

Parameters:
folder an existing folder
Returns:
the thread state

Here is the call graph for this function:

XePFolderType a_Folder_get_type XePFolder folder  ) 
 

int a_Folder_is_locked XePFolder folder  ) 
 

Here is the call graph for this function:

void a_Folder_list_copy clist *  source,
clist *  target,
XePMailbox mailbox,
XePFolderListCopyCb  user_cb,
void *  user_data
 

Copy the list of folders from source to target Disconnect and free source folders marked for delete (uid < 0) Register new folders Call user_cb when all changes are done

Parameters:
source the list of folders to copy
target the list that will receive the copies
mailbox the target mailbox
user_cb a user function called when operation finishes
user_data the user data to pass to user_cb() as second arg

Here is the call graph for this function:

void a_Folder_list_free clist *  folders  ) 
 

Releases resources from a folder list.

Parameters:
folders the list of folders to be deleted.

Here is the call graph for this function:

void a_Folder_list_free_copy clist *  folders  ) 
 

Here is the call graph for this function:

clist* a_Folder_list_new void   ) 
 

clist* a_Folder_list_new_copy clist *  folders  ) 
 

Here is the call graph for this function:

int a_Folder_mailbox_connect XePFolder folder  ) 
 

int a_Folder_mailbox_disconnect XePFolder folder  ) 
 

int a_Folder_mailbox_list XePFolder folder,
struct mail_list **  mb_list
 

Here is the call graph for this function:

int a_Folder_mailbox_lsub XePFolder folder,
struct mail_list **  mb_list
 

Here is the call graph for this function:

void a_Folder_messages_change_flags_async XePFolder folder,
carray *  messages,
XePManagerMsgCb  user_cb,
void *  user_data
 

Here is the call graph for this function:

XePFolder* a_Folder_new XePFolderType  type  ) 
 

Create a new folder and register it The newly created folder has:

  • a unique strictly positive uid
  • a thread state set to XEP_MANAGER_THREAD_STATE_NONE
  • for REAL and MAILBOX types: an emtpy list of rule_refs
  • for VIRTUAL type: emtpy lists in folder_refs and confition_refs The rest is O on NULL

XePFolder* a_Folder_new_copy XePFolder folder  ) 
 

Create a copy of a folder The copy has:

  • the same UID,
  • an identical ID
  • an identical PATH
  • a thread state set to XEP_MANAGER_THREAD_STATE_NONE
  • for REAL and MAILBOXES types: a copy of rule_refs
  • for VIRTUAL type: a copy of folder_refs and condition_refs

Here is the call graph for this function:

int a_Folder_noop XePFolder folder  ) 
 

Here is the call graph for this function:

void a_Folder_ref_free XePFolderRef folder_ref  ) 
 

Unregister and release resources used by XePFolderId

Here is the call graph for this function:

void a_Folder_ref_free_content XePFolderRef folder_ref  ) 
 

Release resources used by XePFolderRef content without unregistering it

void a_Folder_ref_hash_free void   ) 
 

Free the global hash table for XePFolder references

chash* a_Folder_ref_hash_get void   ) 
 

Return the pointer to the global hash table for XePFolderRefs

chash* a_Folder_ref_hash_new void   ) 
 

Create the global hash table that will store registered folder IDs

int a_Folder_ref_link_to_folder XePFolderRef folder_ref  ) 
 

Set the XePFolder member of XePFolderRef to the folder registered under the reference stored in the ref member of the XePFolderRef. After successful operation, the XePFolderRef has a consitent state where its ref corresponds to its folder

Returns:
0 on success

Here is the call graph for this function:

void a_Folder_ref_list_free clist *  folder_refs  ) 
 

Unregister and free all XePFolderRefs in the list and free the list itself

Here is the call graph for this function:

clist* a_Folder_ref_list_new void   ) 
 

Create an empty list that will contain XePFolderRefs

XePFolderRef* a_Folder_ref_new void   ) 
 

Create and register a new XePFolderRef This is a triplet (Ref, XePFolder, enabled) where Ref is the reference (ID) of a folder, XePFolder contains the pointer to this referred to folder and enabled is a flag XePFolderRefs are registered

XePFolderRef* a_Folder_ref_new_copy XePFolderRef folder_ref  ) 
 

Create and register a new XePFolderRef with the same reference as the given one

Here is the call graph for this function:

void a_Folder_ref_relink_all void   ) 
 

Relink all folder references to the correspondig folder This functions updates the XePFolderRef::folder member of all known XePFolderRefs.

Here is the call graph for this function:

int a_Folder_register XePFolder folder  ) 
 

Register a folder in the global hash table for folder IDs

Returns:
0 on success. Fails if folder's id is already registered

int a_Folder_register_list clist *  folders  ) 
 

Register a list of folders in the global hash table for folder IDs

Returns:
0 on success. Fails as soon as a_Folder_register() fails for one of the items in the list

Here is the call graph for this function:

void a_Folder_set_condition_refs XePFolder folder,
clist *  condition_refs
 

void a_Folder_set_folder_refs XePFolder folder,
clist *  folder_refs
 

void a_Folder_set_mailbox XePFolder folder,
XePMailbox mailbox
 

Set the mailbox to which the folder pertains This invalidates folder's ID and thus a_Folder_update_id() should be called afterwards

void a_Folder_set_path XePFolder folder,
const char *  path
 

Set folder's path, or in case of a VFolder, its name

Parameters:
folder the folder which path/name is to be set
path the path/name of the folder/VFolder

void a_Folder_set_path_p XePFolder folder,
char *  path
 

Set folder's path, or in case of a VFolder, its name This invalidates folder ID, thus a_Folder_update_id() should be called afterwards.

Parameters:
folder the folder which path/name is to be set
path the path/name of the folder/VFolder, folder will get ownership on path.

int a_Folder_sync XePFolder folder  ) 
 

Sync folder content with mailbox Eventually connect to the mailbox and retrieve content. At the end of the operation, folder should have the same information as the mailbox.

Here is the call graph for this function:

uint32_t a_Folder_tree_get_total_count XePFolder folder  ) 
 

Get total count of message tree nodes, including dummy messages this is used for the tree view because it needs to know the total number of rows displayed

int a_Folder_unregister XePFolder folder  ) 
 

Unregister a folder in the global hash table for folder IDs

Returns:
0 on success. Fails if folder ID was not found to be registered

int a_Folder_unregister_list clist *  folders  ) 
 

Unregister a list of folders in the global hash table for folder IDs

Returns:
0 on success. Fails as soon as a_Folder_unregister() fails for one of the items in the list

Here is the call graph for this function:

void a_Folder_update_id XePFolder folder  ) 
 

Update folder's ID. ID is composed from its Mailbox ID and its path. As setting the mailbox or the path of the folder invalidates its id string, this function must be called explicitly to recreate it.

Parameters:
folder the folder which ID string has to be updated. The ID string is the concatenation of mailbox's ID and folder's path with a colon between them.

Here is the call graph for this function:

void a_Folder_update_rules_links XePFoldersList folders  ) 
 

Create the rules links used by a folder. A folder first holds the identifier (XePProcessingRuleId) for the processing rules it uses. This function use these identifiers to search the rules, get the pointer to the XePProcessingRule and store it. The identifiers are the freeed and NULLified.


Generated on Wed Oct 22 15:51:54 2003 for XetPan by doxygen 1.3.2