diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-05-09 05:58:37 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-05-09 05:58:37 +0800 |
commit | 4554c20766d386909b765446af93418292293a7c (patch) | |
tree | 0bc57a8bdeb9901bd0dd929ca911ef53e9d4e81c | |
parent | 06bd4d2a16b4b39f485363f10dd272d529e3f16a (diff) | |
download | gsoc2013-evolution-4554c20766d386909b765446af93418292293a7c.tar.gz gsoc2013-evolution-4554c20766d386909b765446af93418292293a7c.tar.zst gsoc2013-evolution-4554c20766d386909b765446af93418292293a7c.zip |
Implemented. (digest_getv): Implemented.
2002-05-08 Jeffrey Stedfast <fejj@ximian.com>
* camel-digest-store.c (digest_setv): Implemented.
(digest_getv): Implemented.
* camel-disco-store.c (disco_setv): Implemented.
(disco_getv): Implemented.
* camel-remote-store.c (remote_store_setv): Implemented.
(remote_store_getv): Implemented.
* camel-transport.c (camel_transport_class_init): Implemented.
(transport_setv): Implemented.
(transport_getv): Implemented.
* camel-store.c (store_setv): Implemented.
(store_getv): Implemented.
* camel-service.c (service_setv): Implemented.
(service_getv): Implemented.
svn path=/trunk/; revision=16729
-rw-r--r-- | camel/ChangeLog | 19 | ||||
-rw-r--r-- | camel/camel-digest-store.c | 25 | ||||
-rw-r--r-- | camel/camel-disco-store.c | 42 | ||||
-rw-r--r-- | camel/camel-disco-store.h | 4 | ||||
-rw-r--r-- | camel/camel-remote-store.c | 81 | ||||
-rw-r--r-- | camel/camel-remote-store.h | 8 | ||||
-rw-r--r-- | camel/camel-service.c | 131 | ||||
-rw-r--r-- | camel/camel-service.h | 14 | ||||
-rw-r--r-- | camel/camel-store.c | 23 | ||||
-rw-r--r-- | camel/camel-store.h | 3 | ||||
-rw-r--r-- | camel/camel-transport.c | 33 | ||||
-rw-r--r-- | camel/camel-transport.h | 4 |
12 files changed, 364 insertions, 23 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index b00ff2b246..3f01082fac 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,24 @@ 2002-05-08 Jeffrey Stedfast <fejj@ximian.com> + * camel-digest-store.c (digest_setv): Implemented. + (digest_getv): Implemented. + + * camel-disco-store.c (disco_setv): Implemented. + (disco_getv): Implemented. + + * camel-remote-store.c (remote_store_setv): Implemented. + (remote_store_getv): Implemented. + + * camel-transport.c (camel_transport_class_init): Implemented. + (transport_setv): Implemented. + (transport_getv): Implemented. + + * camel-store.c (store_setv): Implemented. + (store_getv): Implemented. + + * camel-service.c (service_setv): Implemented. + (service_getv): Implemented. + * providers/pop3/camel-pop3-store.c (pop3_try_authenticate): camel_pop3_engine_iterate doesn't return the state, it returns -1 on fail, 0 when finished processing request or >0 if more ops are diff --git a/camel/camel-digest-store.c b/camel/camel-digest-store.c index 3e2833442d..e3870e3672 100644 --- a/camel/camel-digest-store.c +++ b/camel/camel-digest-store.c @@ -47,7 +47,10 @@ static void camel_digest_store_class_init (CamelDigestStoreClass *klass); static void camel_digest_store_init (CamelDigestStore *obj); static void camel_digest_store_finalise (CamelObject *obj); -static CamelStoreClass *camel_digest_store_parent = NULL; +static int digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args); +static int digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); + +static CamelStoreClass *parent_class = NULL; CamelType @@ -72,11 +75,15 @@ camel_digest_store_get_type (void) static void camel_digest_store_class_init (CamelDigestStoreClass *klass) { + CamelObjectClass *object_class = (CamelObjectClass *) klass; CamelStoreClass *store_class = (CamelStoreClass *) klass; - camel_digest_store_parent = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ())); + parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs (camel_store_get_type ())); /* virtual method overload */ + object_class->setv = digest_setv; + object_class->getv = digest_getv; + store_class->get_folder = digest_get_folder; store_class->rename_folder = digest_rename_folder; store_class->delete_folder = digest_delete_folder; @@ -102,6 +109,20 @@ camel_digest_store_finalise (CamelObject *obj) } +static int +digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + /* CamelDigestStore doesn't currently have anything to set */ + return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args); +} + +static int +digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + /* CamelDigestStore doesn't currently have anything to get */ + return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args); +} + /** * camel_digest_store_new: diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c index b18d88924c..45207e4538 100644 --- a/camel/camel-disco-store.c +++ b/camel/camel-disco-store.c @@ -33,7 +33,7 @@ #define CDS_CLASS(o) (CAMEL_DISCO_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (o))) -static CamelRemoteStoreClass *remote_store_class = NULL; +static CamelRemoteStoreClass *parent_class = NULL; static void disco_construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, @@ -51,26 +51,34 @@ static void set_status (CamelDiscoStore *disco_store, CamelException *ex); static gboolean can_work_offline (CamelDiscoStore *disco_store); +static int disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args); +static int disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); + static void camel_disco_store_class_init (CamelDiscoStoreClass *camel_disco_store_class) { + CamelObjectClass *camel_object_class = + CAMEL_OBJECT_CLASS (camel_disco_store_class); CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_disco_store_class); CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS (camel_disco_store_class); - - remote_store_class = CAMEL_REMOTE_STORE_CLASS (camel_type_get_global_classfuncs (camel_remote_store_get_type ())); - + + parent_class = CAMEL_REMOTE_STORE_CLASS (camel_type_get_global_classfuncs (camel_remote_store_get_type ())); + /* virtual method definition */ camel_disco_store_class->set_status = set_status; camel_disco_store_class->can_work_offline = can_work_offline; - + /* virtual method overload */ + camel_object_class->setv = disco_setv; + camel_object_class->getv = disco_getv; + camel_service_class->construct = disco_construct; camel_service_class->connect = disco_connect; camel_service_class->disconnect = disco_disconnect; camel_service_class->cancel_connect = disco_cancel_connect; - + camel_store_class->get_folder = disco_get_folder; camel_store_class->get_folder_info = disco_get_folder_info; } @@ -94,6 +102,20 @@ camel_disco_store_get_type (void) return camel_disco_store_type; } +static int +disco_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + /* CamelDiscoStore doesn't currently have anything to set */ + return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args); +} + +static int +disco_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + /* CamelDiscoStore doesn't currently have anything to get */ + return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args); +} + static void disco_construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, @@ -101,7 +123,7 @@ disco_construct (CamelService *service, CamelSession *session, { CamelDiscoStore *disco = CAMEL_DISCO_STORE (service); - CAMEL_SERVICE_CLASS (remote_store_class)->construct (service, session, provider, url, ex); + CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex); if (camel_exception_is_set (ex)) return; @@ -117,7 +139,7 @@ disco_connect (CamelService *service, CamelException *ex) status = camel_disco_store_status (store); if (status != CAMEL_DISCO_STORE_OFFLINE) { - if (!CAMEL_SERVICE_CLASS (remote_store_class)->connect (service, ex)) { + if (!CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex)) { status = camel_disco_store_status (store); if (status != CAMEL_DISCO_STORE_OFFLINE) return FALSE; @@ -160,7 +182,7 @@ disco_cancel_connect (CamelService *service) /* Fall back */ store->status = CAMEL_DISCO_STORE_OFFLINE; - CAMEL_SERVICE_CLASS (remote_store_class)->cancel_connect (service); + CAMEL_SERVICE_CLASS (parent_class)->cancel_connect (service); } static gboolean @@ -182,7 +204,7 @@ disco_disconnect (CamelService *service, gboolean clean, CamelException *ex) } - return CAMEL_SERVICE_CLASS (remote_store_class)->disconnect (service, clean, ex); + return CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex); } static CamelFolder * diff --git a/camel/camel-disco-store.h b/camel/camel-disco-store.h index 575ce1a5ba..01d11645e2 100644 --- a/camel/camel-disco-store.h +++ b/camel/camel-disco-store.h @@ -38,6 +38,10 @@ extern "C" { #define CAMEL_DISCO_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_DISCO_STORE_TYPE, CamelDiscoStoreClass)) #define CAMEL_IS_DISCO_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_DISCO_STORE_TYPE)) +enum { + CAMEL_DISCO_STORE_ARG_FIRST = CAMEL_REMOTE_STORE_ARG_FIRST + 100, +}; + typedef enum { CAMEL_DISCO_STORE_ONLINE, CAMEL_DISCO_STORE_OFFLINE, diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 76fdc642d6..e9eb4325dd 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -23,6 +23,7 @@ * */ + #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -66,7 +67,7 @@ extern gboolean camel_verbose_debug; #define CSTRC(obj) (CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (obj))) #define CRSC(obj) (CAMEL_REMOTE_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (obj))) -static CamelStoreClass *store_class = NULL; +static CamelStoreClass *parent_class = NULL; static void remote_construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, @@ -82,16 +83,24 @@ static gint remote_send_stream (CamelRemoteStore *store, CamelStream *st static gint remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex); +static int remote_store_setv (CamelObject *object, CamelException *ex, CamelArgV *args); +static int remote_store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); + static void camel_remote_store_class_init (CamelRemoteStoreClass *camel_remote_store_class) { /* virtual method overload */ + CamelObjectClass *camel_object_class = + CAMEL_OBJECT_CLASS (camel_remote_store_class); CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS (camel_remote_store_class); - store_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ())); + parent_class = CAMEL_STORE_CLASS (camel_type_get_global_classfuncs (camel_store_get_type ())); /* virtual method overload */ + camel_object_class->setv = remote_store_setv; + camel_object_class->getv = remote_store_getv; + camel_service_class->construct = remote_construct; camel_service_class->connect = remote_connect; camel_service_class->disconnect = remote_disconnect; @@ -162,6 +171,68 @@ camel_remote_store_get_type (void) return camel_remote_store_type; } +static int +remote_store_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + CamelService *service = (CamelService *) object; + CamelURL *url = service->url; + guint32 tag; + int i; + + for (i = 0; i < args->argc; i++) { + tag = args->argv[i].tag; + + /* make sure this arg wasn't already handled */ + if (tag & CAMEL_ARG_IGNORE) + continue; + + /* make sure this is an arg we're supposed to handle */ + if ((tag & CAMEL_ARG_TAG) <= CAMEL_REMOTE_STORE_ARG_FIRST || + (tag & CAMEL_ARG_TAG) >= CAMEL_REMOTE_STORE_ARG_FIRST + 100) + continue; + + if (tag == CAMEL_REMOTE_STORE_SSL) { + /* set the ssl mode */ + camel_url_set_param (url, "use_ssl", args->argv[i].ca_str); + } else { + /* error? */ + continue; + } + + /* let our parent know that we've handled this arg */ + camel_argv_ignore (args, i); + } + + return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args); +} + +static int +remote_store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + CamelService *service = (CamelService *) object; + CamelURL *url = service->url; + guint32 tag; + int i; + + for (i = 0; i < args->argc; i++) { + tag = args->argv[i].tag; + + /* make sure this is an arg we're supposed to handle */ + if ((tag & CAMEL_ARG_TAG) <= CAMEL_REMOTE_STORE_ARG_FIRST || + (tag & CAMEL_ARG_TAG) >= CAMEL_REMOTE_STORE_ARG_FIRST + 100) + continue; + + if (tag == CAMEL_REMOTE_STORE_SSL) { + /* get the ssl mode */ + *args->argv[i].ca_str = (char *) camel_url_get_param (url, "use_ssl"); + } else { + /* error? */ + } + } + + return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args); +} + static void remote_construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, @@ -169,7 +240,7 @@ remote_construct (CamelService *service, CamelSession *session, { CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (service); - CAMEL_SERVICE_CLASS (store_class)->construct (service, session, provider, url, ex); + CAMEL_SERVICE_CLASS (parent_class)->construct (service, session, provider, url, ex); if (camel_url_get_param (url, "use_ssl")) remote_store->use_ssl = TRUE; @@ -261,7 +332,7 @@ remote_connect (CamelService *service, CamelException *ex) } /* parent class connect initialization */ - if (CAMEL_SERVICE_CLASS (store_class)->connect (service, ex) == FALSE) + if (CAMEL_SERVICE_CLASS (parent_class)->connect (service, ex) == FALSE) return FALSE; store->ostream = tcp_stream; @@ -301,7 +372,7 @@ remote_disconnect (CamelService *service, gboolean clean, CamelException *ex) store->timeout_id = 0; } - if (!CAMEL_SERVICE_CLASS (store_class)->disconnect (service, clean, ex)) + if (!CAMEL_SERVICE_CLASS (parent_class)->disconnect (service, clean, ex)) return FALSE; if (store->istream) { diff --git a/camel/camel-remote-store.h b/camel/camel-remote-store.h index a596ed7235..936388fab0 100644 --- a/camel/camel-remote-store.h +++ b/camel/camel-remote-store.h @@ -37,6 +37,14 @@ extern "C" { #define CAMEL_REMOTE_STORE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_REMOTE_STORE_TYPE, CamelRemoteStoreClass)) #define CAMEL_IS_REMOTE_STORE(o) (CAMEL_CHECK_TYPE((o), CAMEL_REMOTE_STORE_TYPE)) + +enum { + CAMEL_REMOTE_STORE_ARG_FIRST = CAMEL_STORE_ARG_FIRST + 100, + CAMEL_REMOTE_STORE_ARG_SSL, +}; + +#define CAMEL_REMOTE_STORE_SSL (CAMEL_REMOTE_STORE_ARG_SSL | CAMEL_ARG_STR) + typedef struct { CamelStore parent_object; struct _CamelRemoteStorePrivate *priv; diff --git a/camel/camel-service.c b/camel/camel-service.c index 19c058f970..f83c3fe612 100644 --- a/camel/camel-service.c +++ b/camel/camel-service.c @@ -60,16 +60,25 @@ static gboolean service_connect(CamelService *service, CamelException *ex); static gboolean service_disconnect(CamelService *service, gboolean clean, CamelException *ex); static void cancel_connect (CamelService *service); -static GList * query_auth_types (CamelService *service, CamelException *ex); -static char * get_name (CamelService *service, gboolean brief); -static char * get_path (CamelService *service); +static GList *query_auth_types (CamelService *service, CamelException *ex); +static char *get_name (CamelService *service, gboolean brief); +static char *get_path (CamelService *service); + +static int service_setv (CamelObject *object, CamelException *ex, CamelArgV *args); +static int service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); static void camel_service_class_init (CamelServiceClass *camel_service_class) { + CamelObjectClass *object_class = CAMEL_OBJECT_CLASS (camel_service_class); + parent_class = camel_type_get_global_classfuncs (CAMEL_OBJECT_TYPE); - + + /* virtual method overloading */ + object_class->setv = service_setv; + object_class->getv = service_getv; + /* virtual method definition */ camel_service_class->construct = construct; camel_service_class->connect = service_connect; @@ -144,6 +153,120 @@ camel_service_get_type (void) } +static int +service_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + CamelService *service = (CamelService *) object; + CamelURL *url = service->url; + gboolean reconnect = FALSE; + guint32 tag; + int i; + + for (i = 0; i < args->argc; i++) { + tag = args->argv[i].tag; + + /* make sure this arg wasn't already handled */ + if (tag & CAMEL_ARG_IGNORE) + continue; + + /* make sure this is an arg we're supposed to handle */ + if ((tag & CAMEL_ARG_TAG) <= CAMEL_SERVICE_ARG_FIRST || + (tag & CAMEL_ARG_TAG) >= CAMEL_SERVICE_ARG_FIRST + 100) + continue; + + if (tag == CAMEL_SERVICE_USERNAME) { + /* set the username */ + if (strcmp (url->user, args->argv[i].ca_str) != 0) { + camel_url_set_user (url, args->argv[i].ca_str); + reconnect = TRUE; + } + } else if (tag == CAMEL_SERVICE_AUTH) { + /* set the auth mechanism */ + if (strcmp (url->authmech, args->argv[i].ca_str) != 0) { + camel_url_set_authmech (url, args->argv[i].ca_str); + reconnect = TRUE; + } + } else if (tag == CAMEL_SERVICE_HOSTNAME) { + /* set the hostname */ + if (strcmp (url->host, args->argv[i].ca_str) != 0) { + camel_url_set_host (url, args->argv[i].ca_str); + reconnect = TRUE; + } + } else if (tag == CAMEL_SERVICE_PORT) { + /* set the port */ + if (url->port != args->argv[i].ca_int) { + camel_url_set_port (url, args->argv[i].ca_int); + reconnect = TRUE; + } + } else if (tag == CAMEL_SERVICE_PATH) { + /* set the path */ + if (strcmp (url->path, args->argv[i].ca_str) != 0) { + camel_url_set_host (url, args->argv[i].ca_str); + reconnect = TRUE; + } + } else { + /* error? */ + continue; + } + + /* let our parent know that we've handled this arg */ + camel_argv_ignore (args, i); + } + + if (reconnect) { + /* reconnect the service using the new URL */ + if (camel_service_disconnect (service, TRUE, ex)) + camel_service_connect (service, ex); + } + + return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args); +} + +static int +service_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + CamelService *service = (CamelService *) object; + CamelURL *url = service->url; + guint32 tag; + int i; + + for (i = 0; i < args->argc; i++) { + tag = args->argv[i].tag; + + /* make sure this is an arg we're supposed to handle */ + if ((tag & CAMEL_ARG_TAG) <= CAMEL_SERVICE_ARG_FIRST || + (tag & CAMEL_ARG_TAG) >= CAMEL_SERVICE_ARG_FIRST + 100) + continue; + + switch (tag) { + case CAMEL_SERVICE_USERNAME: + /* get the username */ + *args->argv[i].ca_str = url->user; + break; + case CAMEL_SERVICE_AUTH: + /* get the auth mechanism */ + *args->argv[i].ca_str = url->authmech; + break; + case CAMEL_SERVICE_HOSTNAME: + /* get the hostname */ + *args->argv[i].ca_str = url->host; + break; + case CAMEL_SERVICE_PORT: + /* get the port */ + *args->argv[i].ca_int = url->port; + break; + case CAMEL_SERVICE_PATH: + /* get the path */ + *args->argv[i].ca_str = url->path; + break; + default: + /* error? */ + } + } + + return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args); +} + static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex) diff --git a/camel/camel-service.h b/camel/camel-service.h index cb8b89eae9..587749e242 100644 --- a/camel/camel-service.h +++ b/camel/camel-service.h @@ -44,6 +44,20 @@ extern "C" { #define CAMEL_SERVICE_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_SERVICE_TYPE, CamelServiceClass)) #define CAMEL_IS_SERVICE(o) (CAMEL_CHECK_TYPE((o), CAMEL_SERVICE_TYPE)) +enum { + CAMEL_SERVICE_ARG_FIRST = CAMEL_ARG_FIRST + 100, + CAMEL_SERVICE_ARG_USERNAME, + CAMEL_SERVICE_ARG_AUTH, + CAMEL_SERVICE_ARG_HOSTNAME, + CAMEL_SERVICE_ARG_PORT, + CAMEL_SERVICE_ARG_PATH, +}; + +#define CAMEL_SERVICE_USERNAME (CAMEL_SERVICE_ARG_USERNAME | CAMEL_ARG_STR) +#define CAMEL_SERVICE_AUTH (CAMEL_SERVICE_ARG_AUTH | CAMEL_ARG_STR) +#define CAMEL_SERVICE_HOSTNAME (CAMEL_SERVICE_ARG_HOSTNAME | CAMEL_ARG_STR) +#define CAMEL_SERVICE_PORT (CAMEL_SERVICE_ARG_PORT | CAMEL_ARG_INT) +#define CAMEL_SERVICE_PATH (CAMEL_SERVICE_ARG_PATH | CAMEL_ARG_STR) typedef enum { CAMEL_SERVICE_DISCONNECTED, diff --git a/camel/camel-store.c b/camel/camel-store.c index 6764ac0af6..ab3d667fde 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -75,12 +75,15 @@ static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex); +static int store_setv (CamelObject *object, CamelException *ex, CamelArgV *args); +static int store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); + static void camel_store_class_init (CamelStoreClass *camel_store_class) { CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_store_class); CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(camel_store_class); - + parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ())); /* virtual method definition */ @@ -102,7 +105,10 @@ camel_store_class_init (CamelStoreClass *camel_store_class) /* virtual method overload */ camel_service_class->construct = construct; - + + camel_object_class->setv = store_setv; + camel_object_class->getv = store_getv; + camel_object_class_add_event(camel_object_class, "folder_created", NULL); camel_object_class_add_event(camel_object_class, "folder_deleted", NULL); camel_object_class_add_event(camel_object_class, "folder_renamed", NULL); @@ -174,6 +180,19 @@ camel_store_get_type (void) return camel_store_type; } +static int +store_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + /* CamelStore doesn't currently have anything to set */ + return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args); +} + +static int +store_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + /* CamelStore doesn't currently have anything to get */ + return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args); +} static gboolean folder_matches (gpointer key, gpointer value, gpointer user_data) diff --git a/camel/camel-store.h b/camel/camel-store.h index af963fe872..3d8e10af8c 100644 --- a/camel/camel-store.h +++ b/camel/camel-store.h @@ -38,6 +38,9 @@ extern "C" { #include <camel/camel-object.h> #include <camel/camel-service.h> +enum { + CAMEL_STORE_ARG_FIRST = CAMEL_SERVICE_ARG_FIRST + 100, +}; typedef struct _CamelFolderInfo { struct _CamelFolderInfo *parent, diff --git a/camel/camel-transport.c b/camel/camel-transport.c index dc402750c7..a1844f34b5 100644 --- a/camel/camel-transport.c +++ b/camel/camel-transport.c @@ -32,9 +32,27 @@ #include "camel-mime-message.h" #include "camel-private.h" +static CamelServiceClass *parent_class = NULL; + /* Returns the class for a CamelTransport */ #define CT_CLASS(so) CAMEL_TRANSPORT_CLASS (CAMEL_OBJECT_GET_CLASS(so)) +static int transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args); +static int transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); + + +static void +camel_transport_class_init (CamelTransportClass *camel_transport_class) +{ + CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (camel_transport_class); + + parent_class = CAMEL_SERVICE_CLASS (camel_type_get_global_classfuncs (camel_service_get_type ())); + + /* virtual method overload */ + camel_object_class->setv = transport_setv; + camel_object_class->getv = transport_getv; +} + static void camel_transport_init (gpointer object, gpointer klass) { @@ -77,6 +95,21 @@ camel_transport_get_type (void) } +static int +transport_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + /* CamelTransport doesn't currently have anything to set */ + return CAMEL_OBJECT_CLASS (parent_class)->setv (object, ex, args); +} + +static int +transport_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + /* CamelTransport doesn't currently have anything to get */ + return CAMEL_OBJECT_CLASS (parent_class)->getv (object, ex, args); +} + + /** * camel_transport_send_to: * @transport: the transport diff --git a/camel/camel-transport.h b/camel/camel-transport.h index d46f4549a1..d2c1e5b72c 100644 --- a/camel/camel-transport.h +++ b/camel/camel-transport.h @@ -42,6 +42,10 @@ extern "C" { #define CAMEL_IS_TRANSPORT(o) (CAMEL_CHECK_TYPE((o), CAMEL_TRANSPORT_TYPE)) +enum { + CAMEL_TRANSPORT_ARG_FIRST = CAMEL_SERVICE_ARG_FIRST + 100, +}; + struct _CamelTransport { CamelService parent_object; |