diff libpurple/disco.h @ 26604:ff33b65b2448

Iteratively expand the disco tree as prompted by the UI. Walking the entire tree automatically = bad. This doesn't really work yet. The UI needs to be updated to support the little expandy things like on the buddy list. It doesn't crash, though, and retrieves the first level.
author Paul Aurich <paul@darkrain42.org>
date Tue, 14 Apr 2009 06:54:44 +0000
parents 1de01f9594c8
children
line wrap: on
line diff
--- a/libpurple/disco.h	Mon Apr 13 16:54:25 2009 +0000
+++ b/libpurple/disco.h	Tue Apr 14 06:54:44 2009 +0000
@@ -52,6 +52,10 @@
  * @param list  The disco list.
  */
 typedef void (*PurpleDiscoCloseFunc)(PurpleDiscoList *list);
+typedef void (*PurpleDiscoServiceCloseFunc)(PurpleDiscoService *service);
+
+typedef void (*PurpleDiscoServiceExpandFunc)(PurpleDiscoList *list,
+                                             PurpleDiscoService *service);
 
 /**
  * A prpl callback called to initiate registration with the specificed
@@ -172,7 +176,8 @@
 PurpleDiscoService *
 purple_disco_list_service_new(PurpleDiscoServiceType type, const gchar *name,
                               const gchar *description,
-                              PurpleDiscoServiceFlags flags);
+                              PurpleDiscoServiceFlags flags,
+                              gpointer proto_data);
 
 /**
  * Add service to list
@@ -180,6 +185,19 @@
 void purple_disco_list_service_add(PurpleDiscoList *list, PurpleDiscoService *service, PurpleDiscoService *parent);
 
 /**
+ * Expand a (browsable) service. The UI should call this in order to
+ * iteratively browse the children of this service. The service must
+ * have the PURPLE_DISCO_BROWSE flag set.
+ *
+ * You probably don't want to call this if the service already has children.
+ *
+ * @param service  The browsable disco service.
+ *
+ * @since TODO
+ */
+void purple_disco_service_expand(PurpleDiscoService *service);
+
+/**
  * Register service
  * @param service The service that will be registered
  */
@@ -206,6 +224,18 @@
 const gchar* purple_disco_service_get_description(PurpleDiscoService *service);
 
 /**
+ * Returns the service's protocol-specific data.
+ *
+ * This should only be called from the associated prpl.
+ *
+ * @param service The disco service.
+ * @return        The protocol data.
+ *
+ * @since TODO
+ */
+gpointer purple_disco_service_get_protocol_data(PurpleDiscoService *service);
+
+/**
  * Return a service's type.
  *
  * @param service The service.
@@ -350,8 +380,14 @@
  */
 gpointer purple_disco_list_get_protocol_data(PurpleDiscoList *list);
 
-void purple_disco_list_set_cancel_func(PurpleDiscoList *list, PurpleDiscoCancelFunc cb);
-void purple_disco_list_set_register_func(PurpleDiscoList *list, PurpleDiscoRegisterFunc cb);
+void purple_disco_list_set_service_close_func(PurpleDiscoList *list,
+                                              PurpleDiscoServiceCloseFunc cb);
+void purple_disco_list_set_cancel_func(PurpleDiscoList *list,
+                                       PurpleDiscoCancelFunc cb);
+void purple_disco_list_set_expand_func(PurpleDiscoList *list,
+                                       PurpleDiscoServiceExpandFunc cb);
+void purple_disco_list_set_register_func(PurpleDiscoList *list,
+                                         PurpleDiscoRegisterFunc cb);
 
 /**
  * Sets the UI operations structure to be used in all purple service discovery.