3 * Pidgin is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
27 #define PREF_ROOT "/plugins"
28 #define PREF_TEST "/plugins/tests"
29 #define PREF_PREFIX "/plugins/tests/request-input"
30 #define PREF_SINGLE PREF_PREFIX "/single"
31 #define PREF_MULTIPLE PREF_PREFIX "/multiple"
32 #define PREF_HTML PREF_PREFIX "/html"
35 plugin_input_callback(const gchar
*pref
, const gchar
*text
) {
36 purple_prefs_set_string(pref
, text
);
40 plugin_input_single(PurplePluginAction
*action
) {
43 _("Test request input single"),
44 _("Test request input single"),
46 purple_prefs_get_string(PREF_SINGLE
),
51 PURPLE_CALLBACK(plugin_input_callback
),
54 purple_request_cpar_new(),
60 plugin_input_multiple(PurplePluginAction
*action
) {
63 _("Test request input multiple"),
64 _("Test request input multiple"),
66 purple_prefs_get_string(PREF_MULTIPLE
),
71 PURPLE_CALLBACK(plugin_input_callback
),
74 purple_request_cpar_new(),
80 plugin_input_html(PurplePluginAction
*action
) {
83 _("Test request input HTML"),
84 _("Test request input HTML"),
86 purple_prefs_get_string(PREF_HTML
),
91 PURPLE_CALLBACK(plugin_input_callback
),
94 purple_request_cpar_new(),
100 plugin_actions(PurplePlugin
*plugin
) {
102 PurplePluginAction
*action
= NULL
;
104 action
= purple_plugin_action_new(_("Input single"), plugin_input_single
);
105 l
= g_list_append(l
, action
);
107 action
= purple_plugin_action_new(_("Input multiple"), plugin_input_multiple
);
108 l
= g_list_append(l
, action
);
110 action
= purple_plugin_action_new(_("Input html"), plugin_input_html
);
111 l
= g_list_append(l
, action
);
116 static PurplePluginInfo
*
117 plugin_query(GError
**error
) {
118 const gchar
* const authors
[] = {
119 "Gary Kramlich <grim@reaperworld.com>",
123 return purple_plugin_info_new(
124 "id", "core-test_request_input",
125 "name", N_("Test: request input"),
126 "version", DISPLAY_VERSION
,
127 "category", N_("Testing"),
128 "summary", N_("Test Request Input"),
129 "description", N_("This plugin adds actions to test purple_request_input"),
131 "website", "https://pidgin.im",
132 "abi-version", PURPLE_ABI_VERSION
,
133 "actions-cb", plugin_actions
,
139 plugin_load(PurplePlugin
*plugin
, GError
**error
) {
140 purple_prefs_add_none(PREF_ROOT
);
141 purple_prefs_add_none(PREF_TEST
);
142 purple_prefs_add_none(PREF_PREFIX
);
143 purple_prefs_add_string(PREF_SINGLE
, "");
144 purple_prefs_add_string(PREF_MULTIPLE
, "");
145 purple_prefs_add_string(PREF_HTML
, "");
151 plugin_unload(PurplePlugin
*plugin
, GError
**error
) {
155 PURPLE_PLUGIN_INIT(test_request_input
, plugin_query
, plugin_load
, plugin_unload
);