# HG changeset patch
# Node ID aa9a8041c440
# Parent  d08c2d08d16e
diff --git a/finch/gntrequest.c b/finch/gntrequest.c
--- a/finch/gntrequest.c
+++ b/finch/gntrequest.c
@@ -315,13 +315,12 @@ request_fields_cb(GntWidget *button, Pur
 				int value = (text && *text) ? atoi(text) : 0;
 				purple_request_field_int_set_value(PURPLE_REQUEST_FIELD_INT(field),
 				                                   value);
-			}
-			else if (type == PURPLE_REQUEST_FIELD_CHOICE)
-			{
+			} else if(PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
 				GntWidget *combo = g_object_get_data(G_OBJECT(field),
 				                                     "finch-ui-data");
 				gpointer value = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo));
-				purple_request_field_choice_set_value(field, value);
+				purple_request_field_choice_set_value(PURPLE_REQUEST_FIELD_CHOICE(field),
+				                                      value);
 			}
 			else if (type == PURPLE_REQUEST_FIELD_LIST)
 			{
@@ -471,16 +470,18 @@ create_integer_field(PurpleRequestField 
 static GntWidget*
 create_choice_field(PurpleRequestField *field)
 {
+	PurpleRequestFieldChoice *cfield = PURPLE_REQUEST_FIELD_CHOICE(field);
 	GntWidget *combo = gnt_combo_box_new();
 
-	for (GList *it = purple_request_field_choice_get_elements(field); it != NULL; it = g_list_next(it))
+	for(GList *it = purple_request_field_choice_get_elements(cfield);
+	    it != NULL; it = g_list_next(it))
 	{
 		PurpleKeyValuePair *choice = it->data;
 
 		gnt_combo_box_add_data(GNT_COMBO_BOX(combo), choice->value, choice->key);
 	}
 	gnt_combo_box_set_selected(GNT_COMBO_BOX(combo),
-		purple_request_field_choice_get_default_value(field));
+		purple_request_field_choice_get_default_value(cfield));
 	return combo;
 }
 
@@ -666,7 +667,7 @@ finch_request_fields(const char *title, 
 				widget = create_string_field(field, &username);
 			} else if(PURPLE_IS_REQUEST_FIELD_INT(field)) {
 				widget = create_integer_field(field);
-			} else if (type == PURPLE_REQUEST_FIELD_CHOICE) {
+			} else if(PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
 				widget = create_choice_field(field);
 			} else if (type == PURPLE_REQUEST_FIELD_LIST) {
 				widget = create_list_field(field);
@@ -928,13 +929,12 @@ GntWidget *finch_request_field_get_widge
 		ret = create_string_field(field, NULL);
 	} else if(PURPLE_IS_REQUEST_FIELD_INT(field)) {
 		ret = create_integer_field(field);
+	} else if(PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
+		ret = create_choice_field(field);
 	} else if(PURPLE_IS_REQUEST_FIELD_ACCOUNT(field)) {
 		ret = create_account_field(field);
 	} else {
 	switch (purple_request_field_get_field_type(field)) {
-		case PURPLE_REQUEST_FIELD_CHOICE:
-			ret = create_choice_field(field);
-			break;
 		case PURPLE_REQUEST_FIELD_LIST:
 			ret = create_list_field(field);
 			break;
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -99,6 +99,7 @@ purple_coresources = [
 	'request.c',
 	'request/purplerequestfieldaccount.c',
 	'request/purplerequestfieldbool.c',
+	'request/purplerequestfieldchoice.c',
 	'request/purplerequestfieldint.c',
 	'request/purplerequestfieldstring.c',
 	'request-datasheet.c',
@@ -226,6 +227,7 @@ purple_coreheaders = [
 purple_request_headers = [
 	'request/purplerequestfieldaccount.h',
 	'request/purplerequestfieldbool.h',
+	'request/purplerequestfieldchoice.h',
 	'request/purplerequestfieldint.h',
 	'request/purplerequestfieldstring.h',
 ]
diff --git a/libpurple/protocols/demo/purpledemoprotocolactions.c b/libpurple/protocols/demo/purpledemoprotocolactions.c
--- a/libpurple/protocols/demo/purpledemoprotocolactions.c
+++ b/libpurple/protocols/demo/purpledemoprotocolactions.c
@@ -455,6 +455,7 @@ purple_demo_protocol_request_fields_acti
 	PurpleRequestPage *page = NULL;
 	PurpleRequestGroup *group = NULL;
 	PurpleRequestField *field = NULL;
+	PurpleRequestFieldChoice *choice_field = NULL;
 	GBytes *icon = NULL;
 	gconstpointer icon_data = NULL;
 	gsize icon_len = 0;
@@ -520,10 +521,11 @@ purple_demo_protocol_request_fields_acti
 	purple_request_group_add_field(group, field);
 
 	field = purple_request_field_choice_new("choice", _("A choice"), "foo");
-	purple_request_field_choice_add(field, _("foo"), "foo");
-	purple_request_field_choice_add(field, _("bar"), "bar");
-	purple_request_field_choice_add(field, _("baz"), "baz");
-	purple_request_field_choice_add(field, _("quux"), "quux");
+	choice_field = PURPLE_REQUEST_FIELD_CHOICE(field);
+	purple_request_field_choice_add(choice_field, _("foo"), "foo");
+	purple_request_field_choice_add(choice_field, _("bar"), "bar");
+	purple_request_field_choice_add(choice_field, _("baz"), "baz");
+	purple_request_field_choice_add(choice_field, _("quux"), "quux");
 	purple_request_group_add_field(group, field);
 
 	field = purple_request_field_list_new("list", _("A list"));
diff --git a/libpurple/protocols/gg/pubdir-prpl.c b/libpurple/protocols/gg/pubdir-prpl.c
--- a/libpurple/protocols/gg/pubdir-prpl.c
+++ b/libpurple/protocols/gg/pubdir-prpl.c
@@ -749,6 +749,7 @@ ggp_pubdir_search(PurpleConnection *gc, 
 	PurpleRequestPage *page;
 	PurpleRequestGroup *group;
 	PurpleRequestField *field;
+	PurpleRequestFieldChoice *choice;
 
 	purple_debug_info("gg", "ggp_pubdir_search");
 
@@ -766,11 +767,12 @@ ggp_pubdir_search(PurpleConnection *gc, 
 
 	field = purple_request_field_choice_new(
 	        "gender", _("Gender"), form ? GINT_TO_POINTER(form->gender) : NULL);
-	purple_request_field_choice_add(field, _("Male or female"), NULL);
-	purple_request_field_choice_add(field, _("Male"),
-		GINT_TO_POINTER(GGP_PUBDIR_GENDER_MALE));
-	purple_request_field_choice_add(field, _("Female"),
-		GINT_TO_POINTER(GGP_PUBDIR_GENDER_FEMALE));
+	choice = PURPLE_REQUEST_FIELD_CHOICE(field);
+	purple_request_field_choice_add(choice, _("Male or female"), NULL);
+	purple_request_field_choice_add(choice, _("Male"),
+	                                GINT_TO_POINTER(GGP_PUBDIR_GENDER_MALE));
+	purple_request_field_choice_add(choice, _("Female"),
+	                                GINT_TO_POINTER(GGP_PUBDIR_GENDER_FEMALE));
 	purple_request_group_add_field(group, field);
 
 	purple_request_fields(gc, _("Find buddies"), _("Find buddies"),
@@ -935,6 +937,7 @@ ggp_pubdir_set_info_dialog(PurpleConnect
 	PurpleRequestPage *page;
 	PurpleRequestGroup *group;
 	PurpleRequestField *field;
+	PurpleRequestFieldChoice *choice;
 	gchar *bday = NULL;
 	gsize i;
 	const ggp_pubdir_record *record;
@@ -962,10 +965,11 @@ ggp_pubdir_set_info_dialog(PurpleConnect
 	        "gender", _("Gender"),
 	        record ? GINT_TO_POINTER(record->gender)
 	               : GGP_PUBDIR_GENDER_UNSPECIFIED);
+	choice = PURPLE_REQUEST_FIELD_CHOICE(field);
 	purple_request_field_set_required(field, TRUE);
-	purple_request_field_choice_add(field, _("Male"),
+	purple_request_field_choice_add(choice, _("Male"),
 	                                GINT_TO_POINTER(GGP_PUBDIR_GENDER_MALE));
-	purple_request_field_choice_add(field, _("Female"),
+	purple_request_field_choice_add(choice, _("Female"),
 	                                GINT_TO_POINTER(GGP_PUBDIR_GENDER_FEMALE));
 	purple_request_group_add_field(group, field);
 
@@ -991,13 +995,14 @@ ggp_pubdir_set_info_dialog(PurpleConnect
 	   your language, feel free to use it. Otherwise it's probably acceptable
 	   to leave it changed or transliterate it into your alphabet. */
 	field = purple_request_field_choice_new("province", _("Voivodeship"), 0);
+	choice = PURPLE_REQUEST_FIELD_CHOICE(field);
 	purple_request_group_add_field(group, field);
 	for (i = 0; i < ggp_pubdir_provinces_count; i++) {
-		purple_request_field_choice_add(field, ggp_pubdir_provinces[i],
+		purple_request_field_choice_add(choice, ggp_pubdir_provinces[i],
 		                                GINT_TO_POINTER(i));
 		if (record && i == record->province) {
-			purple_request_field_choice_set_value(field, GINT_TO_POINTER(i));
-			purple_request_field_choice_set_default_value(field,
+			purple_request_field_choice_set_value(choice, GINT_TO_POINTER(i));
+			purple_request_field_choice_set_default_value(choice,
 			                                              GINT_TO_POINTER(i));
 		}
 	}
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -2622,8 +2622,7 @@ jabber_media_cancel_cb(JabberMediaReques
 
 static void
 jabber_media_ok_cb(JabberMediaRequest *request, PurpleRequestPage *page) {
-	PurpleRequestField *field = purple_request_page_get_field(page, "resource");
-	const gchar *selected = purple_request_field_choice_get_value(field);
+	const gchar *selected = purple_request_page_get_choice(page, "resource");
 	gchar *who = g_strdup_printf("%s/%s", request->who, selected);
 	jabber_initiate_media(request->media, request->account, who, request->type);
 
@@ -2698,10 +2697,12 @@ jabber_initiate_media(PurpleProtocolMedi
 		char *msg;
 		PurpleRequestPage *page = NULL;
 		PurpleRequestField *field = NULL;
+		PurpleRequestFieldChoice *choice = NULL;
 		PurpleRequestGroup *group = NULL;
 		JabberMediaRequest *request;
 
 		field = purple_request_field_choice_new("resource", _("Resource"), 0);
+		choice = PURPLE_REQUEST_FIELD_CHOICE(field);
 		for(l = jb->resources; l; l = l->next)
 		{
 			JabberBuddyResource *ljbr = l->data;
@@ -2715,19 +2716,22 @@ jabber_initiate_media(PurpleProtocolMedi
 					(type & PURPLE_MEDIA_VIDEO)) {
 				if (caps & PURPLE_MEDIA_CAPS_AUDIO_VIDEO) {
 					jbr = ljbr;
-					purple_request_field_choice_add_full(field,
-					        jbr->name, g_strdup(jbr->name), g_free);
+					purple_request_field_choice_add_full(choice, jbr->name,
+					                                     g_strdup(jbr->name),
+					                                     g_free);
 				}
 			} else if (type & (PURPLE_MEDIA_AUDIO) &&
 					(caps & PURPLE_MEDIA_CAPS_AUDIO)) {
 				jbr = ljbr;
-				purple_request_field_choice_add_full(field,
-				        jbr->name, g_strdup(jbr->name), g_free);
+				purple_request_field_choice_add_full(choice, jbr->name,
+				                                     g_strdup(jbr->name),
+				                                     g_free);
 			}else if (type & (PURPLE_MEDIA_VIDEO) &&
 					(caps & PURPLE_MEDIA_CAPS_VIDEO)) {
 				jbr = ljbr;
-				purple_request_field_choice_add_full(field,
-				        jbr->name, g_strdup(jbr->name), g_free);
+				purple_request_field_choice_add_full(choice, jbr->name,
+				                                     g_strdup(jbr->name),
+				                                     g_free);
 			}
 		}
 
@@ -2737,8 +2741,7 @@ jabber_initiate_media(PurpleProtocolMedi
 			return FALSE;
 		}
 
-		if (g_list_length(purple_request_field_choice_get_elements(
-				field)) <= 1) {
+		if(g_list_length(purple_request_field_choice_get_elements(choice)) <= 1) {
 			gchar *name;
 			gboolean result;
 			g_object_unref(field);
diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c
--- a/libpurple/protocols/jabber/si.c
+++ b/libpurple/protocols/jabber/si.c
@@ -1519,8 +1519,7 @@ static void do_transfer_send(PurpleXfer 
 static void
 resource_select_ok_cb(PurpleXfer *xfer, PurpleRequestPage *page)
 {
-	PurpleRequestField *field = purple_request_page_get_field(page, "resource");
-	const char *selected_label = purple_request_field_choice_get_value(field);
+	const char *selected_label = purple_request_page_get_choice(page, "resource");
 
 	do_transfer_send(xfer, selected_label);
 }
@@ -1587,20 +1586,31 @@ static void jabber_si_xfer_xfer_init(Pur
 		} else {
 			/* we've got multiple resources, we need to pick one to send to */
 			GList *l;
-			char *msg = g_strdup_printf(_("Please select the resource of %s to which you would like to send a file"), purple_xfer_get_remote_user(xfer));
-			PurpleRequestPage *page = purple_request_page_new();
-			PurpleRequestField *field = purple_request_field_choice_new("resource", _("Resource"), 0);
-			PurpleRequestGroup *group = purple_request_group_new(NULL);
+			PurpleRequestPage *page = NULL;
+			PurpleRequestField *field = NULL;
+			PurpleRequestFieldChoice *choice = NULL;
+			PurpleRequestGroup *group = NULL;
+			char *msg = NULL;
 
+			field = purple_request_field_choice_new("resource", _("Resource"), 0);
+			choice = PURPLE_REQUEST_FIELD_CHOICE(field);
 			for(l = resources; l; l = l->next) {
 				jbr = l->data;
-				purple_request_field_choice_add_full(field, jbr->name, g_strdup(jbr->name), g_free);
+				purple_request_field_choice_add_full(choice, jbr->name,
+				                                     g_strdup(jbr->name),
+				                                     g_free);
 			}
 
+			group = purple_request_group_new(NULL);
 			purple_request_group_add_field(group, field);
 
+			page = purple_request_page_new();
 			purple_request_page_add_group(page, group);
 
+			msg = g_strdup_printf(_("Please select the resource of %s to "
+			                        "which you would like to send a file"),
+			                      purple_xfer_get_remote_user(xfer));
+
 			purple_request_fields(jsx->js->gc, _("Select a Resource"), msg, NULL, page,
 					_("Send File"), G_CALLBACK(resource_select_ok_cb), _("Cancel"), G_CALLBACK(resource_select_cancel_cb),
 					purple_request_cpar_from_connection(jsx->js->gc), xfer);
diff --git a/libpurple/protocols/jabber/xdata.c b/libpurple/protocols/jabber/xdata.c
--- a/libpurple/protocols/jabber/xdata.c
+++ b/libpurple/protocols/jabber/xdata.c
@@ -64,11 +64,12 @@ jabber_x_data_ok_cb(struct jabber_x_data
 		if(groups->data == data->actiongroup) {
 			for(flds = purple_request_group_get_fields(groups->data); flds; flds = flds->next) {
 				PurpleRequestField *field = flds->data;
+				PurpleRequestFieldChoice *choice = PURPLE_REQUEST_FIELD_CHOICE(field);
 				const char *id = purple_request_field_get_id(field);
 				int handleindex;
 				if(!purple_strequal(id, "libpurple:jabber:xdata:actions"))
 					continue;
-				handleindex = GPOINTER_TO_INT(purple_request_field_choice_get_value(field));
+				handleindex = GPOINTER_TO_INT(purple_request_field_choice_get_value(choice));
 				actionhandle = g_strdup(g_list_nth_data(data->actions, handleindex));
 				break;
 			}
@@ -369,22 +370,26 @@ void *jabber_x_data_request_with_actions
 	}
 
 	if(actions != NULL) {
-		PurpleRequestField *actionfield;
+		PurpleRequestField *field = NULL;
+		PurpleRequestFieldChoice *choice = NULL;
 		GList *action;
 		int i;
 
 		data->actiongroup = group = purple_request_group_new(_("Actions"));
 		purple_request_page_add_group(page, group);
-		actionfield = purple_request_field_choice_new("libpurple:jabber:xdata:actions", _("Select an action"), GINT_TO_POINTER(defaultaction));
+		field = purple_request_field_choice_new("libpurple:jabber:xdata:actions",
+		                                        _("Select an action"),
+		                                        GINT_TO_POINTER(defaultaction));
+		choice = PURPLE_REQUEST_FIELD_CHOICE(field);
 
 		for(i = 0, action = actions; action; action = g_list_next(action), i++) {
 			JabberXDataAction *a = action->data;
 
-			purple_request_field_choice_add(actionfield, a->name, GINT_TO_POINTER(i));
+			purple_request_field_choice_add(choice, a->name, GINT_TO_POINTER(i));
 			data->actions = g_list_append(data->actions, g_strdup(a->handle));
 		}
-		purple_request_field_set_required(actionfield,TRUE);
-		purple_request_group_add_field(group, actionfield);
+		purple_request_field_set_required(field, TRUE);
+		purple_request_group_add_field(group, field);
 	}
 
 	if((x = purple_xmlnode_get_child(packet, "title")))
diff --git a/libpurple/purplerequestfield.h b/libpurple/purplerequestfield.h
--- a/libpurple/purplerequestfield.h
+++ b/libpurple/purplerequestfield.h
@@ -64,7 +64,6 @@ struct _PurpleRequestFieldClass {
 /**
  * PurpleRequestFieldType:
  * @PURPLE_REQUEST_FIELD_NONE: No field.
- * @PURPLE_REQUEST_FIELD_CHOICE: Choice field (dropdown?).
  * @PURPLE_REQUEST_FIELD_LIST: List field.
  * @PURPLE_REQUEST_FIELD_LABEL: Label field.
  * @PURPLE_REQUEST_FIELD_IMAGE: Image field.
@@ -75,7 +74,6 @@ struct _PurpleRequestFieldClass {
 typedef enum
 {
 	PURPLE_REQUEST_FIELD_NONE,
-	PURPLE_REQUEST_FIELD_CHOICE,
 	PURPLE_REQUEST_FIELD_LIST,
 	PURPLE_REQUEST_FIELD_LABEL,
 	PURPLE_REQUEST_FIELD_IMAGE,
@@ -313,108 +311,6 @@ void purple_request_field_set_sensitive(
 gboolean purple_request_field_is_sensitive(PurpleRequestField *field);
 
 /**************************************************************************/
-/* Choice Field API                                                       */
-/**************************************************************************/
-
-/**
- * purple_request_field_choice_new:
- * @id:            The field ID.
- * @text:          The optional label of the field.
- * @default_value: The default choice.
- *
- * Creates a multiple choice field.
- *
- * This is often represented as a group of radio buttons.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *
-purple_request_field_choice_new(const char *id, const char *text,
-	gpointer default_value);
-
-/**
- * purple_request_field_choice_add:
- * @field: The choice field.
- * @label: The choice label.
- * @data:  The choice value.
- *
- * Adds a choice to a multiple choice field.
- */
-void
-purple_request_field_choice_add(PurpleRequestField *field, const char *label,
-	gpointer data);
-
-/**
- * purple_request_field_choice_add_full:
- * @field: The choice field.
- * @label: The choice label.
- * @data:  The choice value.
- * @destroy: The value destroy function.
- *
- * Adds a choice to a multiple choice field with destructor for value.
- *
- * Since: 3.0.0
- */
-void
-purple_request_field_choice_add_full(PurpleRequestField *field, const char *label,
-                                     gpointer data, GDestroyNotify destroy);
-
-/**
- * purple_request_field_choice_set_default_value:
- * @field:         The field.
- * @default_value: The default value.
- *
- * Sets the default value in an choice field.
- */
-void
-purple_request_field_choice_set_default_value(PurpleRequestField *field,
-	gpointer default_value);
-
-/**
- * purple_request_field_choice_set_value:
- * @field: The field.
- * @value: The value.
- *
- * Sets the value in an choice field.
- */
-void
-purple_request_field_choice_set_value(PurpleRequestField *field,
-	gpointer value);
-
-/**
- * purple_request_field_choice_get_default_value:
- * @field: The field.
- *
- * Returns the default value in an choice field.
- *
- * Returns: The default value.
- */
-gpointer
-purple_request_field_choice_get_default_value(PurpleRequestField *field);
-
-/**
- * purple_request_field_choice_get_value:
- * @field: The field.
- *
- * Returns the user-entered value in an choice field.
- *
- * Returns: The value.
- */
-gpointer
-purple_request_field_choice_get_value(PurpleRequestField *field);
-
-/**
- * purple_request_field_choice_get_elements:
- * @field: The field.
- *
- * Returns a list of elements in a choice field.
- *
- * Returns: (element-type PurpleKeyValuePair) (transfer none): The list of pairs of {label, value}.
- */
-GList *
-purple_request_field_choice_get_elements(PurpleRequestField *field);
-
-/**************************************************************************/
 /* List Field API                                                         */
 /**************************************************************************/
 
diff --git a/libpurple/purplerequestfield.h b/libpurple/request/purplerequestfieldchoice.h
copy from libpurple/purplerequestfield.h
copy to libpurple/request/purplerequestfieldchoice.h
--- a/libpurple/purplerequestfield.h
+++ b/libpurple/request/purplerequestfieldchoice.h
@@ -24,8 +24,8 @@
 # error "only <purple.h> may be included directly"
 #endif
 
-#ifndef PURPLE_REQUEST_FIELD_H
-#define PURPLE_REQUEST_FIELD_H
+#ifndef PURPLE_REQUEST_FIELD_CHOICE_H
+#define PURPLE_REQUEST_FIELD_CHOICE_H
 
 #include <stdlib.h>
 
@@ -33,288 +33,19 @@
 #include <glib-object.h>
 
 /**
- * PurpleRequestField:
+ * PurpleRequestFieldChoice:
  *
- * A request field.
+ * A choice request field.
  */
-typedef struct _PurpleRequestField PurpleRequestField;
-
-#include "request.h"
-#include "request-datasheet.h"
-
-#define PURPLE_DEFAULT_ACTION_NONE	-1
-
-/**
- * PurpleRequestFieldClass:
- *
- * #PurpleRequestFieldClass defines the interface for a request field.
- *
- * Since: 3.0.0
- */
-struct _PurpleRequestFieldClass {
-	/*< private >*/
-	GObjectClass parent_class;
-
-	/*< public >*/
+typedef struct _PurpleRequestFieldChoice PurpleRequestFieldChoice;
 
-	/*< private >*/
-	gpointer reserved[4];
-};
-
-/**
- * PurpleRequestFieldType:
- * @PURPLE_REQUEST_FIELD_NONE: No field.
- * @PURPLE_REQUEST_FIELD_CHOICE: Choice field (dropdown?).
- * @PURPLE_REQUEST_FIELD_LIST: List field.
- * @PURPLE_REQUEST_FIELD_LABEL: Label field.
- * @PURPLE_REQUEST_FIELD_IMAGE: Image field.
- * @PURPLE_REQUEST_FIELD_DATASHEET: Datasheet field.
- *
- * A type of field.
- */
-typedef enum
-{
-	PURPLE_REQUEST_FIELD_NONE,
-	PURPLE_REQUEST_FIELD_CHOICE,
-	PURPLE_REQUEST_FIELD_LIST,
-	PURPLE_REQUEST_FIELD_LABEL,
-	PURPLE_REQUEST_FIELD_IMAGE,
-	PURPLE_REQUEST_FIELD_DATASHEET
-
-} PurpleRequestFieldType;
-
-typedef gboolean (*PurpleRequestFieldValidator)(PurpleRequestField *field,
-	gchar **errmsg, gpointer user_data);
+#include "purplerequestfield.h"
 
 G_BEGIN_DECLS
 
-/**************************************************************************/
-/* Field API                                                              */
-/**************************************************************************/
-
-#define PURPLE_TYPE_REQUEST_FIELD (purple_request_field_get_type())
-G_DECLARE_DERIVABLE_TYPE(PurpleRequestField, purple_request_field,
-                         PURPLE, REQUEST_FIELD, GObject)
-
-/**
- * purple_request_field_new:
- * @id:   The field ID.
- * @text: The text label of the field.
- * @type: The type of field.
- *
- * Creates a field of the specified type.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_new(const char *id, const char *text,
-										 PurpleRequestFieldType type);
-
-/**
- * purple_request_field_set_label:
- * @field: The field.
- * @label: The text label.
- *
- * Sets the label text of a field.
- */
-void purple_request_field_set_label(PurpleRequestField *field, const char *label);
-
-/**
- * purple_request_field_set_visible:
- * @field:   The field.
- * @visible: TRUE if visible, or FALSE if not.
- *
- * Sets whether or not a field is visible.
- */
-void purple_request_field_set_visible(PurpleRequestField *field, gboolean visible);
-
-/**
- * purple_request_field_set_type_hint:
- * @field:     The field.
- * @type_hint: The type hint.
- *
- * Sets the type hint for the field.
- *
- * This is optionally used by the UIs to provide such features as
- * auto-completion for type hints like "account" and "screenname".
- */
-void purple_request_field_set_type_hint(PurpleRequestField *field,
-									  const char *type_hint);
-
-/**
- * purple_request_field_set_tooltip:
- * @field:     The field.
- * @tooltip:   The tooltip text.
- *
- * Sets the tooltip for the field.
- *
- * This is optionally used by the UIs to provide a tooltip for
- * the field.
- */
-void purple_request_field_set_tooltip(PurpleRequestField *field,
-									const char *tooltip);
-
-/**
- * purple_request_field_set_required:
- * @field:    The field.
- * @required: TRUE if required, or FALSE.
- *
- * Sets whether or not a field is required.
- */
-void purple_request_field_set_required(PurpleRequestField *field,
-									 gboolean required);
-
-/**
- * purple_request_field_get_field_type:
- * @field: The field.
- *
- * Returns the type of a field.
- *
- * Returns: The field's type.
- */
-PurpleRequestFieldType purple_request_field_get_field_type(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_group:
- * @field: The field.
- *
- * Returns the group for the field.
- *
- * Returns: (transfer none): The UI data.
- */
-PurpleRequestGroup *purple_request_field_get_group(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_id:
- * @field: The field.
- *
- * Returns the ID of a field.
- *
- * Returns: The ID
- */
-const char *purple_request_field_get_id(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_label:
- * @field: The field.
- *
- * Returns the label text of a field.
- *
- * Returns: The label text.
- */
-const char *purple_request_field_get_label(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_visible:
- * @field: The field.
- *
- * Returns whether or not a field is visible.
- *
- * Returns: TRUE if the field is visible. FALSE otherwise.
- */
-gboolean purple_request_field_is_visible(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_type_hint:
- * @field: The field.
- *
- * Returns the field's type hint.
- *
- * Returns: The field's type hint.
- */
-const char *purple_request_field_get_type_hint(PurpleRequestField *field);
-
-/**
- * purple_request_field_get_tooltip:
- * @field: The field.
- *
- * Returns the field's tooltip.
- *
- * Returns: The field's tooltip.
- */
-const char *purple_request_field_get_tooltip(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_required:
- * @field: The field.
- *
- * Returns whether or not a field is required.
- *
- * Returns: TRUE if the field is required, or FALSE.
- */
-gboolean purple_request_field_is_required(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_filled:
- * @field: The field.
- *
- * Checks, if specified field has value.
- *
- * Returns: TRUE if the field has value, or FALSE.
- */
-gboolean purple_request_field_is_filled(PurpleRequestField *field);
-
-/**
- * purple_request_field_set_validator:
- * @field:     The field.
- * @validator: (scope notified): The validator callback, NULL to disable validation.
- * @user_data: The data to pass to the callback.
- *
- * Sets validator for a single field.
- */
-void purple_request_field_set_validator(PurpleRequestField *field,
-	PurpleRequestFieldValidator validator, void *user_data);
-
-/**
- * purple_request_field_is_validatable:
- * @field: The field.
- *
- * Returns whether or not field has validator set.
- *
- * Returns: TRUE if the field has validator, or FALSE.
- */
-gboolean purple_request_field_is_validatable(PurpleRequestField *field);
-
-/**
- * purple_request_field_is_valid:
- * @field:  The field.
- * @errmsg: If non-NULL, the memory area, where the pointer to validation
- *         failure message will be set.
- *
- * Checks, if specified field is valid.
- *
- * If detailed message about failure reason is needed, there is an option to
- * return (via errmsg argument) pointer to newly allocated error message.
- * It must be freed with g_free after use.
- *
- * Note: empty, not required fields are valid.
- *
- * Returns: TRUE, if the field is valid, FALSE otherwise.
- */
-gboolean purple_request_field_is_valid(PurpleRequestField *field, gchar **errmsg);
-
-/**
- * purple_request_field_set_sensitive:
- * @field:     The field.
- * @sensitive: TRUE if the field should be sensitive for user input.
- *
- * Sets field editable.
- */
-void purple_request_field_set_sensitive(PurpleRequestField *field,
-	gboolean sensitive);
-
-/**
- * purple_request_field_is_sensitive:
- * @field: The field.
- *
- * Checks, if field is editable.
- *
- * Returns: TRUE, if the field is sensitive for user input.
- */
-gboolean purple_request_field_is_sensitive(PurpleRequestField *field);
-
-/**************************************************************************/
-/* Choice Field API                                                       */
-/**************************************************************************/
+#define PURPLE_TYPE_REQUEST_FIELD_CHOICE (purple_request_field_choice_get_type())
+G_DECLARE_FINAL_TYPE(PurpleRequestFieldChoice, purple_request_field_choice,
+                     PURPLE, REQUEST_FIELD_CHOICE, PurpleRequestField)
 
 /**
  * purple_request_field_choice_new:
@@ -328,9 +59,7 @@ gboolean purple_request_field_is_sensiti
  *
  * Returns: (transfer full): The new field.
  */
-PurpleRequestField *
-purple_request_field_choice_new(const char *id, const char *text,
-	gpointer default_value);
+PurpleRequestField *purple_request_field_choice_new(const char *id, const char *text, gpointer default_value);
 
 /**
  * purple_request_field_choice_add:
@@ -340,9 +69,7 @@ purple_request_field_choice_new(const ch
  *
  * Adds a choice to a multiple choice field.
  */
-void
-purple_request_field_choice_add(PurpleRequestField *field, const char *label,
-	gpointer data);
+void purple_request_field_choice_add(PurpleRequestFieldChoice *field, const char *label, gpointer data);
 
 /**
  * purple_request_field_choice_add_full:
@@ -355,53 +82,45 @@ purple_request_field_choice_add(PurpleRe
  *
  * Since: 3.0.0
  */
-void
-purple_request_field_choice_add_full(PurpleRequestField *field, const char *label,
-                                     gpointer data, GDestroyNotify destroy);
+void purple_request_field_choice_add_full(PurpleRequestFieldChoice *field, const char *label, gpointer data, GDestroyNotify destroy);
 
 /**
  * purple_request_field_choice_set_default_value:
  * @field:         The field.
  * @default_value: The default value.
  *
- * Sets the default value in an choice field.
+ * Sets the default value in a choice field.
  */
-void
-purple_request_field_choice_set_default_value(PurpleRequestField *field,
-	gpointer default_value);
+void purple_request_field_choice_set_default_value(PurpleRequestFieldChoice *field, gpointer default_value);
 
 /**
  * purple_request_field_choice_set_value:
  * @field: The field.
  * @value: The value.
  *
- * Sets the value in an choice field.
+ * Sets the value in a choice field.
  */
-void
-purple_request_field_choice_set_value(PurpleRequestField *field,
-	gpointer value);
+void purple_request_field_choice_set_value(PurpleRequestFieldChoice *field, gpointer value);
 
 /**
  * purple_request_field_choice_get_default_value:
  * @field: The field.
  *
- * Returns the default value in an choice field.
+ * Returns the default value in a choice field.
  *
  * Returns: The default value.
  */
-gpointer
-purple_request_field_choice_get_default_value(PurpleRequestField *field);
+gpointer purple_request_field_choice_get_default_value(PurpleRequestFieldChoice *field);
 
 /**
  * purple_request_field_choice_get_value:
  * @field: The field.
  *
- * Returns the user-entered value in an choice field.
+ * Returns the user-entered value in a choice field.
  *
  * Returns: The value.
  */
-gpointer
-purple_request_field_choice_get_value(PurpleRequestField *field);
+gpointer purple_request_field_choice_get_value(PurpleRequestFieldChoice *field);
 
 /**
  * purple_request_field_choice_get_elements:
@@ -411,289 +130,8 @@ purple_request_field_choice_get_value(Pu
  *
  * Returns: (element-type PurpleKeyValuePair) (transfer none): The list of pairs of {label, value}.
  */
-GList *
-purple_request_field_choice_get_elements(PurpleRequestField *field);
-
-/**************************************************************************/
-/* List Field API                                                         */
-/**************************************************************************/
-
-/**
- * purple_request_field_list_new:
- * @id:   The field ID.
- * @text: The optional label of the field.
- *
- * Creates a multiple list item field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_list_new(const char *id, const char *text);
-
-/**
- * purple_request_field_list_set_multi_select:
- * @field:        The list field.
- * @multi_select: TRUE if multiple selection is enabled,
- *                     or FALSE otherwise.
- *
- * Sets whether or not a list field allows multiple selection.
- */
-void purple_request_field_list_set_multi_select(PurpleRequestField *field,
-											  gboolean multi_select);
-
-/**
- * purple_request_field_list_get_multi_select:
- * @field: The list field.
- *
- * Returns whether or not a list field allows multiple selection.
- *
- * Returns: TRUE if multiple selection is enabled, or FALSE otherwise.
- */
-gboolean purple_request_field_list_get_multi_select(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_get_data:
- * @field: The list field.
- * @text:  The item text.
- *
- * Returns the data for a particular item.
- *
- * Returns: The data associated with the item.
- */
-void *purple_request_field_list_get_data(PurpleRequestField *field, const char *text);
-
-/**
- * purple_request_field_list_add_icon:
- * @field:     The list field.
- * @item:      The list item.
- * @icon_path: The path to icon file, or %NULL for no icon.
- * @data:      The associated data.
- *
- * Adds an item to a list field.
- */
-void purple_request_field_list_add_icon(PurpleRequestField *field,
-								 const char *item, const char* icon_path, void* data);
-
-/**
- * purple_request_field_list_add_selected:
- * @field: The field.
- * @item:  The item to add.
- *
- * Adds a selected item to the list field.
- */
-void purple_request_field_list_add_selected(PurpleRequestField *field,
-										  const char *item);
-
-/**
- * purple_request_field_list_clear_selected:
- * @field: The field.
- *
- * Clears the list of selected items in a list field.
- */
-void purple_request_field_list_clear_selected(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_set_selected:
- * @field: The field.
- * @items: (element-type utf8) (transfer none): The list of selected items.
- *
- * Sets a list of selected items in a list field.
- */
-void purple_request_field_list_set_selected(PurpleRequestField *field,
-										  GList *items);
-
-/**
- * purple_request_field_list_is_selected:
- * @field: The field.
- * @item:  The item.
- *
- * Returns whether or not a particular item is selected in a list field.
- *
- * Returns: TRUE if the item is selected. FALSE otherwise.
- */
-gboolean purple_request_field_list_is_selected(PurpleRequestField *field, const char *item);
-
-/**
- * purple_request_field_list_get_selected:
- * @field: The field.
- *
- * Returns a list of selected items in a list field.
- *
- * To retrieve the data for each item, use
- * purple_request_field_list_get_data().
- *
- * Returns: (element-type utf8) (transfer none): The list of selected items.
- */
-GList *purple_request_field_list_get_selected(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_get_items:
- * @field: The field.
- *
- * Returns a list of items in a list field.
- *
- * Returns: (element-type PurpleKeyValuePair) (transfer none): The list of items.
- */
-GList *purple_request_field_list_get_items(PurpleRequestField *field);
-
-/**
- * purple_request_field_list_has_icons:
- * @field: The field.
- *
- * Indicates if list field has icons.
- *
- * Returns: TRUE if list field has icons, FALSE otherwise.
- *
- * Since: 3.0.0
- */
-gboolean purple_request_field_list_has_icons(PurpleRequestField *field);
-
-/**************************************************************************/
-/* Label Field API                                                        */
-/**************************************************************************/
-
-/**
- * purple_request_field_label_new:
- * @id:   The field ID.
- * @text: The label of the field.
- *
- * Creates a label field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_label_new(const char *id,
-											   const char *text);
-
-/**************************************************************************/
-/* Image Field API                                                        */
-/**************************************************************************/
-
-/**
- * purple_request_field_image_new:
- * @id:   The field ID.
- * @text: The label of the field.
- * @buf:  The image data.
- * @size: The size of the data in @buf.
- *
- * Creates an image field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_image_new(const char *id, const char *text,
-											   const char *buf, gsize size);
-
-/**
- * purple_request_field_image_set_scale:
- * @field: The image field.
- * @x:     The x scale factor.
- * @y:     The y scale factor.
- *
- * Sets the scale factors of an image field.
- */
-void purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y);
-
-/**
- * purple_request_field_image_get_buffer:
- * @field: The image field.
- *
- * Returns pointer to the image.
- *
- * Returns: Pointer to the image.
- */
-const char *purple_request_field_image_get_buffer(PurpleRequestField *field);
-
-/**
- * purple_request_field_image_get_size:
- * @field: The image field.
- *
- * Returns size (in bytes) of the image.
- *
- * Returns: Size of the image.
- */
-gsize purple_request_field_image_get_size(PurpleRequestField *field);
-
-/**
- * purple_request_field_image_get_scale_x:
- * @field: The image field.
- *
- * Returns X scale coefficient of the image.
- *
- * Returns: X scale coefficient of the image.
- */
-unsigned int purple_request_field_image_get_scale_x(PurpleRequestField *field);
-
-/**
- * purple_request_field_image_get_scale_y:
- * @field: The image field.
- *
- * Returns Y scale coefficient of the image.
- *
- * Returns: Y scale coefficient of the image.
- */
-unsigned int purple_request_field_image_get_scale_y(PurpleRequestField *field);
-
-/**************************************************************************/
-/* Datasheet Field API                                                    */
-/**************************************************************************/
-
-/**
- * purple_request_field_datasheet_new:
- * @id:    The field ID.
- * @text:  The label of the field, may be %NULL.
- * @sheet: The datasheet.
- *
- * Creates a datasheet item field.
- *
- * Returns: (transfer full): The new field.
- */
-PurpleRequestField *purple_request_field_datasheet_new(const char *id,
-	const gchar *text, PurpleRequestDatasheet *sheet);
-
-/**
- * purple_request_field_datasheet_get_sheet:
- * @field: The field.
- *
- * Returns a datasheet for a field.
- *
- * Returns: (transfer none): The datasheet object.
- */
-PurpleRequestDatasheet *purple_request_field_datasheet_get_sheet(
-	PurpleRequestField *field);
-
-/**************************************************************************/
-/* Validators for request fields.                                         */
-/**************************************************************************/
-
-/**
- * purple_request_field_email_validator:
- * @field: The field.
- * @errmsg: (out) (optional): destination for error message.
- * @user_data: Ignored.
- *
- * Validates a field which should contain an email address.
- *
- * See purple_request_field_set_validator().
- *
- * Returns: TRUE, if field contains valid email address.
- */
-gboolean purple_request_field_email_validator(PurpleRequestField *field,
-	gchar **errmsg, void *user_data);
-
-/**
- * purple_request_field_alphanumeric_validator:
- * @field: The field.
- * @errmsg: (allow-none): destination for error message.
- * @allowed_characters: (allow-none): allowed character list
- *                      (NULL-terminated string).
- *
- * Validates a field which should contain alphanumeric content.
- *
- * See purple_request_field_set_validator().
- *
- * Returns: TRUE, if field contains only alphanumeric characters.
- */
-gboolean purple_request_field_alphanumeric_validator(PurpleRequestField *field,
-	gchar **errmsg, void *allowed_characters);
+GList *purple_request_field_choice_get_elements(PurpleRequestFieldChoice *field);
 
 G_END_DECLS
 
-#endif /* PURPLE_REQUEST_FIELD_H */
+#endif /* PURPLE_REQUEST_FIELD_CHOICE_H */
diff --git a/libpurple/purplerequestfield.c b/libpurple/purplerequestfield.c
--- a/libpurple/purplerequestfield.c
+++ b/libpurple/purplerequestfield.c
@@ -42,13 +42,6 @@ typedef struct {
 
 	union {
 		struct {
-			gpointer default_value;
-			gpointer value;
-
-			GList *elements;
-		} choice;
-
-		struct {
 			GList *items;
 			gboolean has_icons;
 			GHashTable *item_data;
@@ -213,10 +206,7 @@ purple_request_field_finalize(GObject *o
 	g_free(priv->type_hint);
 	g_free(priv->tooltip);
 
-	if(priv->type == PURPLE_REQUEST_FIELD_CHOICE) {
-		g_list_free_full(priv->u.choice.elements,
-		                 (GDestroyNotify)purple_key_value_pair_free);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_LIST) {
+	if(priv->type == PURPLE_REQUEST_FIELD_LIST) {
 		g_list_free_full(priv->u.list.items,
 		                 (GDestroyNotify)purple_key_value_pair_free);
 		g_list_free_full(priv->u.list.selected, g_free);
@@ -661,111 +651,6 @@ purple_request_field_is_sensitive(Purple
 }
 
 PurpleRequestField *
-purple_request_field_choice_new(const char *id, const char *text,
-	gpointer default_value)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_CHOICE);
-
-	purple_request_field_choice_set_default_value(field, default_value);
-	purple_request_field_choice_set_value(field, default_value);
-
-	return field;
-}
-
-void
-purple_request_field_choice_add(PurpleRequestField *field, const char *label,
-	gpointer value)
-{
-	purple_request_field_choice_add_full(field, label, value, NULL);
-}
-
-void
-purple_request_field_choice_add_full(PurpleRequestField *field, const char *label,
-                                     gpointer value, GDestroyNotify destroy)
-{
-	PurpleKeyValuePair *choice;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(label != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE);
-
-	choice = purple_key_value_pair_new_full(label, value, destroy);
-
-	priv->u.choice.elements = g_list_append(priv->u.choice.elements, choice);
-}
-
-void
-purple_request_field_choice_set_default_value(PurpleRequestField *field,
-	gpointer default_value)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE);
-
-	priv->u.choice.default_value = default_value;
-}
-
-void
-purple_request_field_choice_set_value(PurpleRequestField *field, gpointer value)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE);
-
-	priv->u.choice.value = value;
-}
-
-gpointer
-purple_request_field_choice_get_default_value(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE, NULL);
-
-	return priv->u.choice.default_value;
-}
-
-gpointer
-purple_request_field_choice_get_value(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE, NULL);
-
-	return priv->u.choice.value;
-}
-
-GList *
-purple_request_field_choice_get_elements(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE, NULL);
-
-	return priv->u.choice.elements;
-}
-
-PurpleRequestField *
 purple_request_field_list_new(const char *id, const char *text)
 {
 	PurpleRequestField *field;
diff --git a/libpurple/purplerequestfield.c b/libpurple/request/purplerequestfieldchoice.c
copy from libpurple/purplerequestfield.c
copy to libpurple/request/purplerequestfieldchoice.c
--- a/libpurple/purplerequestfield.c
+++ b/libpurple/request/purplerequestfieldchoice.c
@@ -22,140 +22,47 @@
 #include <glib/gi18n-lib.h>
 
 #include "glibcompat.h"
-#include "request.h"
-#include "request/purplerequestfieldstring.h"
-#include "debug.h"
+#include "purplerequestfield.h"
+#include "request/purplerequestfieldchoice.h"
 #include "purplekeyvaluepair.h"
-#include "purpleprivate.h"
-
-typedef struct {
-	PurpleRequestFieldType type;
-	PurpleRequestGroup *group;
-
-	char *id;
-	char *label;
-	char *type_hint;
-
-	gboolean visible;
-	gboolean required;
-	gboolean sensitive;
-
-	union {
-		struct {
-			gpointer default_value;
-			gpointer value;
-
-			GList *elements;
-		} choice;
 
-		struct {
-			GList *items;
-			gboolean has_icons;
-			GHashTable *item_data;
-			GList *selected;
-			GHashTable *selected_table;
-
-			gboolean multiple_selection;
-		} list;
+struct _PurpleRequestFieldChoice {
+	PurpleRequestField parent;
 
-		struct {
-			unsigned int scale_x;
-			unsigned int scale_y;
-			char *buffer;
-			gsize size;
-		} image;
+	gpointer default_value;
+	gpointer value;
 
-		struct {
-			PurpleRequestDatasheet *sheet;
-		} datasheet;
-	} u;
-
-	void *ui_data;
-	char *tooltip;
-
-	PurpleRequestFieldValidator validator;
-	void *validator_data;
-} PurpleRequestFieldPrivate;
+	GList *elements;
+};
 
 enum {
 	PROP_0,
-	PROP_ID,
-	PROP_LABEL,
-	PROP_VISIBLE,
-	PROP_SENSITIVE,
-	PROP_TYPE_HINT,
-	PROP_TOOLTIP,
-	PROP_REQUIRED,
-	PROP_IS_VALIDATABLE,
+	PROP_DEFAULT_VALUE,
+	PROP_VALUE,
 	N_PROPERTIES,
 };
 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
 
-G_DEFINE_TYPE_WITH_PRIVATE(PurpleRequestField, purple_request_field, G_TYPE_OBJECT)
-
-/******************************************************************************
- * Helpers
- *****************************************************************************/
-static void
-purple_request_field_set_id(PurpleRequestField *field, const char *id) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->id);
-	priv->id = g_strdup(id);
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_ID]);
-}
-
-static void
-purple_request_field_set_field_type(PurpleRequestField *field,
-                                    PurpleRequestFieldType type)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->type = type;
-}
-
 /******************************************************************************
  * GObject Implementation
  *****************************************************************************/
+G_DEFINE_TYPE(PurpleRequestFieldChoice, purple_request_field_choice,
+              PURPLE_TYPE_REQUEST_FIELD)
+
 static void
-purple_request_field_get_property(GObject *obj, guint param_id, GValue *value,
-                                  GParamSpec *pspec)
+purple_request_field_choice_get_property(GObject *obj, guint param_id,
+                                         GValue *value, GParamSpec *pspec)
 {
-	PurpleRequestField *field = PURPLE_REQUEST_FIELD(obj);
+	PurpleRequestFieldChoice *field = PURPLE_REQUEST_FIELD_CHOICE(obj);
 
 	switch(param_id) {
-		case PROP_ID:
-			g_value_set_string(value, purple_request_field_get_id(field));
-			break;
-		case PROP_LABEL:
-			g_value_set_string(value, purple_request_field_get_label(field));
-			break;
-		case PROP_VISIBLE:
-			g_value_set_boolean(value, purple_request_field_is_visible(field));
-			break;
-		case PROP_SENSITIVE:
-			g_value_set_boolean(value,
-			                    purple_request_field_is_sensitive(field));
+		case PROP_DEFAULT_VALUE:
+			g_value_set_pointer(value,
+			                    purple_request_field_choice_get_default_value(field));
 			break;
-		case PROP_TYPE_HINT:
-			g_value_set_string(value,
-			                   purple_request_field_get_type_hint(field));
-			break;
-		case PROP_TOOLTIP:
-			g_value_set_string(value, purple_request_field_get_tooltip(field));
-			break;
-		case PROP_REQUIRED:
-			g_value_set_boolean(value,
-			                    purple_request_field_is_required(field));
-			break;
-		case PROP_IS_VALIDATABLE:
-			g_value_set_boolean(value,
-			                    purple_request_field_is_validatable(field));
+		case PROP_VALUE:
+			g_value_set_pointer(value,
+			                    purple_request_field_choice_get_value(field));
 			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -164,36 +71,19 @@ purple_request_field_get_property(GObjec
 }
 
 static void
-purple_request_field_set_property(GObject *obj, guint param_id,
-                                  const GValue *value, GParamSpec *pspec)
+purple_request_field_choice_set_property(GObject *obj, guint param_id,
+                                         const GValue *value, GParamSpec *pspec)
 {
-	PurpleRequestField *field = PURPLE_REQUEST_FIELD(obj);
+	PurpleRequestFieldChoice *field = PURPLE_REQUEST_FIELD_CHOICE(obj);
 
 	switch(param_id) {
-		case PROP_ID:
-			purple_request_field_set_id(field, g_value_get_string(value));
-			break;
-		case PROP_LABEL:
-			purple_request_field_set_label(field, g_value_get_string(value));
-			break;
-		case PROP_VISIBLE:
-			purple_request_field_set_visible(field,
-			                                 g_value_get_boolean(value));
+		case PROP_DEFAULT_VALUE:
+			purple_request_field_choice_set_default_value(field,
+			                                              g_value_get_pointer(value));
 			break;
-		case PROP_SENSITIVE:
-			purple_request_field_set_sensitive(field,
-			                                   g_value_get_boolean(value));
-			break;
-		case PROP_TYPE_HINT:
-			purple_request_field_set_type_hint(field,
-			                                   g_value_get_string(value));
-			break;
-		case PROP_TOOLTIP:
-			purple_request_field_set_tooltip(field, g_value_get_string(value));
-			break;
-		case PROP_REQUIRED:
-			purple_request_field_set_required(field,
-			                                  g_value_get_boolean(value));
+		case PROP_VALUE:
+			purple_request_field_choice_set_value(field,
+			                                      g_value_get_pointer(value));
 			break;
 		default:
 			G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
@@ -202,157 +92,51 @@ purple_request_field_set_property(GObjec
 }
 
 static void
-purple_request_field_finalize(GObject *obj) {
-	PurpleRequestField *field = PURPLE_REQUEST_FIELD(obj);
-	PurpleRequestFieldPrivate *priv = NULL;
+purple_request_field_choice_finalize(GObject *obj) {
+	PurpleRequestFieldChoice *field = PURPLE_REQUEST_FIELD_CHOICE(obj);
 
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->id);
-	g_free(priv->label);
-	g_free(priv->type_hint);
-	g_free(priv->tooltip);
+	g_list_free_full(field->elements,
+	                 (GDestroyNotify)purple_key_value_pair_free);
 
-	if(priv->type == PURPLE_REQUEST_FIELD_CHOICE) {
-		g_list_free_full(priv->u.choice.elements,
-		                 (GDestroyNotify)purple_key_value_pair_free);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_LIST) {
-		g_list_free_full(priv->u.list.items,
-		                 (GDestroyNotify)purple_key_value_pair_free);
-		g_list_free_full(priv->u.list.selected, g_free);
-		g_hash_table_destroy(priv->u.list.item_data);
-		g_hash_table_destroy(priv->u.list.selected_table);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_DATASHEET) {
-		purple_request_datasheet_free(priv->u.datasheet.sheet);
-	} else if(priv->type == PURPLE_REQUEST_FIELD_IMAGE) {
-		g_free(priv->u.image.buffer);
-	}
+	G_OBJECT_CLASS(purple_request_field_choice_parent_class)->finalize(obj);
+}
 
-	G_OBJECT_CLASS(purple_request_field_parent_class)->finalize(obj);
+static void
+purple_request_field_choice_init(G_GNUC_UNUSED PurpleRequestFieldChoice *field) {
 }
 
 static void
-purple_request_field_init(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->visible = TRUE;
-	priv->sensitive = TRUE;
-}
-
-static void
-purple_request_field_class_init(PurpleRequestFieldClass *klass) {
+purple_request_field_choice_class_init(PurpleRequestFieldChoiceClass *klass) {
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
 
-	obj_class->finalize = purple_request_field_finalize;
-	obj_class->get_property = purple_request_field_get_property;
-	obj_class->set_property = purple_request_field_set_property;
+	obj_class->finalize = purple_request_field_choice_finalize;
+	obj_class->get_property = purple_request_field_choice_get_property;
+	obj_class->set_property = purple_request_field_choice_set_property;
 
 	/**
-	 * PurpleRequestField:id:
+	 * PurpleRequestFieldChoice:default-value:
 	 *
-	 * The ID of the field.
+	 * The default value of the field.
 	 *
 	 * Since: 3.0.0
 	 */
-	properties[PROP_ID] = g_param_spec_string(
-		"id", "id",
-		"The ID of the field.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:label:
-	 *
-	 * The label of the field.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_LABEL] = g_param_spec_string(
-		"label", "label",
-		"The label of the field.",
-		NULL,
+	properties[PROP_DEFAULT_VALUE] = g_param_spec_pointer(
+		"default-value", "default-value",
+		"The default value of the field.",
 		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
 	/**
-	 * PurpleRequestField:visible:
-	 *
-	 * Whether the field should be visible.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_VISIBLE] = g_param_spec_boolean(
-		"visible", "visible",
-		"Whether the field should be visible.",
-		TRUE,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:sensitive:
+	 * PurpleRequestFieldChoice:value:
 	 *
-	 * Whether the field should be sensitive.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_SENSITIVE] = g_param_spec_boolean(
-		"sensitive", "sensitive",
-		"Whether the field should be sensitive.",
-		TRUE,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:type-hint:
-	 *
-	 * The type hint of the field.
+	 * The value of the field.
 	 *
 	 * Since: 3.0.0
 	 */
-	properties[PROP_TYPE_HINT] = g_param_spec_string(
-		"type-hint", "type-hint",
-		"The type hint of the field.",
-		NULL,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:tooltip:
-	 *
-	 * The tooltip of the field.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_TOOLTIP] = g_param_spec_string(
-		"tooltip", "tooltip",
-		"The tooltip of the field.",
-		NULL,
+	properties[PROP_VALUE] = g_param_spec_pointer(
+		"value", "value",
+		"The value of the field.",
 		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
-	/**
-	 * PurpleRequestField:required:
-	 *
-	 * Whether the field is required to complete the request.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_REQUIRED] = g_param_spec_boolean(
-		"required", "required",
-		"Whether the field is required to complete the request.",
-		FALSE,
-		G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
-	/**
-	 * PurpleRequestField:is-validatable:
-	 *
-	 * Whether the field can be validated by the requestor.
-	 *
-	 * Since: 3.0.0
-	 */
-	properties[PROP_IS_VALIDATABLE] = g_param_spec_boolean(
-		"is-validatable", "is-validatable",
-		"Whether the field can be validated by the requestor.",
-		FALSE,
-		G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
-
 	g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
 }
 
@@ -360,746 +144,89 @@ purple_request_field_class_init(PurpleRe
  * Public API
  *****************************************************************************/
 PurpleRequestField *
-purple_request_field_new(const char *id, const char *text,
-                         PurpleRequestFieldType type)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id != NULL, NULL);
-	g_return_val_if_fail(type != PURPLE_REQUEST_FIELD_NONE, NULL);
-
-	field = g_object_new(PURPLE_TYPE_REQUEST_FIELD,
-	                     "id", id,
-	                     "label", text,
-	                     NULL);
-	purple_request_field_set_field_type(field, type);
-
-	return field;
-}
-
-void
-_purple_request_field_set_group(PurpleRequestField *field,
-                                PurpleRequestGroup *group)
+purple_request_field_choice_new(const char *id, const char *text,
+                                gpointer default_value)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->group = group;
-}
-
-void
-purple_request_field_set_label(PurpleRequestField *field, const char *label)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->label);
-	priv->label = g_strdup(label);
+	g_return_val_if_fail(id   != NULL, NULL);
+	g_return_val_if_fail(text != NULL, NULL);
 
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_LABEL]);
-}
-
-void
-purple_request_field_set_visible(PurpleRequestField *field, gboolean visible)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->visible = visible;
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_VISIBLE]);
-}
-
-void
-purple_request_field_set_type_hint(PurpleRequestField *field,
-								 const char *type_hint)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->type_hint);
-	priv->type_hint = g_strdup(type_hint);
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_TYPE_HINT]);
-}
-
-void
-purple_request_field_set_tooltip(PurpleRequestField *field, const char *tooltip)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	g_free(priv->tooltip);
-	priv->tooltip = g_strdup(tooltip);
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_TOOLTIP]);
+	return g_object_new(PURPLE_TYPE_REQUEST_FIELD_CHOICE,
+	                    "id", id,
+	                    "label", text,
+	                    "default-value", default_value,
+	                    "value", default_value,
+	                    NULL);
 }
 
 void
-purple_request_field_set_required(PurpleRequestField *field, gboolean required)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	if(priv->required == required) {
-		return;
-	}
-
-	priv->required = required;
-
-	if(PURPLE_IS_REQUEST_GROUP(priv->group)) {
-		_purple_request_group_set_field_required(priv->group, field,
-		                                         required);
-	}
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_REQUIRED]);
-}
-
-PurpleRequestFieldType
-purple_request_field_get_field_type(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field),
-	                     PURPLE_REQUEST_FIELD_NONE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->type;
-}
-
-PurpleRequestGroup *
-purple_request_field_get_group(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->group;
-}
-
-const char *
-purple_request_field_get_id(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->id;
-}
-
-const char *
-purple_request_field_get_label(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->label;
-}
-
-gboolean
-purple_request_field_is_visible(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->visible;
-}
-
-const char *
-purple_request_field_get_type_hint(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->type_hint;
-}
-
-const char *
-purple_request_field_get_tooltip(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->tooltip;
-}
-
-gboolean
-purple_request_field_is_required(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->required;
-}
-
-gboolean
-purple_request_field_is_filled(PurpleRequestField *field) {
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	if(PURPLE_IS_REQUEST_FIELD_STRING(field)) {
-		PurpleRequestFieldString *sfield = PURPLE_REQUEST_FIELD_STRING(field);
-		return !purple_strempty(purple_request_field_string_get_value(sfield));
-	}
-
-	return TRUE;
-}
-
-void
-purple_request_field_set_validator(PurpleRequestField *field,
-	PurpleRequestFieldValidator validator, void *user_data)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->validator = validator;
-	priv->validator_data = validator ? user_data : NULL;
-
-	if(PURPLE_IS_REQUEST_GROUP(priv->group)) {
-		_purple_request_group_set_field_validator(priv->group, field,
-		                                          validator != NULL);
-	}
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_IS_VALIDATABLE]);
-}
-
-gboolean
-purple_request_field_is_validatable(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->validator != NULL;
-}
-
-gboolean
-purple_request_field_is_valid(PurpleRequestField *field, gchar **errmsg)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-	gboolean valid;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	if(!priv->validator) {
-		return TRUE;
-	}
-
-	if (!purple_request_field_is_required(field) &&
-		!purple_request_field_is_filled(field))
-		return TRUE;
-
-	valid = priv->validator(field, errmsg, priv->validator_data);
-
-	if (valid && errmsg)
-		*errmsg = NULL;
-
-	return valid;
-}
-
-void
-purple_request_field_set_sensitive(PurpleRequestField *field,
-	gboolean sensitive)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->sensitive = sensitive;
-
-	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_SENSITIVE]);
-}
-
-gboolean
-purple_request_field_is_sensitive(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-
-	return priv->sensitive;
-}
-
-PurpleRequestField *
-purple_request_field_choice_new(const char *id, const char *text,
-	gpointer default_value)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_CHOICE);
-
-	purple_request_field_choice_set_default_value(field, default_value);
-	purple_request_field_choice_set_value(field, default_value);
-
-	return field;
-}
-
-void
-purple_request_field_choice_add(PurpleRequestField *field, const char *label,
-	gpointer value)
+purple_request_field_choice_add(PurpleRequestFieldChoice *field,
+                                const char *label, gpointer value)
 {
 	purple_request_field_choice_add_full(field, label, value, NULL);
 }
 
 void
-purple_request_field_choice_add_full(PurpleRequestField *field, const char *label,
-                                     gpointer value, GDestroyNotify destroy)
+purple_request_field_choice_add_full(PurpleRequestFieldChoice *field,
+                                     const char *label, gpointer value,
+                                     GDestroyNotify destroy)
 {
 	PurpleKeyValuePair *choice;
-	PurpleRequestFieldPrivate *priv = NULL;
 
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_CHOICE(field));
 	g_return_if_fail(label != NULL);
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE);
-
 	choice = purple_key_value_pair_new_full(label, value, destroy);
 
-	priv->u.choice.elements = g_list_append(priv->u.choice.elements, choice);
-}
-
-void
-purple_request_field_choice_set_default_value(PurpleRequestField *field,
-	gpointer default_value)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE);
-
-	priv->u.choice.default_value = default_value;
-}
-
-void
-purple_request_field_choice_set_value(PurpleRequestField *field, gpointer value)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE);
-
-	priv->u.choice.value = value;
-}
-
-gpointer
-purple_request_field_choice_get_default_value(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE, NULL);
-
-	return priv->u.choice.default_value;
-}
-
-gpointer
-purple_request_field_choice_get_value(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE, NULL);
-
-	return priv->u.choice.value;
-}
-
-GList *
-purple_request_field_choice_get_elements(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_CHOICE, NULL);
-
-	return priv->u.choice.elements;
-}
-
-PurpleRequestField *
-purple_request_field_list_new(const char *id, const char *text)
-{
-	PurpleRequestField *field;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_LIST);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.list.item_data = g_hash_table_new_full(g_str_hash, g_str_equal,
-	                                               g_free, NULL);
-
-	priv->u.list.selected_table = g_hash_table_new_full(g_str_hash, g_str_equal,
-	                                                    g_free, NULL);
-
-	return field;
+	field->elements = g_list_append(field->elements, choice);
 }
 
 void
-purple_request_field_list_set_multi_select(PurpleRequestField *field,
-										 gboolean multi_select)
+purple_request_field_choice_set_default_value(PurpleRequestFieldChoice *field,
+                                              gpointer default_value)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	priv->u.list.multiple_selection = multi_select;
-}
-
-gboolean
-purple_request_field_list_get_multi_select(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return priv->u.list.multiple_selection;
-}
-
-void *
-purple_request_field_list_get_data(PurpleRequestField *field, const char *text)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-	g_return_val_if_fail(text  != NULL, NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return g_hash_table_lookup(priv->u.list.item_data, text);
-}
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_CHOICE(field));
 
-void
-purple_request_field_list_add_icon(PurpleRequestField *field, const char *item, const char* icon_path,
-							void *data)
-{
-	PurpleKeyValuePair *kvp;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(item  != NULL);
-	g_return_if_fail(data  != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	priv->u.list.has_icons = priv->u.list.has_icons || (icon_path != NULL);
-	kvp = purple_key_value_pair_new_full(item, g_strdup(icon_path), g_free);
-	priv->u.list.items = g_list_append(priv->u.list.items, kvp);
-	g_hash_table_insert(priv->u.list.item_data, g_strdup(item), data);
-}
-
-void
-purple_request_field_list_add_selected(PurpleRequestField *field, const char *item)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(item  != NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	if(!purple_request_field_list_get_multi_select(field) &&
-	   priv->u.list.selected != NULL)
-	{
-		purple_debug_warning("request",
-						   "More than one item added to non-multi-select "
-						   "field %s\n",
-						   purple_request_field_get_id(field));
+	if(field->default_value == default_value) {
 		return;
 	}
 
-	priv->u.list.selected = g_list_append(priv->u.list.selected,
-	                                      g_strdup(item));
-
-	g_hash_table_add(priv->u.list.selected_table, g_strdup(item));
-}
-
-void
-purple_request_field_list_clear_selected(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
+	field->default_value = default_value;
 
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	if(priv->u.list.selected != NULL) {
-		g_list_free_full(priv->u.list.selected, g_free);
-		priv->u.list.selected = NULL;
-	}
-
-	g_hash_table_remove_all(priv->u.list.selected_table);
+	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_DEFAULT_VALUE]);
 }
 
 void
-purple_request_field_list_set_selected(PurpleRequestField *field, GList *items)
+purple_request_field_choice_set_value(PurpleRequestFieldChoice *field,
+                                      gpointer value)
 {
-	PurpleRequestFieldPrivate *priv = NULL;
-	GList *l;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-	g_return_if_fail(items != NULL);
+	g_return_if_fail(PURPLE_IS_REQUEST_FIELD_CHOICE(field));
 
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST);
-
-	purple_request_field_list_clear_selected(field);
-
-	if (!purple_request_field_list_get_multi_select(field) && items->next) {
-		purple_debug_warning("request",
-						   "More than one item added to non-multi-select "
-						   "field %s\n",
-						   purple_request_field_get_id(field));
+	if(field->value == value) {
 		return;
 	}
 
-	for (l = items; l != NULL; l = l->next) {
-		char *selected = l->data;
-		priv->u.list.selected = g_list_append(priv->u.list.selected,
-		                                      g_strdup(selected));
-		g_hash_table_add(priv->u.list.selected_table, g_strdup(selected));
-	}
+	field->value = value;
+
+	g_object_notify_by_pspec(G_OBJECT(field), properties[PROP_VALUE]);
 }
 
-gboolean
-purple_request_field_list_is_selected(PurpleRequestField *field,
-                                      const char *item)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
+gpointer
+purple_request_field_choice_get_default_value(PurpleRequestFieldChoice *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_CHOICE(field), NULL);
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-	g_return_val_if_fail(item  != NULL, FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return g_hash_table_contains(priv->u.list.selected_table, item);
+	return field->default_value;
 }
 
-GList *
-purple_request_field_list_get_selected(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
+gpointer
+purple_request_field_choice_get_value(PurpleRequestFieldChoice *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_CHOICE(field), NULL);
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return priv->u.list.selected;
+	return field->value;
 }
 
 GList *
-purple_request_field_list_get_items(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, NULL);
-
-	return priv->u.list.items;
-}
-
-gboolean
-purple_request_field_list_has_icons(PurpleRequestField *field) {
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), FALSE);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_LIST, FALSE);
-
-	return priv->u.list.has_icons;
-}
-
-PurpleRequestField *
-purple_request_field_label_new(const char *id, const char *text)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_LABEL);
-
-	return field;
-}
-
-PurpleRequestField *
-purple_request_field_image_new(const char *id, const char *text, const char *buf, gsize size)
-{
-	PurpleRequestField *field;
-
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-	g_return_val_if_fail(buf  != NULL, NULL);
-	g_return_val_if_fail(size > 0, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_IMAGE);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.image.buffer = g_memdup2(buf, size);
-	priv->u.image.size = size;
-	priv->u.image.scale_x = 1;
-	priv->u.image.scale_y = 1;
-
-	return field;
-}
-
-void
-purple_request_field_image_set_scale(PurpleRequestField *field, unsigned int x, unsigned int y)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_if_fail(PURPLE_IS_REQUEST_FIELD(field));
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE);
-
-	priv->u.image.scale_x = x;
-	priv->u.image.scale_y = y;
-}
-
-const char *
-purple_request_field_image_get_buffer(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
+purple_request_field_choice_get_elements(PurpleRequestFieldChoice *field) {
+	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD_CHOICE(field), NULL);
 
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, NULL);
-
-	return priv->u.image.buffer;
-}
-
-gsize
-purple_request_field_image_get_size(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), 0);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, 0);
-
-	return priv->u.image.size;
-}
-
-unsigned int
-purple_request_field_image_get_scale_x(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), 0);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, 0);
-
-	return priv->u.image.scale_x;
+	return field->elements;
 }
-
-unsigned int
-purple_request_field_image_get_scale_y(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), 0);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_IMAGE, 0);
-
-	return priv->u.image.scale_y;
-}
-
-PurpleRequestField *
-purple_request_field_datasheet_new(const char *id,
-	const gchar *text, PurpleRequestDatasheet *sheet)
-{
-	PurpleRequestField *field;
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(id != NULL, NULL);
-	g_return_val_if_fail(sheet != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_DATASHEET);
-	priv = purple_request_field_get_instance_private(field);
-
-	priv->u.datasheet.sheet = sheet;
-
-	return field;
-}
-
-PurpleRequestDatasheet *
-purple_request_field_datasheet_get_sheet(PurpleRequestField *field)
-{
-	PurpleRequestFieldPrivate *priv = NULL;
-
-	g_return_val_if_fail(PURPLE_IS_REQUEST_FIELD(field), NULL);
-
-	priv = purple_request_field_get_instance_private(field);
-	g_return_val_if_fail(priv->type == PURPLE_REQUEST_FIELD_DATASHEET, NULL);
-
-	return priv->u.datasheet.sheet;
-}
diff --git a/libpurple/purplerequestpage.c b/libpurple/purplerequestpage.c
--- a/libpurple/purplerequestpage.c
+++ b/libpurple/purplerequestpage.c
@@ -25,6 +25,7 @@
 #include "purplerequestpage.h"
 #include "request/purplerequestfieldaccount.h"
 #include "request/purplerequestfieldbool.h"
+#include "request/purplerequestfieldchoice.h"
 #include "request/purplerequestfieldint.h"
 #include "request/purplerequestfieldstring.h"
 #include "purpleprivate.h"
@@ -344,11 +345,12 @@ purple_request_page_get_choice(PurpleReq
 	g_return_val_if_fail(PURPLE_IS_REQUEST_PAGE(page), NULL);
 	g_return_val_if_fail(id != NULL, NULL);
 
-	if((field = purple_request_page_get_field(page, id)) == NULL) {
+	field = purple_request_page_get_field(page, id);
+	if(!PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
 		return NULL;
 	}
 
-	return purple_request_field_choice_get_value(field);
+	return purple_request_field_choice_get_value(PURPLE_REQUEST_FIELD_CHOICE(field));
 }
 
 PurpleAccount *
diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -257,7 +257,8 @@ field_choice_option_cb(GObject *obj, G_G
 
 	if(G_IS_OBJECT(item)) {
 		gpointer value = g_object_get_data(item, "choice_value");
-		purple_request_field_choice_set_value(field, value);
+		purple_request_field_choice_set_value(PURPLE_REQUEST_FIELD_CHOICE(field),
+		                                      value);
 	}
 }
 
@@ -1243,6 +1244,7 @@ create_bool_field(PurpleRequestField *fi
 
 static GtkWidget *
 create_choice_field(PurpleRequestField *field) {
+	PurpleRequestFieldChoice *choicefield = PURPLE_REQUEST_FIELD_CHOICE(field);
 	GtkWidget *widget;
 	GListModel *model = NULL;
 	GList *elements = NULL;
@@ -1250,12 +1252,12 @@ create_choice_field(PurpleRequestField *
 	gpointer default_value;
 	guint index;
 
-	default_value = purple_request_field_choice_get_value(field);
+	default_value = purple_request_field_choice_get_value(choicefield);
 	widget = gtk_drop_down_new_from_strings(NULL);
 	model = gtk_drop_down_get_model(GTK_DROP_DOWN(widget));
 
 	index = 0;
-	elements = purple_request_field_choice_get_elements(field);
+	elements = purple_request_field_choice_get_elements(choicefield);
 	for(GList *l = elements; l != NULL; l = g_list_next(l)) {
 		PurpleKeyValuePair *choice = l->data;
 		GObject *item = NULL;
@@ -1281,7 +1283,7 @@ create_choice_field(PurpleRequestField *
 	if(default_index == GTK_INVALID_LIST_POSITION && index > 0) {
 		GObject *item = g_list_model_get_item(model, 0);
 		gpointer value = g_object_get_data(item, "choice_value");
-		purple_request_field_choice_set_value(field, value);
+		purple_request_field_choice_set_value(choicefield, value);
 		g_clear_object(&item);
 	}
 
@@ -2150,9 +2152,9 @@ pidgin_request_fields(const char *title,
 						widget = create_int_field(field);
 					} else if(PURPLE_IS_REQUEST_FIELD_BOOL(field)) {
 						widget = create_bool_field(field, cpar);
-					} else if (type == PURPLE_REQUEST_FIELD_CHOICE)
+					} else if(PURPLE_IS_REQUEST_FIELD_CHOICE(field)) {
 						widget = create_choice_field(field);
-					else if (type == PURPLE_REQUEST_FIELD_LIST)
+					} else if (type == PURPLE_REQUEST_FIELD_LIST)
 						widget = create_list_field(field);
 					else if (type == PURPLE_REQUEST_FIELD_IMAGE)
 						widget = create_image_field(field);
