diff src/notify.h @ 9797:62eb9fe24692

[gaim-migrate @ 10665] "This patch adds gaim_notify_userinfo() and a notify_userinfo() UI callback. gaim_notify_userinfo() is much like gaim_notify_formatted() except that it always takes a GaimConnection* as its handle and has an additional argument, const char* who. gaim_gtk_notify_userinfo() currently passes all the information except the GaimConnection* and the const char* who to gaim_gtk_notify_formatted(). This could be changed in the future to, for example, have a standardized window title which would note the account and/or user associated with the information. This is needed because some UIs (Adium, for example) don't want to present the information in a standalone window - they want to associate the information with a particular contact / buddy and display it with that object's other information. Previously, gaim_notify_formatted() was not useful for this purpose as it could not be determined what user's info it was; gaim_notify_userinfo() makes this possible. This patch modifies notify.c and notify.h for the new function, modifies gtknotify.c to register the ui op and pass calls to it on the gaim_gtk_notify_formatted, and modifies all prpls except SILC (which I don't understand well enough to modify, but there's no actual harm in leaving it as gaim_notify_formatted() for now) to use gaim_notify_userinfo() and pass their gc and username when calling the function." -- Evan Schoenberg committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 20 Aug 2004 22:05:18 +0000
parents fa6395637e2c
children cc68a8c6e741
line wrap: on
line diff
--- a/src/notify.h	Fri Aug 20 21:57:18 2004 +0000
+++ b/src/notify.h	Fri Aug 20 22:05:18 2004 +0000
@@ -29,6 +29,8 @@
 #include <glib-object.h>
 #include <glib.h>
 
+#include "connection.h"
+
 /**
  * Notification types.
  */
@@ -38,6 +40,7 @@
 	GAIM_NOTIFY_EMAIL,       /**< Single e-mail notification.   */
 	GAIM_NOTIFY_EMAILS,      /**< Multiple e-mail notification. */
 	GAIM_NOTIFY_FORMATTED,   /**< Formatted text.               */
+	GAIM_NOTIFY_USERINFO,    /**< Formatted userinfo text.      */
 	GAIM_NOTIFY_URI          /**< URI notification or display.  */
 
 } GaimNotifyType;
@@ -71,6 +74,10 @@
 	void *(*notify_formatted)(const char *title, const char *primary,
 							  const char *secondary, const char *text,
 							  GCallback cb, void *user_data);
+	void *(*notify_userinfo)(GaimConnection *gc, const char *who,
+							  const char *title, const char *primary,
+							  const char *secondary, const char *text,
+							  GCallback cb, void *user_data);
 	void *(*notify_uri)(const char *uri);
 
 	void (*close_notify)(GaimNotifyType type, void *ui_handle);
@@ -169,6 +176,30 @@
 							const char *text, GCallback cb, void *user_data);
 
 /**
+	* Displays user information with formatted text, passing information giving
+    * the connection and username from which the user information came.
+ *
+ * The text is essentially a stripped-down format of HTML, the same that
+ * IMs may send.
+ *
+ * @param gc		The GaimConnection handle associated with the information.
+ * @param who		The username associated with the information.
+ * @param title     The title of the message.
+ * @param primary   The main point of the message.
+ * @param secondary The secondary information.
+ * @param text      The formatted text.
+ * @param cb        The callback to call when the user closes
+ *                  the notification.
+ * @param user_data The data to pass to the callback.
+ *
+ * @return A UI-specific handle.
+ */
+void *gaim_notify_userinfo(GaimConnection *gc, const char *who,
+						   const char *title, const char *primary,
+						   const char *secondary, const char *text,
+						   GCallback cb, void *user_data);
+
+/**
  * Opens a URI or somehow presents it to the user.
  *
  * @param handle The plugin or connection handle.