libpurple/cmds.h

Sun, 10 Oct 2021 02:52:05 -0500

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Sun, 10 Oct 2021 02:52:05 -0500
changeset 41083
590d533cf290
parent 41010
d0abbb616bea
child 41200
92a47aa620cf
permissions
-rw-r--r--

Fix several typos in libpurple

Ran `codespell -w`, ignoring some stuff, or making things better.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/1016/

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 19859
diff changeset
1 /* Copyright (C) 2003 Timothy Ringenbach <omarvo@hotmail.com>
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
3 * This program is free software; you can redistribute it and/or modify
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 * it under the terms of the GNU General Public License as published by
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 * the Free Software Foundation; either version 2 of the License, or
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
6 * (at your option) any later version.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
7 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
8 * This program is distributed in the hope that it will be useful,
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * GNU General Public License for more details.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * You should have received a copy of the GNU General Public License
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 15884
diff changeset
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
18
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40230
diff changeset
19 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40230
diff changeset
20 # error "only <purple.h> may be included directly"
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40230
diff changeset
21 #endif
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40230
diff changeset
22
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
23 #ifndef PURPLE_CMDS_H
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
24 #define PURPLE_CMDS_H
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
25
35433
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35419
diff changeset
26 /**
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35419
diff changeset
27 * SECTION:cmds
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35419
diff changeset
28 * @section_id: libpurple-cmds
35436
a69d2e5604c5 Swap @title and @short_description roles
Ankit Vani <a@nevitus.org>
parents: 35433
diff changeset
29 * @short_description: <filename>cmds.h</filename>
a69d2e5604c5 Swap @title and @short_description roles
Ankit Vani <a@nevitus.org>
parents: 35433
diff changeset
30 * @title: Commands API
35433
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35419
diff changeset
31 * @see_also: <link linkend="chapter-signals-cmd">Command signals</link>
8dcae6cd6628 Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents: 35419
diff changeset
32 */
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
33
40853
d3518ff99fa7 rename conversation.[ch] to purpleconversation.[ch] and split PurpleConversationUiOps out to its own file to avoid circular include issues.
Gary Kramlich <grim@reaperworld.com>
parents: 40474
diff changeset
34 #include <purpleconversation.h>
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
36 /******************************************************************************
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
37 * Structures
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
38 *****************************************************************************/
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
40 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
41 * PurpleCmdStatus:
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
42 * @PURPLE_CMD_STATUS_OK: The command executed successfully.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
43 * @PURPLE_CMD_STATUS_FAILED: The command failed to execute.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
44 * @PURPLE_CMD_STATUS_NOT_FOUND: The command was not found.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
45 * @PURPLE_CMD_STATUS_WRONG_ARGS: The wrong number of arguments were passed.
39863
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
46 * @PURPLE_CMD_STATUS_WRONG_PROTOCOL: The command was run with the wrong
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
47 * protocol.
39863
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
48 * @PURPLE_CMD_STATUS_WRONG_TYPE: The Command was ran against the wrong type of
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
49 * conversation.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
50 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
51 * The possible results of running a command with purple_cmd_do_command().
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
52 */
32206
a2c62b07ae5a Please correct me if I'm wrong, but I don't think we gain anything
Mark Doliner <markdoliner@pidgin.im>
parents: 25105
diff changeset
53 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
54 PURPLE_CMD_STATUS_OK,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
55 PURPLE_CMD_STATUS_FAILED,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
56 PURPLE_CMD_STATUS_NOT_FOUND,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
57 PURPLE_CMD_STATUS_WRONG_ARGS,
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
58 PURPLE_CMD_STATUS_WRONG_PROTOCOL,
25105
fe13c190ca13 Remove the commas at the end of enumerator lists. This resolves warnings
Florian Quèze <florian@instantbird.org>
parents: 23555
diff changeset
59 PURPLE_CMD_STATUS_WRONG_TYPE
22051
61dc80506e49 C++ doesn't really allow forward declarations of enums, and we
Mark Doliner <markdoliner@pidgin.im>
parents: 20370
diff changeset
60 } PurpleCmdStatus;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
61
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
62 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
63 * PurpleCmdRet:
39863
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
64 * @PURPLE_CMD_RET_OK: Everything's okay; Don't look for another command to
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
65 * call.
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
66 * @PURPLE_CMD_RET_FAILED: The command failed, but stop looking.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
67 * @PURPLE_CMD_RET_CONTINUE: Continue, looking for other commands with the same
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
68 * name to call.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
69 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
70 * Commands registered with the core return one of these values when run.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
71 * Normally, a command will want to return one of the first two; in some
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
72 * unusual cases, you might want to have several functions called for a
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
73 * particular command; in this case, they should return
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
74 * #PURPLE_CMD_RET_CONTINUE to cause the core to fall through to other
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
75 * commands with the same name.
23510
d4f5493b1c26 Document a few types in cmds, partly to make doxygen links to those types work.
Will Thompson <resiak@pidgin.im>
parents: 23420
diff changeset
76 */
32206
a2c62b07ae5a Please correct me if I'm wrong, but I don't think we gain anything
Mark Doliner <markdoliner@pidgin.im>
parents: 25105
diff changeset
77 typedef enum {
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
78 PURPLE_CMD_RET_OK,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
79 PURPLE_CMD_RET_FAILED,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
80 PURPLE_CMD_RET_CONTINUE
22051
61dc80506e49 C++ doesn't really allow forward declarations of enums, and we
Mark Doliner <markdoliner@pidgin.im>
parents: 20370
diff changeset
81 } PurpleCmdRet;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
82
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
83 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
84 * PurpleCmdFunc:
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
85 * @conversation: The #PurpleConversation where the command is being run.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
86 * @cmd: The name of the command.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
87 * @args: The arguments to the command.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
88 * @error: (out): A return address for a #GError.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
89 * @data: User data to pass to the function.
23510
d4f5493b1c26 Document a few types in cmds, partly to make doxygen links to those types work.
Will Thompson <resiak@pidgin.im>
parents: 23420
diff changeset
90 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
91 * A function implementing a command, as passed to purple_cmd_register().
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
92 */
38745
f4376b1f4682 A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 38716
diff changeset
93 typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *conversation, const gchar *cmd,
9597
c6f672b593cb [gaim-migrate @ 10440]
Tim Ringenbach <marv@pidgin.im>
parents: 9343
diff changeset
94 gchar **args, gchar **error, void *data);
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
95 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
96 * PurpleCmdId:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
97 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
98 * A unique integer representing a command registered with
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
99 * purple_cmd_register(), which can subsequently be passed to
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
100 * purple_cmd_unregister() to unregister that command.
23510
d4f5493b1c26 Document a few types in cmds, partly to make doxygen links to those types work.
Will Thompson <resiak@pidgin.im>
parents: 23420
diff changeset
101 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
102 typedef guint PurpleCmdId;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
103
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
104 /**
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
105 * PurpleCmdPriority:
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
106 * @PURPLE_CMD_P_VERY_LOW: Lowest priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
107 * @PURPLE_CMD_P_LOW: Low priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
108 * @PURPLE_CMD_P_DEFAULT: Default priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
109 * @PURPLE_CMD_P_PROTOCOL: Priority for protocol plugins.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
110 * @PURPLE_CMD_P_PLUGIN: Priority for plugins.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
111 * @PURPLE_CMD_P_ALIAS: Priority for aliasing commands.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
112 * @PURPLE_CMD_P_HIGH: High priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
113 * @PURPLE_CMD_P_VERY_HIGH: Highest priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
114 *
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
115 * Commands are registered from multiple locations which leads to name
39863
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
116 * collisions. PurpleCmdPriority is used to determine which command will be
60a4930ea197 Fix some doc comments and move the comment about purple_timeout_reset to it's new home
Gary Kramlich <grim@reaperworld.com>
parents: 39862
diff changeset
117 * run.
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
118 */
32206
a2c62b07ae5a Please correct me if I'm wrong, but I don't think we gain anything
Mark Doliner <markdoliner@pidgin.im>
parents: 25105
diff changeset
119 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
120 PURPLE_CMD_P_VERY_LOW = -1000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
121 PURPLE_CMD_P_LOW = 0,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
122 PURPLE_CMD_P_DEFAULT = 1000,
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
123 PURPLE_CMD_P_PROTOCOL = 2000,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
124 PURPLE_CMD_P_PLUGIN = 3000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
125 PURPLE_CMD_P_ALIAS = 4000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
126 PURPLE_CMD_P_HIGH = 5000,
25105
fe13c190ca13 Remove the commas at the end of enumerator lists. This resolves warnings
Florian Quèze <florian@instantbird.org>
parents: 23555
diff changeset
127 PURPLE_CMD_P_VERY_HIGH = 6000
22051
61dc80506e49 C++ doesn't really allow forward declarations of enums, and we
Mark Doliner <markdoliner@pidgin.im>
parents: 20370
diff changeset
128 } PurpleCmdPriority;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
129
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
130 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
131 * PurpleCmdFlag:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
132 * @PURPLE_CMD_FLAG_IM: Command is usable in IMs.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
133 * @PURPLE_CMD_FLAG_CHAT: Command is usable in multi-user chats.
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
134 * @PURPLE_CMD_FLAG_PROTOCOL_ONLY: Command is usable only for a particular
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
135 * protocol.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
136 * @PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS: Incorrect arguments to this command
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
137 * should be accepted anyway.
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
138 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
139 * Flags used to set various properties of commands. Every command should
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
140 * have at least one of #PURPLE_CMD_FLAG_IM and #PURPLE_CMD_FLAG_CHAT set in
41083
590d533cf290 Fix several typos in libpurple
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41010
diff changeset
141 * order to be even slightly useful.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
142 *
35471
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
143 * See purple_cmd_register().
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
144 */
32206
a2c62b07ae5a Please correct me if I'm wrong, but I don't think we gain anything
Mark Doliner <markdoliner@pidgin.im>
parents: 25105
diff changeset
145 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
146 PURPLE_CMD_FLAG_IM = 0x01,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
147 PURPLE_CMD_FLAG_CHAT = 0x02,
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
148 PURPLE_CMD_FLAG_PROTOCOL_ONLY = 0x04,
25105
fe13c190ca13 Remove the commas at the end of enumerator lists. This resolves warnings
Florian Quèze <florian@instantbird.org>
parents: 23555
diff changeset
149 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS = 0x08
22051
61dc80506e49 C++ doesn't really allow forward declarations of enums, and we
Mark Doliner <markdoliner@pidgin.im>
parents: 20370
diff changeset
150 } PurpleCmdFlag;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
151
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
152 /**
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
153 * PurpleCommandsUiOps:
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
154 * @register_command: If implemented, the UI is responsible for handling
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
155 * commands. See @purple_cmd_register for the argument values.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
156 * @unregister_command: Should be implemented if register_command is
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
157 * implemented. @name and @prpl_id will have the same value
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
158 * that were used for the register_command call.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
159 *
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
160 * Command UI operations; UIs should implement this if they want to handle
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
161 * commands themselves, rather than relying on the core.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
162 *
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
163 * See <link linkend="chapter-ui-ops">List of <literal>UiOps</literal>
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
164 * Structures</link>
40230
620a23d172cb Add Since tags for 2.11.0.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39863
diff changeset
165 *
620a23d172cb Add Since tags for 2.11.0.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39863
diff changeset
166 * Since: 2.11.0
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
167 */
38545
3e287c9fe72e cmds: Change PurpleCommandsUiOps so GtkDoc finds it
Mike Ruprecht <cmaiku@gmail.com>
parents: 38240
diff changeset
168 typedef struct {
37686
403b13cb3a47 PurpleCommandsUiOps: minor naming/docs fixes
dx <dx@dxzone.com.ar>
parents: 37685
diff changeset
169 void (*register_command)(const gchar *name, PurpleCmdPriority priority,
403b13cb3a47 PurpleCommandsUiOps: minor naming/docs fixes
dx <dx@dxzone.com.ar>
parents: 37685
diff changeset
170 PurpleCmdFlag flags, const gchar *prpl_id,
37903
caf372ae8882 Fix up the commands execute stuff
Gary Kramlich <grim@reaperworld.com>
parents: 37901
diff changeset
171 const gchar *help, PurpleCmdId id);
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
172
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
173 void (*unregister_command)(const gchar *name, const gchar *prpl_id);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
174
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
175 /*< private >*/
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
176 void (*_purple_reserved1)(void);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
177 void (*_purple_reserved2)(void);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
178 void (*_purple_reserved3)(void);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
179 void (*_purple_reserved4)(void);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
180 } PurpleCommandsUiOps;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
181
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
182 G_BEGIN_DECLS
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
183
10231
047177cee39f [gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents: 10052
diff changeset
184 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35471
diff changeset
185 /* Commands API */
10231
047177cee39f [gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents: 10052
diff changeset
186 /**************************************************************************/
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
187
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
188 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
189 * purple_cmd_register:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
190 * @cmd: The command. This should be a UTF-8 (or ASCII) string, with no spaces
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
191 * or other white space.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
192 * @args: A string of characters describing to libpurple how to parse this
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
193 * command's arguments. If what the user types doesn't match this
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
194 * pattern, libpurple will keep looking for another command, unless
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
195 * the flag #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed in @f.
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
196 * This string should contain no whitespace, and use a single
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
197 * character for each argument. The recognized characters are:
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
198 * <itemizedlist>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
199 * <listitem><literal>'w'</literal>: Matches a single word.</listitem>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
200 * <listitem><literal>'W'</literal>: Matches a single word, with
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
201 * formatting.</listitem>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
202 * <listitem><literal>'s'</literal>: Matches the rest of the
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
203 * arguments after this point,
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
204 * as a single string.</listitem>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
205 * <listitem><literal>'S'</literal>: Same as <literal>'s'</literal>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
206 * but with formatting.</listitem>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
207 * </itemizedlist>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
208 * If args is the empty string, then the command accepts no
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
209 * arguments. The args passed to the callback @func will be a %NULL
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
210 * terminated array of %NULL terminated strings, and will always
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
211 * match the number of arguments asked for, unless
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
212 * #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
213 * @p: This is the priority. Higher priority commands will be run first,
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
214 * and usually the first command will stop any others from being
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
215 * called.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
216 * @f: Flags specifying various options about this command, combined with
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
217 * <literal>|</literal> (bitwise OR). You need to at least pass one of
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
218 * #PURPLE_CMD_FLAG_IM or #PURPLE_CMD_FLAG_CHAT (you may pass both) in
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
219 * order for the command to ever actually be called.
37034
9d6765962b22 Initial replacements for this branch
Ankit Vani <a@nevitus.org>
parents: 37023
diff changeset
220 * @protocol_id: If the #PURPLE_CMD_FLAG_PROTOCOL_ONLY flag is set, this is the id
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
221 * of the protocol to which the command applies (such as
35419
d0aecd9a8104 Get rid of <tt>
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
222 * <literal>"prpl-msn"</literal>). If the flag is not set, this
d0aecd9a8104 Get rid of <tt>
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
223 * parameter is ignored; pass %NULL (or a humourous string of
d0aecd9a8104 Get rid of <tt>
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
224 * your choice!).
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
225 * @func: (scope call): This is the function to call when someone enters this
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
226 * command.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
227 * @helpstr: a whitespace sensitive, UTF-8, HTML string describing how to
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
228 * use the command. The preferred format of this string is the
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
229 * command's name, followed by a space and any arguments it
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
230 * accepts (if it takes any arguments, otherwise no space),
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
231 * followed by a colon, two spaces, and a description of the
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
232 * command in sentence form. Do not include a slash before the
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
233 * command name.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
234 * @data: User defined data to pass to the #PurpleCmdFunc @f.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
235 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
236 * Register a new command with the core.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
237 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
238 * The command will only happen if commands are enabled,
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
239 * which is a UI pref. UIs don't have to support commands at all.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
240 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
241 * Returns: A #PurpleCmdId, which is only used for calling
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
242 * #purple_cmd_unregister, or 0 on failure.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
243 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
244 PurpleCmdId purple_cmd_register(const gchar *cmd, const gchar *args, PurpleCmdPriority p, PurpleCmdFlag f,
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
245 const gchar *protocol_id, PurpleCmdFunc func, const gchar *helpstr, void *data);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
246
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
247 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
248 * purple_cmd_unregister:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
249 * @id: The #PurpleCmdId to unregister, as returned by #purple_cmd_register.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
250 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
251 * Unregister a command with the core.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
252 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
253 * All registered commands must be unregistered, if they're registered by a plugin
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
254 * or something else that might go away. Normally this is called when the plugin
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
255 * unloads itself.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
256 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
257 void purple_cmd_unregister(PurpleCmdId id);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
258
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
259 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
260 * purple_cmd_do_command:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
261 * @conv: The conversation the command was typed in.
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
262 * @cmdline: The command the user typed (including all arguments) as a single string.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
263 * The caller doesn't have to do any parsing, except removing the command
9597
c6f672b593cb [gaim-migrate @ 10440]
Tim Ringenbach <marv@pidgin.im>
parents: 9343
diff changeset
264 * prefix, which the core has no knowledge of. cmd should not contain any
c6f672b593cb [gaim-migrate @ 10440]
Tim Ringenbach <marv@pidgin.im>
parents: 9343
diff changeset
265 * formatting, and should be in plain text (no html entities).
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
266 * @markup: This is the same as cmd, but is the formatted version. It should be in
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9143
diff changeset
267 * HTML, with < > and &, at least, escaped to html entities, and should
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9143
diff changeset
268 * include both the default formatting and any extra manual formatting.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
269 * @errormsg: If the command failed errormsg is filled in with the appropriate error
10788
79d6a09303e7 [gaim-migrate @ 12429]
Richard Laager <rlaager@pidgin.im>
parents: 10231
diff changeset
270 * message. It must be freed by the caller with g_free().
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
271 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
272 * Do a command.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
273 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
274 * Normally the UI calls this to perform a command. This might also be useful
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
275 * if aliases are ever implemented.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
276 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
277 * Returns: A #PurpleCmdStatus indicating if the command succeeded or failed.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
278 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
279 PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline,
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9143
diff changeset
280 const gchar *markup, gchar **errormsg);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
281
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
282 /**
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
283 * purple_cmd_execute:
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
284 * @id: The command to execute.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
285 * @conv: The conversation the command was typed in.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
286 * @cmdline: The command the user typed (only the arguments).
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
287 * The caller should remove the prefix and the command name.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
288 * It should not contain any formatting, and should be
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
289 * in plain text (no HTML entities).
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
290 *
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
291 * Execute a specific command.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
292 *
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
293 * The UI calls this to execute a command, after parsing the
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
294 * command name.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
295 *
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
296 * Returns: %TRUE if the command handled the @cmdline, %FALSE otherwise.
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
297 */
37903
caf372ae8882 Fix up the commands execute stuff
Gary Kramlich <grim@reaperworld.com>
parents: 37901
diff changeset
298 gboolean purple_cmd_execute(PurpleCmdId id, PurpleConversation *conv,
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
299 const gchar *cmdline);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
300
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
301 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
302 * purple_cmd_list:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
303 * @conv: The conversation, or %NULL.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
304 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
305 * List registered commands.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
306 *
38716
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
307 * Returns: (element-type utf8) (transfer container): All commands
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
308 * that are valid in the context of @conv, or all commands, if @conv is
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
309 * %NULL. Don't keep this list around past the main loop, or anything else that
35419
d0aecd9a8104 Get rid of <tt>
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
310 * might unregister a command, as the <type>const char *</type>'s used get freed
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
311 * then.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
312 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
313 GList *purple_cmd_list(PurpleConversation *conv);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
314
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
315 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
316 * purple_cmd_help:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
317 * @conv: The conversation, or %NULL for no context.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
318 * @cmd: The command. No wildcards accepted, but returns help for all
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
319 * commands if %NULL.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
320 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
321 * Get the help string for a command.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
322 *
38716
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
323 * Returns: (element-type utf8) (transfer container): the help strings for a
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
324 * given command, one node for each matching command.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
325 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
326 GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
327
23555
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
328 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
329 * purple_cmds_get_handle:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
330 *
23555
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
331 * Get the handle for the commands API
35538
d95fa87c8429 Add missing blank line before 'Returns:'
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
332 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
333 * Returns: The handle
23555
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
334 */
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
335 gpointer purple_cmds_get_handle(void);
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
336
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
337 /**
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
338 * purple_cmds_set_ui_ops:
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
339 * @ops: The UI operations structure.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
340 *
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
341 * Sets the UI operations structure to be used when registering and
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
342 * unregistering commands. The UI operations need only be set if the
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
343 * UI wants to handle the commands itself; otherwise, leave it as NULL.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
344 */
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
345 void purple_cmds_set_ui_ops(PurpleCommandsUiOps *ops);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
346
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
347 /**
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
348 * purple_cmds_get_ui_ops:
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
349 *
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
350 * Returns the UI operations structure to be used when registering and
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
351 * unregistering commands.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
352 *
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
353 * Returns: (transfer none): The UI operations structure.
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
354 */
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
355 PurpleCommandsUiOps *purple_cmds_get_ui_ops(void);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
356
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
357 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
358 * purple_cmds_init:
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
359 *
23555
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
360 * Initialize the commands subsystem.
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
361 */
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
362 void purple_cmds_init(void);
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
363
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
364 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
365 * purple_cmds_uninit:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
366 *
23555
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
367 * Uninitialize the commands subsystem.
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
368 */
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
369 void purple_cmds_uninit(void);
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
370
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
371 G_END_DECLS
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
372
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
373 #endif /* PURPLE_CMDS_H */

mercurial