TnySessionCamel

TnySessionCamel — A session type for Camel

Synopsis

                    TnySessionCamelPriv;
                    TnySessionCamel;
void                tny_session_camel_set_account_store (TnySessionCamel *self,
                                                         TnyAccountStore *account_store);
void                tny_session_camel_set_device        (TnySessionCamel *self,
                                                         TnyDevice *device);
void                tny_session_camel_set_ui_locker     (TnySessionCamel *self,
                                                         TnyLockable *ui_lock);
void                tny_session_camel_set_initialized   (TnySessionCamel *self);

Description

A type being used internally by the libtinymail-camel implementation. It, for example, observes the TnyDevice instance for the online/offline status of the device and registers the accounts with the Camel library.

The Camel library uses the offline/online status for knowing whether it should attempt to get unavailable messages from the service and put them in cache or whether it should only try to read from that cache.

The type is also used for delivering alert messages, like SSL certificate questions, to the account store, delivering passwords to the services and delivering the command to forget the password to the password store in case the service replied that the password was incorrect.

Most people will not have to care about this type a lot. Most people should simply follow the guidelines for implementing a TnyAccountStore and after that always develop against the TnyAccountStore interface API using an instance of their implementation.

Details

TnySessionCamelPriv

typedef struct {
	gpointer device;
	gpointer account_store;
	gboolean interactive, prev_constat;
	guint connchanged_signal;

	GHashTable *current_accounts;
	GStaticRecMutex *current_accounts_lock;

	gchar *camel_dir;
	gboolean in_auth_function, is_connecting;
	TnyLockable *ui_lock;
	GMutex *queue_lock;

	gboolean stop_now, initialized;
	gboolean is_inuse;
	GList *regged_queues;
} TnySessionCamelPriv;


TnySessionCamel

typedef struct {
	CamelSession parent_object;
	TnySessionCamelPriv *priv;
} TnySessionCamel;


tny_session_camel_set_account_store ()

void                tny_session_camel_set_account_store (TnySessionCamel *self,
                                                         TnyAccountStore *account_store);

Set the account store of self.

self :

a TnySessionCamel object

account_store :

A TnyAccountStore account store instance

tny_session_camel_set_device ()

void                tny_session_camel_set_device        (TnySessionCamel *self,
                                                         TnyDevice *device);

Set the device of self.

self :

a TnySessionCamel object

device :

a TnyDevice instance

tny_session_camel_set_ui_locker ()

void                tny_session_camel_set_ui_locker     (TnySessionCamel *self,
                                                         TnyLockable *ui_lock);

Set the user interface toolkit locker. The lock and unlock methods of this locker should be implemented with the lock and unlock functionality of your user interface toolkit.

Good examples are gdk_threads_enter() and gdk_threads_leave() in gtk+.

self :

a TnySessionCamel instance

ui_lock :

a TnyLockable instance

tny_session_camel_set_initialized ()

void                tny_session_camel_set_initialized   (TnySessionCamel *self);

This method must be called once the initial accounts are created in your TnyAccountStore implementation and should indicate that the initialization of your initial accounts is completed.

self :

the TnySessionCamel instance

See Also

TnyDevice, TnyAccount, TnyStoreAccount, TnyTransportAccount, TnyCamelStoreAccount, TnyCamelTransportAccount