From eb2c9a602456d8c51c5e241dce1c51861e9ae0f8 Mon Sep 17 00:00:00 2001 From: bertrand Date: Sun, 25 Apr 1999 09:45:13 +0000 Subject: basic provider structure. Have to write the code for dynamic loading. 1999-04-25 bertrand * camel/camel-provider.[ch]: basic provider structure. Have to write the code for dynamic loading. svn path=/trunk/; revision=876 --- ChangeLog | 6 ++++++ camel/Makefile.am | 2 ++ camel/camel-provider.c | 29 +++++++++++++++++++++++++++ camel/camel-provider.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ camel/camel-service.h | 1 + camel/camel-store.c | 28 ++++++++++++++++++++++++++ camel/camel-store.h | 1 + 7 files changed, 121 insertions(+) create mode 100644 camel/camel-provider.c create mode 100644 camel/camel-provider.h diff --git a/ChangeLog b/ChangeLog index 1973af8bc0..7ec4cbfa3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-04-25 bertrand + + * camel/camel-provider.[ch]: + basic provider structure. Have to write the + code for dynamic loading. + 1999-04-24 bertrand * camel/url-util.[ch]: s/new_g_url/g_url_new diff --git a/camel/Makefile.am b/camel/Makefile.am index ad6c0af101..7edbc279f6 100644 --- a/camel/Makefile.am +++ b/camel/Makefile.am @@ -14,6 +14,7 @@ INCLUDES = -I.. -I$(srcdir)/.. -I$(includedir) \ libcamel_la_SOURCES = \ camel-log.c \ camel-folder.c \ + camel-provider.c \ camel-service.c \ camel-store.c \ gstring-util.c \ @@ -22,6 +23,7 @@ libcamel_la_SOURCES = \ libcamelinclude_HEADERS = \ camel-log.h \ camel-folder.h \ + camel-provider.h \ camel-service.h \ camel-store.h \ gstring-util.h \ diff --git a/camel/camel-provider.c b/camel/camel-provider.c new file mode 100644 index 0000000000..238b83ce29 --- /dev/null +++ b/camel/camel-provider.c @@ -0,0 +1,29 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* camel-provider.c : provider management */ + +/* + * + * Copyright (C) 1999 Bertrand Guiheneuf . + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + + +/* + + Here will be the routine to load providers (plugins) + and register them */ diff --git a/camel/camel-provider.h b/camel/camel-provider.h new file mode 100644 index 0000000000..85eb11ee57 --- /dev/null +++ b/camel/camel-provider.h @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* camel-provider.h : provider management */ + +/* + * + * Copyright (C) 1999 Bertrand Guiheneuf . + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + + +#ifndef CAMEL_PROVIDER_H +#define CAMEL_PROVIDER_H 1 + + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus }*/ + +typedef enum { + PROVIDER_STORE, + PROVIDER_TRANSPORT +} ProviderType; + + +typedef struct { + GtkType object_type; /* used to create instance of the provider */ + ProviderType provider_type; /* is a store or a transport */ + GString *protocol; /* name of the protocol ("imap"/"smtp"/"mh" ...) */ + GString *provider_name; /* name of the provider ("Raymond the imap provider") */ + GString *description; /* Useful when multiple providers are available for a same protocol */ +} CameProvider; + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* CAMEL_PROVIDER_H */ diff --git a/camel/camel-service.h b/camel/camel-service.h index 080895a083..1dc959e4ec 100644 --- a/camel/camel-service.h +++ b/camel/camel-service.h @@ -44,6 +44,7 @@ typedef struct { GtkObject parent_object; gboolean connected; + GString *url; /* This may be a full object ? */ } CamelService; diff --git a/camel/camel-store.c b/camel/camel-store.c index 5723534138..a5ade87053 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -82,6 +82,34 @@ camel_store_get_type (void) +/** + * camel_store_new: create a new store from an URL + * @url: The url representing this store + * + * This routine creates a store from an URL name. + * The URL may be for example: + * pop3://user:passwd@host + * + * WARNING : THIS METHOD DEFINITION IS SUBJECT TO + * CHANGES. + * + * Return value: the newly created store + **/ +CamelStore * +camel_store_new(GString *url) +{ + /* this method must be overloaded by providers */ + CamelStore *store; +#warning must fill this + /* here si what will happen here : + In fact the method will take a Session object as a supplemental + argument. From this object and from the url protocol + (pop/mh/mbox ...) the correct provider will be selected an the + corresponding store object will be created */ + +} + + /** * camel_store_set_separator: set the character which separates this folder * path from the folders names in a lower level of hierarchy. diff --git a/camel/camel-store.h b/camel/camel-store.h index 90288261e4..55401577d0 100644 --- a/camel/camel-store.h +++ b/camel/camel-store.h @@ -70,6 +70,7 @@ typedef struct { /* Standard Gtk function */ GtkType camel_store_get_type (void); +CamelStore *camel_store_new(GString *url); CamelFolder *camel_store_get_folder(CamelStore *store, GString *folder_name); gchar camel_store_get_separator(CamelStore *store); -- cgit v1.2.3