aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-05-01 22:04:18 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-05-01 22:04:18 +0800
commit4e1dac9940f51879a92cbca1f14914f10cb9d8ba (patch)
tree959c4b9d0535cbb19647f527ad77d6ea8c890a89
parentc24e7b0058a23203a2de15d88602691451566a00 (diff)
downloadgsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.tar
gsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.tar.gz
gsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.tar.bz2
gsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.tar.lz
gsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.tar.xz
gsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.tar.zst
gsoc2013-evolution-4e1dac9940f51879a92cbca1f14914f10cb9d8ba.zip
new methods
1999-05-01 bertrand <Bertrand.Guiheneuf@inria.fr> * camel/camel-folder.c (__camel_folder_get_mode): (camel_folder_get_mode): (camel_folder_get_parent_store): (__camel_folder_get_parent_store): (camel_folder_get_parent_folder): (__camel_folder_get_parent_folder): new methods * camel/camel-service.c: put __ prefix before private virtual funcs. svn path=/trunk/; revision=886
-rw-r--r--ChangeLog12
-rw-r--r--camel/camel-folder.c199
-rw-r--r--camel/camel-folder.h9
-rw-r--r--camel/camel-service.c55
-rw-r--r--camel/camel-session.c2
5 files changed, 207 insertions, 70 deletions
diff --git a/ChangeLog b/ChangeLog
index f643a4cca2..2717675451 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
1999-05-01 bertrand <Bertrand.Guiheneuf@inria.fr>
+ * camel/camel-folder.c
+ (__camel_folder_get_mode):
+ (camel_folder_get_mode):
+ (camel_folder_get_parent_store):
+ (__camel_folder_get_parent_store):
+ (camel_folder_get_parent_folder):
+ (__camel_folder_get_parent_folder):
+ new methods
+
+ * camel/camel-service.c: put __ prefix before
+ private virtual funcs.
+
* camel/camel-folder.c (camel_folder_delete):
(camel_folder_delete_messages):
new methods.
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 5d460de236..5e3bd1265c 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -29,21 +29,24 @@ static GtkObjectClass *parent_class=NULL;
/* Returns the class for a CamelFolder */
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT(so)->klass)
-static void camel_folder_init_with_store(CamelFolder *folder, CamelStore *parent_store);
-static void camel_folder_open(CamelFolder *folder);
-static void camel_folder_close(CamelFolder *folder, gboolean expunge);
-static void camel_folder_set_name(CamelFolder *folder, GString *name_);
-static void camel_folder_set_full_name(CamelFolder *folder, GString *name);
-static GString *camel_folder_get_name(CamelFolder *folder);
-static GString *camel_folder_get_full_name(CamelFolder *folder);
-static gboolean camel_folder_can_hold_folders(CamelFolder *folder);
-static gboolean camel_folder_can_hold_messages(CamelFolder *folder);
-static gboolean camel_folder_exists(CamelFolder *folder);
-static gboolean camel_folder_is_open(CamelFolder *folder);
-static CamelFolder *camel_folder_get_folder(CamelFolder *folder, GString *folder_name);
+static void __camel_folder_init_with_store(CamelFolder *folder, CamelStore *parent_store);
+static void __camel_folder_open(CamelFolder *folder, CamelFolderOpenMode mode);
+static void __camel_folder_close(CamelFolder *folder, gboolean expunge);
+static void __camel_folder_set_name(CamelFolder *folder, GString *name_);
+static void __camel_folder_set_full_name(CamelFolder *folder, GString *name);
+static GString *__camel_folder_get_name(CamelFolder *folder);
+static GString *__camel_folder_get_full_name(CamelFolder *folder);
+static gboolean __camel_folder_can_hold_folders(CamelFolder *folder);
+static gboolean __camel_folder_can_hold_messages(CamelFolder *folder);
+static gboolean __camel_folder_exists(CamelFolder *folder);
+static gboolean __camel_folder_is_open(CamelFolder *folder);
+static CamelFolder *__camel_folder_get_folder(CamelFolder *folder, GString *folder_name);
static gboolean __camel_folder_create(CamelFolder *folder);
static gboolean __camel_folder_delete (CamelFolder *folder, gboolean recurse);
static gboolean __camel_folder_delete_messages(CamelFolder *folder);
+static CamelFolder *__camel_folder_get_parent_folder (CamelFolder *folder);
+static CamelStore *__camel_folder_get_parent_store (CamelFolder *folder);
+static CamelFolderOpenMode __camel_folder_get_mode(CamelFolder *folder);
static void
camel_folder_class_init (CamelFolderClass *camel_folder_class)
@@ -51,19 +54,23 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class)
parent_class = gtk_type_class (gtk_object_get_type ());
/* virtual method definition */
- camel_folder_class->init_with_store = camel_folder_init_with_store;
- camel_folder_class->open = camel_folder_open;
- camel_folder_class->close = camel_folder_close;
- camel_folder_class->set_name = camel_folder_set_name;
- camel_folder_class->get_name = camel_folder_get_name;
- camel_folder_class->can_hold_folders = camel_folder_can_hold_folders;
- camel_folder_class->can_hold_messages = camel_folder_can_hold_messages;
- camel_folder_class->exists = camel_folder_exists;
- camel_folder_class->is_open = camel_folder_is_open;
- camel_folder_class->get_folder = camel_folder_get_folder;
+ camel_folder_class->init_with_store = __camel_folder_init_with_store;
+ camel_folder_class->open = __camel_folder_open;
+ camel_folder_class->close = __camel_folder_close;
+ camel_folder_class->set_name = __camel_folder_set_name;
+ camel_folder_class->get_name = __camel_folder_get_name;
+ camel_folder_class->can_hold_folders = __camel_folder_can_hold_folders;
+ camel_folder_class->can_hold_messages = __camel_folder_can_hold_messages;
+ camel_folder_class->exists = __camel_folder_exists;
+ camel_folder_class->is_open = __camel_folder_is_open;
+ camel_folder_class->get_folder = __camel_folder_get_folder;
camel_folder_class->create = __camel_folder_create;
camel_folder_class->delete = __camel_folder_delete;
camel_folder_class->delete_messages = __camel_folder_delete_messages;
+ camel_folder_class->get_parent_folder = __camel_folder_get_parent_folder;
+ camel_folder_class->get_parent_store = __camel_folder_get_parent_store;
+ camel_folder_class->get_mode = __camel_folder_get_mode;
+
/* virtual method overload */
}
@@ -101,14 +108,14 @@ camel_folder_get_type (void)
/**
- * camel_folder_init_with_store: init the folder by setting its parent store.
+ * __camel_folder_init_with_store: init the folder by setting its parent store.
* @folder: folder object to initialize
* @parent_store: parent store object of the folder
*
*
**/
static void
-camel_folder_init_with_store(CamelFolder *folder, CamelStore *parent_store)
+__camel_folder_init_with_store(CamelFolder *folder, CamelStore *parent_store)
{
g_assert(folder);
g_assert(parent_store);
@@ -120,20 +127,21 @@ camel_folder_init_with_store(CamelFolder *folder, CamelStore *parent_store)
/**
- * camel_folder_open: Open a folder
+ * __camel_folder_open: Open a folder
* @folder:
- *
+ * @mode: open mode (R/W/RW ?)
*
**/
static void
-camel_folder_open(CamelFolder *folder)
+__camel_folder_open(CamelFolder *folder, CamelFolderOpenMode mode)
{
folder->open_state = FOLDER_OPEN;
+ folder->open_mode = mode;
}
/**
- * camel_folder_close:Close a folder.
+ * __camel_folder_close:Close a folder.
* @folder:
* @expunge: if TRUE, the flagged message are deleted.
*
@@ -141,7 +149,7 @@ camel_folder_open(CamelFolder *folder)
* expunge the flagged messages.
**/
static void
-camel_folder_close(CamelFolder *folder, gboolean expunge)
+__camel_folder_close(CamelFolder *folder, gboolean expunge)
{
#warning implement the expunge flag
folder->open_state = FOLDER_CLOSE;
@@ -151,7 +159,7 @@ camel_folder_close(CamelFolder *folder, gboolean expunge)
/**
- * camel_folder_set_name:set the (short) name of the folder
+ * __camel_folder_set_name:set the (short) name of the folder
* @folder: folder
* @name: new name of the folder
*
@@ -160,7 +168,7 @@ camel_folder_close(CamelFolder *folder, gboolean expunge)
*
**/
static void
-camel_folder_set_name(CamelFolder *folder, GString *name)
+__camel_folder_set_name(CamelFolder *folder, GString *name)
{
if (folder->name) g_string_free(folder->name, 0);;
folder->name = name;
@@ -169,7 +177,7 @@ camel_folder_set_name(CamelFolder *folder, GString *name)
/**
- * camel_folder_set_full_name:set the (full) name of the folder
+ * __camel_folder_set_full_name:set the (full) name of the folder
* @folder: folder
* @name: new name of the folder
*
@@ -178,7 +186,7 @@ camel_folder_set_name(CamelFolder *folder, GString *name)
*
**/
static void
-camel_folder_set_full_name(CamelFolder *folder, GString *name)
+__camel_folder_set_full_name(CamelFolder *folder, GString *name)
{
if (folder->full_name) g_string_free(folder->full_name, 0);;
folder->full_name = name;
@@ -188,7 +196,7 @@ camel_folder_set_full_name(CamelFolder *folder, GString *name)
/**
- * camel_folder_get_name: get the (short) name of the folder
+ * __camel_folder_get_name: get the (short) name of the folder
* @folder:
*
* get the name of the folder. The fully qualified name
@@ -197,14 +205,14 @@ camel_folder_set_full_name(CamelFolder *folder, GString *name)
* Return value: name of the folder
**/
static GString *
-camel_folder_get_name(CamelFolder *folder)
+__camel_folder_get_name(CamelFolder *folder)
{
return folder->name;
}
/**
- * camel_folder_get_full_name:get the (full) name of the folder
+ * __camel_folder_get_full_name:get the (full) name of the folder
* @folder: folder to get the name
*
* get the name of the folder.
@@ -212,7 +220,7 @@ camel_folder_get_name(CamelFolder *folder)
* Return value: full name of the folder
**/
static GString *
-camel_folder_get_full_name(CamelFolder *folder)
+__camel_folder_get_full_name(CamelFolder *folder)
{
return folder->full_name;
}
@@ -220,7 +228,7 @@ camel_folder_get_full_name(CamelFolder *folder)
/**
- * camel_folder_can_hold_folders: tests if the folder can contain other folders
+ * __camel_folder_can_hold_folders: tests if the folder can contain other folders
* @folder:
*
*
@@ -228,7 +236,7 @@ camel_folder_get_full_name(CamelFolder *folder)
* Return value:
**/
static gboolean
-camel_folder_can_hold_folders(CamelFolder *folder)
+__camel_folder_can_hold_folders(CamelFolder *folder)
{
return folder->can_hold_folders;
}
@@ -237,7 +245,7 @@ camel_folder_can_hold_folders(CamelFolder *folder)
/**
- * camel_folder_can_hold_messages: tests if the folder can contain messages
+ * __camel_folder_can_hold_messages: tests if the folder can contain messages
* @folder:
*
*
@@ -245,7 +253,7 @@ camel_folder_can_hold_folders(CamelFolder *folder)
* Return value:
**/
static gboolean
-camel_folder_can_hold_messages(CamelFolder *folder)
+__camel_folder_can_hold_messages(CamelFolder *folder)
{
return folder->can_hold_messages;
}
@@ -253,7 +261,7 @@ camel_folder_can_hold_messages(CamelFolder *folder)
/**
- * camel_folder_exists: tests if the folder object exists on the store.
+ * __camel_folder_exists: tests if the folder object exists on the store.
* @folder:
*
*
@@ -261,7 +269,7 @@ camel_folder_can_hold_messages(CamelFolder *folder)
* Return value:
**/
static gboolean
-camel_folder_exists(CamelFolder *folder)
+__camel_folder_exists(CamelFolder *folder)
{
return folder->exists_on_store;
}
@@ -269,7 +277,7 @@ camel_folder_exists(CamelFolder *folder)
/**
- * camel_folder_is_open:
+ * __camel_folder_is_open:
* @folder:
*
*
@@ -277,7 +285,7 @@ camel_folder_exists(CamelFolder *folder)
* Return value:
**/
static gboolean
-camel_folder_is_open(CamelFolder *folder)
+__camel_folder_is_open(CamelFolder *folder)
{
return (folder->open_state==FOLDER_OPEN);
}
@@ -286,7 +294,7 @@ camel_folder_is_open(CamelFolder *folder)
/**
- * camel_folder_get_folder: return the (sub)folder object that
+ * __camel_folder_get_folder: return the (sub)folder object that
* is specified.
*
* This method returns a folder objects. This folder
@@ -299,7 +307,7 @@ camel_folder_is_open(CamelFolder *folder)
* could not be created
**/
static CamelFolder *
-camel_folder_get_folder(CamelFolder *folder, GString *folder_name)
+__camel_folder_get_folder(CamelFolder *folder, GString *folder_name)
{
g_warning("getFolder called on the abstract CamelFolder class\n");
return NULL;
@@ -478,7 +486,102 @@ __camel_folder_delete_messages(CamelFolder *folder)
* Return value: TRUE if the messages could be deleted
**/
gboolean
-camel_folder_delete_messages(CamelFolder *folder)
+camel_folder_delete_messages (CamelFolder *folder)
{
return CF_CLASS(folder)->delete_messages(folder);
}
+
+
+
+
+
+
+/**
+ * __camel_folder_get_parent_folder: return parent folder
+ * @folder: folder to get the parent
+ *
+ *
+ *
+ * Return value:
+ **/
+static CamelFolder *
+__camel_folder_get_parent_folder (CamelFolder *folder)
+{
+ return folder->parent_folder;
+}
+
+
+/**
+ * camel_folder_get_parent_folder:return parent folder
+ * @folder: folder to get the parent
+ *
+ *
+ *
+ * Return value:
+ **/
+CamelFolder *
+camel_folder_get_parent_folder (CamelFolder *folder)
+{
+ return CF_CLASS(folder)->get_parent_folder(folder);
+}
+
+
+/**
+ * __camel_folder_get_parent_store: return parent store
+ * @folder: folder to get the parent
+ *
+ *
+ *
+ * Return value:
+ **/
+static CamelStore *
+__camel_folder_get_parent_store (CamelFolder *folder)
+{
+ return folder->parent_store;
+}
+
+
+/**
+ * camel_folder_get_parent_store:return parent store
+ * @folder: folder to get the parent
+ *
+ *
+ *
+ * Return value:
+ **/
+CamelStore *
+camel_folder_get_parent_store (CamelFolder *folder)
+{
+ return CF_CLASS(folder)->get_parent_store(folder);
+}
+
+
+
+/**
+ * __camel_folder_get_mode: return the open mode of a folder
+ * @folder:
+ *
+ *
+ *
+ * Return value: open mode of the folder
+ **/
+static CamelFolderOpenMode
+__camel_folder_get_mode(CamelFolder *folder)
+{
+ return folder->open_mode;
+}
+
+
+/**
+ * camel_folder_get_mode: return the open mode of a folder
+ * @folder:
+ *
+ *
+ *
+ * Return value: open mode of the folder
+ **/
+static CamelFolderOpenMode
+camel_folder_get_mode(CamelFolder *folder)
+{
+ return CF_CLASS(folder)->get_mode(folder);
+}
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 9df16156e4..b6ca20074d 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -79,7 +79,7 @@ typedef struct {
/* Virtual methods */
void (*init_with_store) (CamelFolder *folder, CamelStore *parent_store);
- void (*open) (CamelFolder *object);
+ void (*open) (CamelFolder *object, CamelFolderOpenMode mode);
void (*close) (CamelFolder *folder, gboolean expunge);
void (*set_name) (CamelFolder *folder, GString *name);
void (*set_full_name) (CamelFolder *folder, GString *name);
@@ -93,6 +93,10 @@ typedef struct {
gboolean (*create) (CamelFolder *folder);
gboolean (*delete) (CamelFolder *folder, gboolean recurse);
gboolean (*delete_messages) (CamelFolder *folder);
+ CamelFolder * (*get_parent_folder) (CamelFolder *folder);
+ CamelStore * (*get_parent_store) (CamelFolder *folder);
+ CamelFolderOpenMode (*get_mode) (CamelFolder *folder);
+
} CamelFolderClass;
@@ -105,6 +109,9 @@ GtkType camel_folder_get_type (void);
gboolean camel_folder_create(CamelFolder *folder);
gboolean camel_folder_delete (CamelFolder *folder, gboolean recurse);
gboolean camel_folder_delete_messages (CamelFolder *folder);
+CamelFolder *camel_folder_get_parent_folder (CamelFolder *folder);
+CamelStore *camel_folder_get_parent_store (CamelFolder *folder);
+CamelFolderOpenMode camel_folder_get_mode(CamelFolder *folder);
diff --git a/camel/camel-service.c b/camel/camel-service.c
index a07f2fa729..6b3f89f5b5 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -28,10 +28,11 @@ static GtkObjectClass *parent_class=NULL;
/* Returns the class for a CamelService */
#define CSERV_CLASS(so) CAMEL_SERVICE_CLASS (GTK_OBJECT(so)->klass)
-static void camel_service_connect_to_with_login_passwd(CamelService *service, GString *host, GString *login, GString *passwd);
-static void camel_service_connect_to_with_login_passwd_port(CamelService *service, GString *host, GString *login, GString *passwd, guint port);
-static gboolean camel_service_is_connected(CamelService *service);
-static void camel_service_set_connected(CamelService *service, gboolean state);
+static void __camel_service_connect(CamelService *service);
+static void __camel_service_connect_to_with_login_passwd(CamelService *service, GString *host, GString *login, GString *passwd);
+static void __camel_service_connect_to_with_login_passwd_port(CamelService *service, GString *host, GString *login, GString *passwd, guint port);
+static gboolean __camel_service_is_connected(CamelService *service);
+static void __camel_service_set_connected(CamelService *service, gboolean state);
static void
camel_service_class_init (CamelServiceClass *camel_service_class)
@@ -39,11 +40,11 @@ camel_service_class_init (CamelServiceClass *camel_service_class)
parent_class = gtk_type_class (gtk_object_get_type ());
/* virtual method definition */
- camel_service_class->connect = camel_service_connect;
- camel_service_class->connect_to_with_login_passwd = camel_service_connect_to_with_login_passwd;
- camel_service_class->connect_to_with_login_passwd_port = camel_service_connect_to_with_login_passwd_port;
- camel_service_class->is_connected = camel_service_is_connected;
- camel_service_class->set_connected = camel_service_set_connected;
+ camel_service_class->connect = __camel_service_connect;
+ camel_service_class->connect_to_with_login_passwd = __camel_service_connect_to_with_login_passwd;
+ camel_service_class->connect_to_with_login_passwd_port = __camel_service_connect_to_with_login_passwd_port;
+ camel_service_class->is_connected = __camel_service_is_connected;
+ camel_service_class->set_connected = __camel_service_set_connected;
/* virtual method overload */
@@ -84,7 +85,7 @@ camel_service_get_type (void)
/**
- * camel_service_connect : connect to a service
+ * __camel_service_connect : connect to a service
*
* connect to the service using the parameters
* stored in the session it is initialized with
@@ -92,16 +93,30 @@ camel_service_get_type (void)
*
* @service: object to connect
**/
-void
-camel_service_connect(CamelService *service)
+static void
+__camel_service_connect(CamelService *service)
{
}
+/**
+ * camel_service_connect : connect to a service
+ *
+ * connect to the service using the parameters
+ * stored in the session it is initialized with
+ * WARNING: session not implemented for the moment
+ *
+ * @service: object to connect to
+ **/
+void
+camel_service_connect(CamelService *service)
+{
+ CSERV_CLASS(service)->connect(service);
+}
/**
- * camel_service_connect_to: connect to the specified address
+ * __camel_service_connect_to: connect to the specified address
*
* Connect to the service, but do not use the session
* default parameters to retrieve server's address
@@ -112,14 +127,14 @@ camel_service_connect(CamelService *service)
* @passwd: password used to log in
**/
static void
-camel_service_connect_to_with_login_passwd(CamelService *service, GString *host, GString *login, GString *passwd)
+__camel_service_connect_to_with_login_passwd(CamelService *service, GString *host, GString *login, GString *passwd)
{
camel_service_set_connected(service, TRUE);
}
/**
- * camel_service_connect_to:login:password : connect to the specified address
+ * __camel_service_connect_to:login:password : connect to the specified address
*
* Connect to the service, but do not use the session
* default parameters to retrieve server's address
@@ -132,7 +147,7 @@ camel_service_connect_to_with_login_passwd(CamelService *service, GString *host,
*
**/
static void
-camel_service_connect_to_with_login_passwd_port(CamelService *service, GString *host, GString *login, GString *passwd, guint port)
+__camel_service_connect_to_with_login_passwd_port(CamelService *service, GString *host, GString *login, GString *passwd, guint port)
{
camel_service_set_connected(service, TRUE);
}
@@ -141,21 +156,21 @@ camel_service_connect_to_with_login_passwd_port(CamelService *service, GString *
/**
- * camel_service_is_connected: test if the service object is connected
+ * __camel_service_is_connected: test if the service object is connected
*
*
* @service: object to test
*
**/
static gboolean
-camel_service_is_connected(CamelService *service)
+__camel_service_is_connected(CamelService *service)
{
return service->connected;
}
/**
- * camel_service_set_connected: set the connected state
+ * __camel_service_set_connected: set the connected state
*
* This routine has to be called by providers to set the
* connection state, mainly when the service is disconnected
@@ -166,7 +181,7 @@ camel_service_is_connected(CamelService *service)
*
**/
static void
-camel_service_set_connected(CamelService *service, gboolean state)
+__camel_service_set_connected(CamelService *service, gboolean state)
{
service->connected = state;
}
diff --git a/camel/camel-session.c b/camel/camel-session.c
index a5d48a69ab..42f681f626 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -125,7 +125,7 @@ camel_session_get_store_from_provider (CamelSession *session, CamelProvider *pro
g_assert(session);
g_assert(provider);
- store = gtk_object_new (provider->object_type, NULL);
+ store = CAMEL_STORE (gtk_object_new (provider->object_type, NULL));
#warning set the url to a useful value.
camel_store_init(store, session, NULL);
return store;