aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-session.h
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-30 23:36:16 +0800
committerDan Winship <danw@src.gnome.org>2000-04-30 23:36:16 +0800
commit0524f7c06a47544f26997da30317b35361c9d62b (patch)
treef682673b15a5b721325ba90d43fe84ce70074c83 /camel/camel-session.h
parent3c358f3c18ccbe888b77ea5d6fe67c9a385a715f (diff)
downloadgsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.gz
gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.tar.zst
gsoc2013-evolution-0524f7c06a47544f26997da30317b35361c9d62b.zip
Tweak the definition of CamelProvider. Among other things, a provider may
* camel-provider.h: Tweak the definition of CamelProvider. Among other things, a provider may now be both a store and a transport. * camel-provider.c: Remove a lot of code we had no intention of using. This now only contains two functions: camel_provider_init to read the installed .urls files, and camel_provider_load to load and register a new provider. * camel-session.c: Remove more unused code and simplify some of the remaining code. The list of available provider modules is now stored in the session, and it handles calling camel_provider_load to load them as needed. Provider registration is now done by calling back from the module init routine, which allows a single module to register providers for multiple URL types. * providers/*: Update provider structures and init routines for the new stuff. Add a .urls file to each provider specifying what urls it handles, and install that with the library. * providers/nntp/camel-nntp-provider.c: Add hints towards supporting both news: and nntp: URLs, and using nntp as both a store and a transport. svn path=/trunk/; revision=2691
Diffstat (limited to 'camel/camel-session.h')
-rw-r--r--camel/camel-session.h59
1 files changed, 30 insertions, 29 deletions
diff --git a/camel/camel-session.h b/camel/camel-session.h
index 4bb51804ac..4eff6c94a3 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -1,15 +1,15 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* camel-session.h : Abstract class for an email session */
-/*
+/*
*
- * Author :
+ * Author :
* Bertrand Guiheneuf <bertrand@helixcode.com>
*
* Copyright 1999, 2000 Helix Code, Inc. (http://www.helixcode.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
@@ -48,23 +48,17 @@ typedef char *(*CamelAuthCallback) (char *prompt, gboolean secret,
CamelService *service, char *item,
CamelException *ex);
-
struct _CamelSession
{
GtkObject parent_object;
CamelAuthCallback authenticator;
- GHashTable *store_provider_list; /* providers are identified by their protocol */
- GHashTable *transport_provider_list;
+ GHashTable *providers, *modules;
};
-
-
typedef struct {
GtkObjectClass parent_class;
-
- /* Virtual methods */
} CamelSessionClass;
@@ -72,24 +66,31 @@ typedef struct {
/* public methods */
/* Standard Gtk function */
-GtkType camel_session_get_type (void);
-
-
-CamelSession * camel_session_new (CamelAuthCallback authenticator);
-void camel_session_set_provider (CamelSession *session, CamelProvider *provider);
-CamelStore * camel_session_get_store_for_protocol (CamelSession *session,
- const gchar *protocol,
- CamelException *ex);
-CamelStore * camel_session_get_store (CamelSession *session,
- const char *url_string,
- CamelException *ex);
-CamelTransport * camel_session_get_transport_for_protocol (CamelSession *session,
- const char *protocol,
- CamelException *ex);
-char * camel_session_query_authenticator (CamelSession *session, char *prompt,
- gboolean secret,
- CamelService *service, char *item,
- CamelException *ex);
+GtkType camel_session_get_type (void);
+
+
+CamelSession * camel_session_new (CamelAuthCallback
+ authenticator);
+
+void camel_session_register_provider (CamelSession *session,
+ CamelProvider *provider);
+
+CamelService * camel_session_get_service (CamelSession *session,
+ const char *url_string,
+ CamelProviderType type,
+ CamelException *ex);
+#define camel_session_get_store(session, url_string, ex) \
+ ((CamelStore *) camel_session_get_service (session, url_string, CAMEL_PROVIDER_STORE, ex))
+#define camel_session_get_transport(session, url_string, ex) \
+ ((CamelTransport *) camel_session_get_service (session, url_string, CAMEL_PROVIDER_TRANSPORT, ex))
+
+
+char * camel_session_query_authenticator (CamelSession *session,
+ char *prompt,
+ gboolean secret,
+ CamelService *service,
+ char *item,
+ CamelException *ex);
#ifdef __cplusplus
}