<refentry id="camel-CamelSession">
<refmeta>
<refentrytitle role="top_of_page" id="camel-CamelSession.top_of_page">CamelSession</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAMEL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>CamelSession</refname>
<refpurpose></refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv id="camel-CamelSession.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
struct              <link linkend="CamelSession">CamelSession</link>;
<link linkend="gboolean">gboolean</link>            (<link linkend="CamelTimeoutCallback">*CamelTimeoutCallback</link>)             (<link linkend="gpointer">gpointer</link> data);
enum                <link linkend="CamelSessionAlertType">CamelSessionAlertType</link>;
                    <link linkend="CamelSessionThreadOps">CamelSessionThreadOps</link>;
                    <link linkend="CamelSessionThreadMsg">CamelSessionThreadMsg</link>;
<link linkend="void">void</link>                <link linkend="camel-session-construct">camel_session_construct</link>             (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *storage_path);
<link linkend="CamelService">CamelService</link>*       <link linkend="camel-session-get-service">camel_session_get_service</link>           (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *url_string,
                                                         <link linkend="CamelProviderType">CamelProviderType</link> type,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="CamelService">CamelService</link>*       <link linkend="camel-session-get-service-connected">camel_session_get_service_connected</link> (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *url_string,
                                                         <link linkend="CamelProviderType">CamelProviderType</link> type,
                                                         <link linkend="CamelException">CamelException</link> *ex);
#define             <link linkend="camel-session-get-store">camel_session_get_store</link>             (session, url_string, ex)
#define             <link linkend="camel-session-get-transport">camel_session_get_transport</link>         (session, url_string, ex)
<link linkend="char">char</link>*               <link linkend="camel-session-get-storage-path">camel_session_get_storage_path</link>      (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelService">CamelService</link> *service,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="char">char</link>*               <link linkend="camel-session-get-password">camel_session_get_password</link>          (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelService">CamelService</link> *service,
                                                         const <link linkend="char">char</link> *domain,
                                                         const <link linkend="char">char</link> *prompt,
                                                         const <link linkend="char">char</link> *item,
                                                         <link linkend="guint32">guint32</link> flags,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="void">void</link>                <link linkend="camel-session-forget-password">camel_session_forget_password</link>       (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelService">CamelService</link> *service,
                                                         const <link linkend="char">char</link> *domain,
                                                         const <link linkend="char">char</link> *item,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-session-alert-user">camel_session_alert_user</link>            (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionAlertType">CamelSessionAlertType</link> type,
                                                         const <link linkend="char">char</link> *prompt,
                                                         <link linkend="gboolean">gboolean</link> cancel);
<link linkend="char">char</link>*               <link linkend="camel-session-build-password-prompt">camel_session_build_password_prompt</link> (const <link linkend="char">char</link> *type,
                                                         const <link linkend="char">char</link> *user,
                                                         const <link linkend="char">char</link> *host);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-session-is-online">camel_session_is_online</link>             (<link linkend="CamelSession">CamelSession</link> *session);
<link linkend="void">void</link>                <link linkend="camel-session-set-online">camel_session_set_online</link>            (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="gboolean">gboolean</link> online);
<link linkend="CamelFilterDriver">CamelFilterDriver</link>*  <link linkend="camel-session-get-filter-driver">camel_session_get_filter_driver</link>     (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *type,
                                                         <link linkend="CamelException">CamelException</link> *ex);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-session-check-junk">camel_session_check_junk</link>            (<link linkend="CamelSession">CamelSession</link> *session);
<link linkend="void">void</link>                <link linkend="camel-session-set-check-junk">camel_session_set_check_junk</link>        (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="gboolean">gboolean</link> check_junk);
<link linkend="void">void</link>*               <link linkend="camel-session-thread-msg-new">camel_session_thread_msg_new</link>        (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionThreadOps">CamelSessionThreadOps</link> *ops,
                                                         unsigned <link linkend="int">int</link> size);
<link linkend="void">void</link>                <link linkend="camel-session-thread-msg-free">camel_session_thread_msg_free</link>       (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionThreadMsg">CamelSessionThreadMsg</link> *msg);
<link linkend="int">int</link>                 <link linkend="camel-session-thread-queue">camel_session_thread_queue</link>          (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionThreadMsg">CamelSessionThreadMsg</link> *msg,
                                                         <link linkend="int">int</link> flags);
<link linkend="void">void</link>                <link linkend="camel-session-thread-wait">camel_session_thread_wait</link>           (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="int">int</link> id);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-session-get-network-state">camel_session_get_network_state</link>     (<link linkend="CamelSession">CamelSession</link> *session);
<link linkend="void">void</link>                <link linkend="camel-session-set-network-state">camel_session_set_network_state</link>     (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="gboolean">gboolean</link> network_state);
const <link linkend="GHashTable">GHashTable</link>*   <link linkend="camel-session-get-junk-headers">camel_session_get_junk_headers</link>      (<link linkend="CamelSession">CamelSession</link> *session);
<link linkend="void">void</link>                <link linkend="camel-session-set-junk-headers">camel_session_set_junk_headers</link>      (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> **headers,
                                                         const <link linkend="char">char</link> **values,
                                                         <link linkend="int">int</link> len);
<link linkend="gboolean">gboolean</link>            <link linkend="camel-session-lookup-addressbook">camel_session_lookup_addressbook</link>    (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *name);
</synopsis>
</refsynopsisdiv>









<refsect1 id="camel-CamelSession.description" role="desc">
<title role="desc.title">Description</title>
<para>

</para>
</refsect1>

<refsect1 id="camel-CamelSession.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CamelSession" role="struct">
<title>struct CamelSession</title>
<indexterm zone="CamelSession"><primary>CamelSession</primary></indexterm><programlisting>struct CamelSession {
	CamelObject parent_object;
	struct _CamelSessionPrivate *priv;

	char *storage_path;
	CamelJunkPlugin *junk_plugin;

	guint online:1;
	guint check_junk:1;
	guint network_state:1;
};
</programlisting>
<para>

</para></refsect2>
<refsect2 id="CamelTimeoutCallback" role="function">
<title>CamelTimeoutCallback ()</title>
<indexterm zone="CamelTimeoutCallback"><primary>CamelTimeoutCallback</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            (*CamelTimeoutCallback)             (<link linkend="gpointer">gpointer</link> data);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="CamelSessionAlertType" role="enum">
<title>enum CamelSessionAlertType</title>
<indexterm zone="CamelSessionAlertType"><primary>CamelSessionAlertType</primary></indexterm><programlisting>typedef enum {
	CAMEL_SESSION_ALERT_INFO,
	CAMEL_SESSION_ALERT_WARNING,
	CAMEL_SESSION_ALERT_ERROR
} CamelSessionAlertType;
</programlisting>
<para>

</para></refsect2>
<refsect2 id="CamelSessionThreadOps" role="struct">
<title>CamelSessionThreadOps</title>
<indexterm zone="CamelSessionThreadOps"><primary>CamelSessionThreadOps</primary></indexterm><programlisting>typedef struct {
	void (*receive)(CamelSession *session, struct _CamelSessionThreadMsg *m);
	void (*free)(CamelSession *session, struct _CamelSessionThreadMsg *m);
} CamelSessionThreadOps;
</programlisting>
<para>

</para></refsect2>
<refsect2 id="CamelSessionThreadMsg" role="struct">
<title>CamelSessionThreadMsg</title>
<indexterm zone="CamelSessionThreadMsg"><primary>CamelSessionThreadMsg</primary></indexterm><programlisting>typedef struct {
	CamelMsg msg;

	int id;

	CamelException ex;
	CamelSessionThreadOps *ops;
	struct _CamelOperation *op;
	CamelSession *session;

	void *data; /* free for implementation to define, not used by camel, do not use in client code */
	/* user fields follow */
} CamelSessionThreadMsg;
</programlisting>
<para>

</para></refsect2>
<refsect2 id="camel-session-construct" role="function">
<title>camel_session_construct ()</title>
<indexterm zone="camel-session-construct"><primary>camel_session_construct</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_construct             (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *storage_path);</programlisting>
<para>
Constructs <parameter>session</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object to construct
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>storage_path</parameter>&nbsp;:</term>
<listitem><simpara> path to a directory the session can use for
persistent storage. (This directory must already exist.)
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-service" role="function">
<title>camel_session_get_service ()</title>
<indexterm zone="camel-session-get-service"><primary>camel_session_get_service</primary></indexterm><programlisting><link linkend="CamelService">CamelService</link>*       camel_session_get_service           (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *url_string,
                                                         <link linkend="CamelProviderType">CamelProviderType</link> type,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
This resolves a <link linkend="CamelURL"><type>CamelURL</type></link> into a <link linkend="CamelService"><type>CamelService</type></link>, including loading the
provider library for that service if it has not already been loaded.
</para>
<para>
Services are cached, and asking for "the same" <parameter>url_string</parameter> multiple
times will return the same CamelService (with its reference count
incremented by one each time). What constitutes "the same" URL
depends in part on the provider.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>url_string</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelURL"><type>CamelURL</type></link> describing the service to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara> the provider type (<link linkend="CAMEL-PROVIDER-STORE:CAPS"><type>CAMEL_PROVIDER_STORE</type></link> or
<link linkend="CAMEL-PROVIDER-TRANSPORT:CAPS"><type>CAMEL_PROVIDER_TRANSPORT</type></link>) to get, since some URLs may be able
to specify either type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the requested <link linkend="CamelService"><type>CamelService</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-service-connected" role="function">
<title>camel_session_get_service_connected ()</title>
<indexterm zone="camel-session-get-service-connected"><primary>camel_session_get_service_connected</primary></indexterm><programlisting><link linkend="CamelService">CamelService</link>*       camel_session_get_service_connected (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *url_string,
                                                         <link linkend="CamelProviderType">CamelProviderType</link> type,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
This works like <link linkend="camel-session-get-service"><type>camel_session_get_service</type></link>, but also ensures that
the returned service will have been successfully connected (via
<link linkend="camel-service-connect"><type>camel_service_connect</type></link>.)</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>url_string</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelURL"><type>CamelURL</type></link> describing the service to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara> the provider type
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the requested <link linkend="CamelService"><type>CamelService</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-store" role="macro">
<title>camel_session_get_store()</title>
<indexterm zone="camel-session-get-store"><primary>camel_session_get_store</primary></indexterm><programlisting>#define             camel_session_get_store(session, url_string, ex)</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>url_string</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-transport" role="macro">
<title>camel_session_get_transport()</title>
<indexterm zone="camel-session-get-transport"><primary>camel_session_get_transport</primary></indexterm><programlisting>#define             camel_session_get_transport(session, url_string, ex)</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>url_string</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-storage-path" role="function">
<title>camel_session_get_storage_path ()</title>
<indexterm zone="camel-session-get-storage-path"><primary>camel_session_get_storage_path</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_session_get_storage_path      (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelService">CamelService</link> *service,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
This returns the path to a directory which the service can use for
its own purposes. Data stored there will remain between Evolution
sessions. No code outside of that service should ever touch the
files in this directory. If the directory does not exist, it will
be created.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>service</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelService"><type>CamelService</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the path (which the caller must free), or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if an error
occurs.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-password" role="function">
<title>camel_session_get_password ()</title>
<indexterm zone="camel-session-get-password"><primary>camel_session_get_password</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_session_get_password          (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelService">CamelService</link> *service,
                                                         const <link linkend="char">char</link> *domain,
                                                         const <link linkend="char">char</link> *prompt,
                                                         const <link linkend="char">char</link> *item,
                                                         <link linkend="guint32">guint32</link> flags,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
This function is used by a <link linkend="CamelService"><type>CamelService</type></link> to ask the application and
the user for a password or other authentication data.
</para>
<para>
<parameter>service</parameter> and <parameter>item</parameter> together uniquely identify the piece of data the
caller is concerned with.
</para>
<para>
<parameter>prompt</parameter> is a question to ask the user (if the application doesn't
already have the answer cached). If <link linkend="CAMEL-SESSION-PASSWORD-SECRET:CAPS"><type>CAMEL_SESSION_PASSWORD_SECRET</type></link>
is set, the user's input will not be echoed back.
</para>
<para>
If <link linkend="CAMEL-SESSION-PASSWORD-STATIC:CAPS"><type>CAMEL_SESSION_PASSWORD_STATIC</type></link> is set, it means the password returned
will be stored statically by the caller automatically, for the current
session.
</para>
<para>
The authenticator should set <parameter>ex</parameter> to <link linkend="CAMEL-EXCEPTION-USER-CANCEL:CAPS"><type>CAMEL_EXCEPTION_USER_CANCEL</type></link> if
the user did not provide the information. The caller must <link linkend="g-free"><type>g_free</type></link>
the information returned when it is done with it.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>service</parameter>&nbsp;:</term>
<listitem><simpara> the <link linkend="CamelService"><type>CamelService</type></link> this query is being made by
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>domain</parameter>&nbsp;:</term>
<listitem><simpara> domain of password request.  May be null to use the default.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prompt</parameter>&nbsp;:</term>
<listitem><simpara> prompt to provide to user
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>item</parameter>&nbsp;:</term>
<listitem><simpara> an identifier, unique within this service, for the information
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&nbsp;:</term>
<listitem><simpara> <link linkend="CAMEL-SESSION-PASSWORD-REPROMPT:CAPS"><type>CAMEL_SESSION_PASSWORD_REPROMPT</type></link>, the prompt should force a reprompt
<link linkend="CAMEL-SESSION-PASSWORD-SECRET:CAPS"><type>CAMEL_SESSION_PASSWORD_SECRET</type></link>, whether the password is secret
<link linkend="CAMEL-SESSION-PASSWORD-STATIC:CAPS"><type>CAMEL_SESSION_PASSWORD_STATIC</type></link>, the password is remembered externally
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the authentication information or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-forget-password" role="function">
<title>camel_session_forget_password ()</title>
<indexterm zone="camel-session-forget-password"><primary>camel_session_forget_password</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_forget_password       (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelService">CamelService</link> *service,
                                                         const <link linkend="char">char</link> *domain,
                                                         const <link linkend="char">char</link> *item,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
This function is used by a <link linkend="CamelService"><type>CamelService</type></link> to tell the application
that the authentication information it provided via
<link linkend="camel-session-get-password"><type>camel_session_get_password</type></link> was rejected by the service. If the
application was caching this information, it should stop,
and if the service asks for it again, it should ask the user.
</para>
<para>
<parameter>service</parameter> and <parameter>item</parameter> identify the rejected authentication information,
as with <link linkend="camel-session-get-password"><type>camel_session_get_password</type></link>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>service</parameter>&nbsp;:</term>
<listitem><simpara> the <link linkend="CamelService"><type>CamelService</type></link> rejecting the password
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>domain</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>item</parameter>&nbsp;:</term>
<listitem><simpara> an identifier, unique within this service, for the information
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-alert-user" role="function">
<title>camel_session_alert_user ()</title>
<indexterm zone="camel-session-alert-user"><primary>camel_session_alert_user</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_session_alert_user            (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionAlertType">CamelSessionAlertType</link> type,
                                                         const <link linkend="char">char</link> *prompt,
                                                         <link linkend="gboolean">gboolean</link> cancel);</programlisting>
<para>
Presents the given <parameter>prompt</parameter> to the user, in the style indicated by
<parameter>type</parameter>. If <parameter>cancel</parameter> is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, the user will be able to accept or
cancel. Otherwise, the message is purely informational.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara> the type of alert (info, warning, or error)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>prompt</parameter>&nbsp;:</term>
<listitem><simpara> the message for the user
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>cancel</parameter>&nbsp;:</term>
<listitem><simpara> whether or not to provide a "Cancel" option in addition to
an "OK" option.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>%TRUE if the user accepts, <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> if they cancel.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-build-password-prompt" role="function">
<title>camel_session_build_password_prompt ()</title>
<indexterm zone="camel-session-build-password-prompt"><primary>camel_session_build_password_prompt</primary></indexterm><programlisting><link linkend="char">char</link>*               camel_session_build_password_prompt (const <link linkend="char">char</link> *type,
                                                         const <link linkend="char">char</link> *user,
                                                         const <link linkend="char">char</link> *host);</programlisting>
<para>
Constructs a localized password prompt from <parameter>type</parameter>, <parameter>user</parameter> and <parameter>host</parameter>,
suitable for passing to <link linkend="camel-session-get-password"><function>camel_session_get_password()</function></link>.  The resulting
string contains markup tags.  Use <link linkend="g-free"><function>g_free()</function></link> to free it.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara> account type (e.g. "IMAP")
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user</parameter>&nbsp;:</term>
<listitem><simpara> user name for the account
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>host</parameter>&nbsp;:</term>
<listitem><simpara> host name for the account
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> a newly-allocated password prompt string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-is-online" role="function">
<title>camel_session_is_online ()</title>
<indexterm zone="camel-session-is-online"><primary>camel_session_is_online</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_session_is_online             (<link linkend="CamelSession">CamelSession</link> *session);</programlisting>
<para>
</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>whether or not <parameter>session</parameter> is online
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-set-online" role="function">
<title>camel_session_set_online ()</title>
<indexterm zone="camel-session-set-online"><primary>camel_session_set_online</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_set_online            (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="gboolean">gboolean</link> online);</programlisting>
<para>
Sets the online status of <parameter>session</parameter> to <parameter>online</parameter>.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>online</parameter>&nbsp;:</term>
<listitem><simpara> whether or not the session should be online
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-filter-driver" role="function">
<title>camel_session_get_filter_driver ()</title>
<indexterm zone="camel-session-get-filter-driver"><primary>camel_session_get_filter_driver</primary></indexterm><programlisting><link linkend="CamelFilterDriver">CamelFilterDriver</link>*  camel_session_get_filter_driver     (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *type,
                                                         <link linkend="CamelException">CamelException</link> *ex);</programlisting>
<para>
</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>type</parameter>&nbsp;:</term>
<listitem><simpara> the type of filter (eg, "incoming")
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ex</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelException"><type>CamelException</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a filter driver, loaded with applicable rules
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-check-junk" role="function">
<title>camel_session_check_junk ()</title>
<indexterm zone="camel-session-check-junk"><primary>camel_session_check_junk</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_session_check_junk            (<link linkend="CamelSession">CamelSession</link> *session);</programlisting>
<para>
Do we have to check incoming messages to be junk?</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>whether or not we are checking incoming messages for junk
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-set-check-junk" role="function">
<title>camel_session_set_check_junk ()</title>
<indexterm zone="camel-session-set-check-junk"><primary>camel_session_set_check_junk</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_set_check_junk        (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="gboolean">gboolean</link> check_junk);</programlisting>
<para>
Set check_junk flag, if set, incoming mail will be checked for being junk.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>check_junk</parameter>&nbsp;:</term>
<listitem><simpara> state
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-thread-msg-new" role="function">
<title>camel_session_thread_msg_new ()</title>
<indexterm zone="camel-session-thread-msg-new"><primary>camel_session_thread_msg_new</primary></indexterm><programlisting><link linkend="void">void</link>*               camel_session_thread_msg_new        (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionThreadOps">CamelSessionThreadOps</link> *ops,
                                                         unsigned <link linkend="int">int</link> size);</programlisting>
<para>
Create a new thread message, using ops as the receive/reply/free
ops, of <parameter>size</parameter> bytes.
</para>
<para>
<parameter>ops</parameter> points to the operations used to recieve/process and finally
free the message.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>ops</parameter>&nbsp;:</term>
<listitem><simpara> thread operations
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>size</parameter>&nbsp;:</term>
<listitem><simpara> number of bytes
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>a new <link linkend="CamelSessionThreadMsg"><type>CamelSessionThreadMsg</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-thread-msg-free" role="function">
<title>camel_session_thread_msg_free ()</title>
<indexterm zone="camel-session-thread-msg-free"><primary>camel_session_thread_msg_free</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_thread_msg_free       (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionThreadMsg">CamelSessionThreadMsg</link> *msg);</programlisting>
<para>
Free a <parameter>msg</parameter>.  Note that the message must have been allocated using
msg_new, and must nto have been submitted to any queue function.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>msg</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSessionThreadMsg"><type>CamelSessionThreadMsg</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-thread-queue" role="function">
<title>camel_session_thread_queue ()</title>
<indexterm zone="camel-session-thread-queue"><primary>camel_session_thread_queue</primary></indexterm><programlisting><link linkend="int">int</link>                 camel_session_thread_queue          (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="CamelSessionThreadMsg">CamelSessionThreadMsg</link> *msg,
                                                         <link linkend="int">int</link> flags);</programlisting>
<para>
Queue a thread message in another thread for processing.
The operation should be (but needn't) run in a queued manner
with other operations queued in this manner.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>msg</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSessionThreadMsg"><type>CamelSessionThreadMsg</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&nbsp;:</term>
<listitem><simpara> queue type flags, currently 0.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the id of the operation queued
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-thread-wait" role="function">
<title>camel_session_thread_wait ()</title>
<indexterm zone="camel-session-thread-wait"><primary>camel_session_thread_wait</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_thread_wait           (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="int">int</link> id);</programlisting>
<para>
Wait on an operation to complete (by id).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara> a <link linkend="CamelSession"><type>CamelSession</type></link> object
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>id</parameter>&nbsp;:</term>
<listitem><simpara> id of the operation to wait on
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-network-state" role="function">
<title>camel_session_get_network_state ()</title>
<indexterm zone="camel-session-get-network-state"><primary>camel_session_get_network_state</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_session_get_network_state     (<link linkend="CamelSession">CamelSession</link> *session);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-set-network-state" role="function">
<title>camel_session_set_network_state ()</title>
<indexterm zone="camel-session-set-network-state"><primary>camel_session_set_network_state</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_set_network_state     (<link linkend="CamelSession">CamelSession</link> *session,
                                                         <link linkend="gboolean">gboolean</link> network_state);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>network_state</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-get-junk-headers" role="function">
<title>camel_session_get_junk_headers ()</title>
<indexterm zone="camel-session-get-junk-headers"><primary>camel_session_get_junk_headers</primary></indexterm><programlisting>const <link linkend="GHashTable">GHashTable</link>*   camel_session_get_junk_headers      (<link linkend="CamelSession">CamelSession</link> *session);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-set-junk-headers" role="function">
<title>camel_session_set_junk_headers ()</title>
<indexterm zone="camel-session-set-junk-headers"><primary>camel_session_set_junk_headers</primary></indexterm><programlisting><link linkend="void">void</link>                camel_session_set_junk_headers      (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> **headers,
                                                         const <link linkend="char">char</link> **values,
                                                         <link linkend="int">int</link> len);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>headers</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>values</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>len</parameter>&nbsp;:</term>
<listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="camel-session-lookup-addressbook" role="function">
<title>camel_session_lookup_addressbook ()</title>
<indexterm zone="camel-session-lookup-addressbook"><primary>camel_session_lookup_addressbook</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            camel_session_lookup_addressbook    (<link linkend="CamelSession">CamelSession</link> *session,
                                                         const <link linkend="char">char</link> *name);</programlisting>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>session</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&nbsp;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>


</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
