diff src/accountopt.h @ 8570:1a62ab7225f3

[gaim-migrate @ 9318] This is what you've been waiting for, the infamous status rewrite! It's amazing, all the stuff it can do, and... oh wait, no, this is just basic core support for the list account option, which doesn't even have UI support yet. Sorry everyone. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 03 Apr 2004 03:30:57 +0000
parents fa6395637e2c
children db62420a53a2
line wrap: on
line diff
--- a/src/accountopt.h	Sat Apr 03 03:17:51 2004 +0000
+++ b/src/accountopt.h	Sat Apr 03 03:30:57 2004 +0000
@@ -45,6 +45,7 @@
 		gboolean boolean;   /**< The default boolean value.             */
 		int integer;        /**< The default integer value.             */
 		char *string;       /**< The default string value.              */
+		GList *list;        /**< The default list value.                */
 
 	} default_value;
 
@@ -125,6 +126,25 @@
 												  const char *default_value);
 
 /**
+ * Creates a new list account option.
+ *
+ * The list passed will be owned by the account option, and the
+ * strings inside will be freed automatically.
+ *
+ * The list is in key, value pairs. The key is the ID stored and used
+ * internally, and the value is the label displayed.
+ *
+ * @param text      The text of the option.
+ * @param pref_name The account preference name for the option.
+ * @param list      The key, value list.
+ *
+ * @return The account option.
+ */
+GaimAccountOption *gaim_account_option_list_new(const char *text,
+												const char *pref_name,
+												GList *list);
+
+/**
  * Destroys an account option.
  *
  * @param option The option to destroy.
@@ -159,6 +179,30 @@
 											const char *value);
 
 /**
+ * Sets the list values for an account option.
+ *
+ * The list passed will be owned by the account option, and the
+ * strings inside will be freed automatically.
+ *
+ * The list is in key, value pairs. The key is the ID stored and used
+ * internally, and the value is the label displayed.
+ *
+ * @param option The account option.
+ * @param values The default list value.
+ */
+void gaim_account_option_set_list(GaimAccountOption *option, GList *values);
+
+/**
+ * Adds an item to a list account option.
+ *
+ * @param option The account option.
+ * @param key    The key.
+ * @param value  The value.
+ */
+void gaim_account_option_add_list_item(GaimAccountOption *option,
+									   const char *key, const char *value);
+
+/**
  * Returns the specified account option's type.
  *
  * @param option The account option.
@@ -211,7 +255,16 @@
  * @return The default string value.
  */
 const char *gaim_account_option_get_default_string(
-		const GaimAccountOption *option);
+	const GaimAccountOption *option);
+
+/**
+ * Returns the list values for an account option.
+ *
+ * @param option The account option.
+ *
+ * @return The list values.
+ */
+const GList *gaim_account_option_get_list(const GaimAccountOption *option);
 
 /*@}*/