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

mailbox.h File Reference

#include <clist.h>
#include "folder-types.h"
#include "mailbox-types.h"
#include "server.h"
#include "manager.h"

Include dependency graph for mailbox.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  XePMailbox_s

Typedefs

typedef void(* XePMailboxListCloneCb )(clist *mailboxes, void *adata)
typedef void(* XePMailboxDisconnectCb )(XePMailbox *mailbox, void *adata)

Functions

clist * a_Mailbox_list_new (void)
clist * a_Mailbox_list_new_copy (clist *mailboxes)
void a_Mailbox_list_free (clist *mailboxes)
void a_Mailbox_list_free_copy (clist *mailboxes)
int a_Mailbox_list_clone (clist *mailboxes_copy, XePMailboxListCloneCb user_cb, void *user_data)
XePMailboxa_Mailbox_new (const char *id)
XePMailboxa_Mailbox_new_copy (XePMailbox *mailbox)
void a_Mailbox_free (XePMailbox *mailbox)
void a_Mailbox_free_copy (XePMailbox *mailbox)
void a_Mailbox_set_type (XePMailbox *mailbox, XePMailboxType type)
void a_Mailbox_set_toplevel (XePMailbox *mailbox, const char *toplevel)
const char * a_Mailbox_get_id (XePMailbox *mailbox)
XePMailboxa_Mailbox_get_from_uid (long uid)
const char * a_Mailbox_type_as_string (XePMailboxType type)
XePMailboxType a_Mailbox_type_from_string (const char *type)
int a_Mailbox_is_busy (XePMailbox *mailbox)
void a_Mailbox_disconnect_all (XePMailbox *mailbox, XePMailboxDisconnectCb user_cb, void *user_data)
void a_Mailbox_disconnect_async (XePMailbox *mailbox, XePManagerMsgCb user_cb, void *user_data)


Typedef Documentation

typedef void(* XePMailboxDisconnectCb)(XePMailbox *mailbox, void *adata)
 

typedef void(* XePMailboxListCloneCb)(clist *mailboxes, void *adata)
 


Function Documentation

void a_Mailbox_disconnect_all XePMailbox mailbox,
XePMailboxDisconnectCb  user_cb,
void *  user_data
 

Disconnect all connections pertaining to the mailbox then call the user provided function. This function calls the user provided function immediatly if no connections exist. Otherwise, the user callback will be called by the main loop when all connections have been shut down.

Here is the call graph for this function:

void a_Mailbox_disconnect_async XePMailbox mailbox,
XePManagerMsgCb  user_cb,
void *  user_data
 

Disconnect a mailbox then call the user provided function. If the mailbox is already disconnected, this function calls the user callback immediatly before returning. Otherwise it returns and the user provided callback is called by the main loop when the mailbox has been disconnected.

Here is the call graph for this function:

void a_Mailbox_free XePMailbox mailbox  ) 
 

Unregister and free a mailbox MAILBOX folder is freeed using a_Folder_free() folders list is freeed using a_Folder_list_free()

Here is the call graph for this function:

void a_Mailbox_free_copy XePMailbox mailbox  ) 
 

Free a mailbox copy MAILBOX folder is freeed using a_Folder_free_copy() folders list is freeed using a_Folder_list_free_copy()

Here is the call graph for this function:

XePMailbox* a_Mailbox_get_from_uid long  uid  ) 
 

const char* a_Mailbox_get_id XePMailbox mailbox  ) 
 

int a_Mailbox_is_busy XePMailbox mailbox  ) 
 

Check whether mailbox folders are running They are considered running if their thread state is XEP_MANAGER_THREAD_STATE_RUNNING

Returns:
-1 if there is at least one folder running, 0 other wise

Here is the call graph for this function:

int a_Mailbox_list_clone clist *  mailboxes_copy,
XePMailboxListCloneCb  user_cb,
void *  user_data
 

Create a usable list of mailboxes from a list of mailbox copies The given list consist of a list of mailboxes created with a_Mailbox_list_new_copy(). These mailbox copies have the same uid as the original ones, but they are not registered. Each mailbox in the list which has a negative uid will be freed When finished, it calls the user_cb() function with the new mailbox list as first argument and the user_data as second argument

Parameters:
mailboxes_copy list of mailboxes copies
user_cb a user provided function called when operation finishes user_data the user data to pass as the second argument to user_cb()
Returns:
0 on success and -1 if malloc() fails This is an asynchronous operation. The result is given to user_cb() in its first argument

Here is the call graph for this function:

void a_Mailbox_list_free clist *  mailboxes  ) 
 

Free the mailboxes in the given list and free the list itself afterwards Mailboxes are freeed with a_Mailbox_free()

Here is the call graph for this function:

void a_Mailbox_list_free_copy clist *  mailboxes  ) 
 

Free the mailbox copies in the given list and free the list itself aftewards. Mailboxes are freeed with a_Mailbox_free_copy()

Here is the call graph for this function:

clist* a_Mailbox_list_new void   ) 
 

Create an empty list to hold XePMailboxes

clist* a_Mailbox_list_new_copy clist *  mailboxes  ) 
 

Create a list of mailboxes that are copies of the given list of mailboxes. Copies are done with a_Mailbox_new_copy()

Returns:
the list of copies of success, NULL otherwise

Here is the call graph for this function:

XePMailbox* a_Mailbox_new const char *  id  ) 
 

Create and register a new mailbox The newly created and registered mailbox has:

  • a strictly positive unique identifier
  • a MAILBOX folder which is NOT registered (MAILBOX folder are registered only for mbox and POP3 mailboxes)
  • an UNKNOWN type
  • USE_MULTIPLE_CONNECTIONS set
  • max_connections set to XEP_MAILBOX_MAX_CONNECTIONS
  • an empty folders list the rest of members are 0 or NULL

Here is the call graph for this function:

XePMailbox* a_Mailbox_new_copy XePMailbox mailbox  ) 
 

Create but do not register a copy of a mailbox The newly created mailbox has:

  • an identical name
  • the same UID
  • the same type
  • an identical server
  • identicals defaults folders references
  • identicals cache and flags settings
  • identical command
  • identical subscribed_only
  • a copy of MAILBOX folder created with a_Folder_new_copy() that has its mailbox member pointing to this mailbox copy
  • a copy of the list of folders created with a_Folder_list_new_copy()

Here is the call graph for this function:

void a_Mailbox_set_toplevel XePMailbox mailbox,
const char *  toplevel
 

Set the toplevel directory of a mailbox If the MAILBOX folder had already a path or if mailbox type is POP3, unregister of MAILBOX folder, update the path and register again with new toplevel (path) This means, when toplevel is set or mailbox is of type POP3, then MAILBOX folder is registered

Here is the call graph for this function:

void a_Mailbox_set_type XePMailbox mailbox,
XePMailboxType  type
 

Set the type of the mailbox For MBOX and POP3 mailboxes, the MAILBOX folder is promoted to a REAL type. For POP3 mailboxes, the previous MAILBOX folder is unregistered if previous type was also POP3 or if previous MAILBOX folder had a path, then it is registered.

Here is the call graph for this function:

const char* a_Mailbox_type_as_string XePMailboxType  type  ) 
 

XePMailboxType a_Mailbox_type_from_string const char *  type  ) 
 


Generated on Wed Oct 22 15:53:45 2003 for XetPan by doxygen 1.3.2