diff src/request.c @ 8285:d335cc7bca54

[gaim-migrate @ 9009] Added a type hint to GaimRequestField. This will be used for neat stuff I'm planning on. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Wed, 18 Feb 2004 02:39:47 +0000
parents fa6395637e2c
children 89d9d004e3f3
line wrap: on
line diff
--- a/src/request.c	Tue Feb 17 20:08:45 2004 +0000
+++ b/src/request.c	Wed Feb 18 02:39:47 2004 +0000
@@ -273,6 +273,9 @@
 	if (field->label != NULL)
 		g_free(field->label);
 
+	if (field->type_hint != NULL)
+		g_free(field->type_hint);
+
 	if (field->type == GAIM_REQUEST_FIELD_STRING)
 	{
 		if (field->u.string.default_value != NULL)
@@ -329,6 +332,18 @@
 	field->visible = visible;
 }
 
+void
+gaim_request_field_set_type_hint(GaimRequestField *field,
+								 const char *type_hint)
+{
+	g_return_if_fail(field != NULL);
+
+	if (field->type_hint != NULL)
+		g_free(field->type_hint);
+
+	field->type_hint = (type_hint == NULL ? NULL : g_strdup(type_hint));
+}
+
 GaimRequestFieldType
 gaim_request_field_get_type(const GaimRequestField *field)
 {
@@ -361,6 +376,14 @@
 	return field->visible;
 }
 
+const char *
+gaim_request_field_get_type_hint(const GaimRequestField *field)
+{
+	g_return_val_if_fail(field != NULL, NULL);
+
+	return field->type_hint;
+}
+
 GaimRequestField *
 gaim_request_field_string_new(const char *id, const char *text,
 							  const char *default_value, gboolean multiline)