![]() |
![]() |
![]() |
Camel Reference Manual | ![]() |
---|---|---|---|---|
CamelProvider; enum CamelProviderType; #define CAMEL_PROVIDER_IS_LOCAL #define CAMEL_PROVIDER_IS_EXTERNAL #define CAMEL_PROVIDER_IS_SOURCE #define CAMEL_PROVIDER_IS_STORAGE #define CAMEL_PROVIDER_SUPPORTS_SSL #define CAMEL_PROVIDER_HAS_LICENSE #define CAMEL_PROVIDER_DISABLE_SENT_FOLDER #define CAMEL_URL_PART_USER #define CAMEL_URL_PART_AUTH #define CAMEL_URL_PART_PASSWORD #define CAMEL_URL_PART_HOST #define CAMEL_URL_PART_PORT #define CAMEL_URL_PART_PATH #define CAMEL_URL_PART_PATH_DIR #define CAMEL_URL_PART_NEED #define CAMEL_URL_PART_HIDDEN #define CAMEL_PROVIDER_ALLOWS (prov, flags) #define CAMEL_PROVIDER_NEEDS (prov, flags) #define CAMEL_PROVIDER_HIDDEN (prov, flags) #define CAMEL_URL_ALLOW_USER #define CAMEL_URL_ALLOW_AUTH #define CAMEL_URL_ALLOW_PASSWORD #define CAMEL_URL_ALLOW_HOST #define CAMEL_URL_ALLOW_PORT #define CAMEL_URL_ALLOW_PATH #define CAMEL_URL_NEED_USER #define CAMEL_URL_NEED_AUTH #define CAMEL_URL_NEED_PASSWORD #define CAMEL_URL_NEED_HOST #define CAMEL_URL_NEED_PORT #define CAMEL_URL_NEED_PATH #define CAMEL_URL_NEED_PATH_DIR #define CAMEL_URL_HIDDEN_USER #define CAMEL_URL_HIDDEN_AUTH #define CAMEL_URL_HIDDEN_PASSWORD #define CAMEL_URL_HIDDEN_HOST #define CAMEL_URL_HIDDEN_PORT #define CAMEL_URL_HIDDEN_PATH #define CAMEL_URL_FRAGMENT_IS_PATH #define CAMEL_URL_PATH_IS_ABSOLUTE #define CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT(prov) enum CamelProviderConfType; CamelProviderConfEntry; #define CAMEL_PROVIDER_CONF_DEFAULT_USERNAME #define CAMEL_PROVIDER_CONF_DEFAULT_HOSTNAME #define CAMEL_PROVIDER_CONF_DEFAULT_PATH int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex); CamelProvider; CamelProviderModule; void camel_provider_init (void); void camel_provider_load (const char *path, CamelException *ex); void camel_provider_register (CamelProvider *provider); GList* camel_provider_list (gboolean load); CamelProvider* camel_provider_get (const char *url_string, CamelException *ex); void camel_provider_module_init (void); int camel_provider_auto_detect (CamelProvider *provider, CamelURL *url, GHashTable **auto_detected, CamelException *ex);
typedef struct { /* Provider name used in CamelURLs. */ char *protocol; /* Provider name as used by people. (May be the same as protocol) */ char *name; /* Description of the provider. A novice user should be able * to read this description, and the information provided by * an ISP, IS department, etc, and determine whether or not * this provider is relevant to him, and if so, which * information goes with it. */ char *description; /* The category of message that this provider works with. * (evolution-mail will only list a provider in the store/transport * config dialogs if its domain is "mail".) */ char *domain; /* Flags describing the provider, flags describing its URLs */ int flags, url_flags; /* The ConfEntry and AutoDetect functions will probably be * DEPRECATED in a future release */ /* Extra configuration information */ CamelProviderConfEntry *extra_conf; /* auto-detection function */ CamelProviderAutoDetectFunc auto_detect; /* CamelType(s) of its store and/or transport. If both are * set, then they are assumed to be linked together and the * transport type can only be used in an account that also * uses the store type (eg, Exchange or NNTP). */ CamelType object_types[CAMEL_NUM_PROVIDER_TYPES]; /* GList of CamelServiceAuthTypes the provider supports */ GList *authtypes; CamelObjectBag *service_cache[CAMEL_NUM_PROVIDER_TYPES]; GHashFunc url_hash; GCompareFunc url_equal; /* gettext translation domain (NULL for providers in the * evolution source tree). */ char *translation_domain; /* This string points to the provider's gconf key value */ const char *license; /* This holds the license file name [ ascii text format ] containing * the license agreement. This should be the absolute file path. This * is read only when the HAS_LICENSE flag is set */ const char *license_file; /* Private to the provider */ void *priv; } CamelProvider;
typedef enum { CAMEL_PROVIDER_STORE, CAMEL_PROVIDER_TRANSPORT, CAMEL_NUM_PROVIDER_TYPES } CamelProviderType;
#define CAMEL_PROVIDER_ALLOWS(prov, flags) (prov->url_flags & (flags | (flags << CAMEL_URL_PART_NEED) | (flags << CAMEL_URL_PART_HIDDEN)))
|
|
|
#define CAMEL_PROVIDER_NEEDS(prov, flags) (prov->url_flags & (flags << CAMEL_URL_PART_NEED))
|
|
|
#define CAMEL_PROVIDER_HIDDEN(prov, flags) (prov->url_flags & (flags << CAMEL_URL_PART_HIDDEN))
|
|
|
#define CAMEL_URL_NEED_PASSWORD (CAMEL_URL_PART_PASSWORD << CAMEL_URL_PART_NEED)
#define CAMEL_URL_NEED_PATH_DIR (CAMEL_URL_PART_PATH_DIR << CAMEL_URL_PART_NEED)
#define CAMEL_URL_HIDDEN_PASSWORD (CAMEL_URL_PART_PASSWORD << CAMEL_URL_PART_HIDDEN)
#define CAMEL_URL_FRAGMENT_IS_PATH (1 << 30) /* url uses fragment for folder name path, not path */
#define CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT(prov) (prov->object_types[CAMEL_PROVIDER_STORE] && prov->object_types[CAMEL_PROVIDER_TRANSPORT])
|
typedef enum { CAMEL_PROVIDER_CONF_END, CAMEL_PROVIDER_CONF_SECTION_START, CAMEL_PROVIDER_CONF_SECTION_END, CAMEL_PROVIDER_CONF_CHECKBOX, CAMEL_PROVIDER_CONF_CHECKSPIN, CAMEL_PROVIDER_CONF_ENTRY, CAMEL_PROVIDER_CONF_LABEL, CAMEL_PROVIDER_CONF_HIDDEN } CamelProviderConfType;
typedef struct { CamelProviderConfType type; char *name, *depname; char *text, *value; } CamelProviderConfEntry;
#define CAMEL_PROVIDER_CONF_DEFAULT_USERNAME { CAMEL_PROVIDER_CONF_LABEL, "username", NULL, N_("User_name:"), NULL }
#define CAMEL_PROVIDER_CONF_DEFAULT_HOSTNAME { CAMEL_PROVIDER_CONF_LABEL, "hostname", NULL, N_("_Host:"), NULL }
#define CAMEL_PROVIDER_CONF_DEFAULT_PATH { CAMEL_PROVIDER_CONF_ENTRY, "path", NULL, N_("_Path:"), "" }
int (*CamelProviderAutoDetectFunc) (CamelURL *url, GHashTable **auto_detected, CamelException *ex);
|
|
|
|
|
|
Returns : |
typedef struct { /* Provider name used in CamelURLs. */ char *protocol; /* Provider name as used by people. (May be the same as protocol) */ char *name; /* Description of the provider. A novice user should be able * to read this description, and the information provided by * an ISP, IS department, etc, and determine whether or not * this provider is relevant to him, and if so, which * information goes with it. */ char *description; /* The category of message that this provider works with. * (evolution-mail will only list a provider in the store/transport * config dialogs if its domain is "mail".) */ char *domain; /* Flags describing the provider, flags describing its URLs */ int flags, url_flags; /* The ConfEntry and AutoDetect functions will probably be * DEPRECATED in a future release */ /* Extra configuration information */ CamelProviderConfEntry *extra_conf; /* auto-detection function */ CamelProviderAutoDetectFunc auto_detect; /* CamelType(s) of its store and/or transport. If both are * set, then they are assumed to be linked together and the * transport type can only be used in an account that also * uses the store type (eg, Exchange or NNTP). */ CamelType object_types[CAMEL_NUM_PROVIDER_TYPES]; /* GList of CamelServiceAuthTypes the provider supports */ GList *authtypes; CamelObjectBag *service_cache[CAMEL_NUM_PROVIDER_TYPES]; GHashFunc url_hash; GCompareFunc url_equal; /* gettext translation domain (NULL for providers in the * evolution source tree). */ char *translation_domain; /* This string points to the provider's gconf key value */ const char *license; /* This holds the license file name [ ascii text format ] containing * the license agreement. This should be the absolute file path. This * is read only when the HAS_LICENSE flag is set */ const char *license_file; /* Private to the provider */ void *priv; } CamelProvider;
typedef struct { char *path; GSList *types; guint loaded:1; } CamelProviderModule;
void camel_provider_init (void);
Initialize the Camel provider system by reading in the .urls files in the provider directory and creating a hash table mapping URLs to module names.
A .urls file has the same initial prefix as the shared library it correspond to, and consists of a series of lines containing the URL protocols that that library handles.
TODO: This should be pathed? TODO: This should be plugin-d?
void camel_provider_load (const char *path, CamelException *ex);
Loads the provider at path
, and calls its initialization function,
passing session
as an argument. The provider should then register
itself with session
.
|
the path to a shared library |
|
a CamelException |
void camel_provider_register (CamelProvider *provider);
Registers a provider.
|
provider object |
CamelProvider* camel_provider_get (const char *url_string, CamelException *ex);
This returns the CamelProvider that would be used to handle
url_string
, loading it in from disk if necessary.
|
the URL for the service whose provider you want |
|
a CamelException |
Returns : |
the provider, or NULL , in which case ex will be set.
|
int camel_provider_auto_detect (CamelProvider *provider, CamelURL *url, GHashTable **auto_detected, CamelException *ex);
After filling in the standard Username/Hostname/Port/Path settings
(which must be set in settings
), if the provider supports it, you
may wish to have the provider auto-detect further settings based on
the aformentioned settings.
If the provider does not support auto-detection, auto_detected
will be set to NULL
. Otherwise the provider will attempt to
auto-detect whatever it can and file them into auto_detected
. If
for some reason it cannot auto-detect anything (not enough
information provided in settings
?) then auto_deetected
will be
set to NULL
and an exception may be set to explain why it failed.
|
camel provider |
|
|
|
output hash table of auto-detected values |
|
exception |
Returns : |
0 on success or -1 on fail. |