Add also get_service_icon method to AccountProtocol API.
authorJose Dapena Paz <jdapena@igalia.com>
Tue, 2 Jun 2009 15:28:06 +0000 (17:28 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Wed, 3 Jun 2009 09:47:08 +0000 (11:47 +0200)
src/modest-account-protocol.c
src/modest-account-protocol.h

index c36e849..309e9e4 100644 (file)
@@ -107,6 +107,10 @@ static gchar *modest_account_protocol_get_service_name_default (ModestAccountPro
                                                                const gchar *account_id,
                                                                const gchar *mailbox);
 
                                                                const gchar *account_id,
                                                                const gchar *mailbox);
 
+static const GdkPixbuf *modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
+                                                                         const gchar *account_id,
+                                                                         const gchar *mailbox);
+
 /* globals */
 static GObjectClass *parent_class = NULL;
 
 /* globals */
 static GObjectClass *parent_class = NULL;
 
@@ -203,6 +207,8 @@ modest_account_protocol_class_init (ModestAccountProtocolClass *klass)
                modest_account_protocol_get_icon_default;
        account_class->get_service_name =
                modest_account_protocol_get_service_name_default;
                modest_account_protocol_get_icon_default;
        account_class->get_service_name =
                modest_account_protocol_get_service_name_default;
+       account_class->get_service_icon =
+               modest_account_protocol_get_service_icon_default;
 }
 
 static void
 }
 
 static void
@@ -730,3 +736,21 @@ modest_account_protocol_get_service_name_default (ModestAccountProtocol *self,
        return NULL;
 }
 
        return NULL;
 }
 
+const GdkPixbuf *
+modest_account_protocol_get_service_icon (ModestAccountProtocol *self,
+                                         const gchar *account_id,
+                                         const gchar *mailbox)
+{
+       return MODEST_ACCOUNT_PROTOCOL_GET_CLASS (self)->get_service_icon (self, account_id, mailbox);
+}
+
+static const GdkPixbuf *
+modest_account_protocol_get_service_icon_default (ModestAccountProtocol *self,
+                                                 const gchar *account_id,
+                                                 const gchar *mailbox)
+{
+       g_return_val_if_fail (MODEST_ACCOUNT_PROTOCOL (self), NULL);
+
+       return NULL;
+}
+
index f2b2aa0..28a70eb 100644 (file)
@@ -86,9 +86,9 @@ struct _ModestAccountProtocolClass {
        const GdkPixbuf * (*get_icon) (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type, 
                                       GObject *object, guint icon_size);
        gchar * (*get_service_name) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox);
        const GdkPixbuf * (*get_icon) (ModestAccountProtocol *self, ModestAccountProtocolIconType icon_type, 
                                       GObject *object, guint icon_size);
        gchar * (*get_service_name) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox);
+       const GdkPixbuf * (*get_service_icon) (ModestAccountProtocol *self, const gchar *account_id, const gchar *mailbox);
 
        /* Padding for future expansions */
 
        /* Padding for future expansions */
-       void (*_reserved2) (void);
        void (*_reserved3) (void);
        void (*_reserved4) (void);
        void (*_reserved5) (void);
        void (*_reserved3) (void);
        void (*_reserved4) (void);
        void (*_reserved5) (void);
@@ -419,6 +419,20 @@ gchar *modest_account_protocol_get_service_name (ModestAccountProtocol *self,
                                                 const gchar *account_id,
                                                 const gchar *mailbox);
 
                                                 const gchar *account_id,
                                                 const gchar *mailbox);
 
+/**
+ * modest_account_protocol_get_service_icon:
+ * @self: a #ModestAccountProtocol
+ * @account_id: a transport account name
+ * @mailbox: a mailbox
+ *
+ * Obtain the service icon for the account and mailbox.
+ *
+ * Returns: a protocol owned #GdkPixbuf
+ */
+const GdkPixbuf *modest_account_protocol_get_service_icon (ModestAccountProtocol *self,
+                                                          const gchar *account_id,
+                                                          const gchar *mailbox);
+
 
 G_END_DECLS
 
 
 G_END_DECLS