libpurple/cmds.h

Tue, 25 Apr 2023 00:46:17 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 25 Apr 2023 00:46:17 -0500
changeset 42207
7c16e3b1cce8
parent 41722
eee8aa10c2a0
child 42340
807dda9de806
permissions
-rw-r--r--

Create PurpleSavedPresence for saving the users presences

Testing Done:
Ran the unit tests.

Bugs closed: PIDGIN-17795

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

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
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
26 #include <purpleconversation.h>
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
27
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
28 /******************************************************************************
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
29 * Structures
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
30 *****************************************************************************/
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
32 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
33 * PurpleCmdStatus:
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
34 * @PURPLE_CMD_STATUS_OK: The command executed successfully.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
35 * @PURPLE_CMD_STATUS_FAILED: The command failed to execute.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
36 * @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
37 * @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
38 * @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
39 * 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
40 * @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
41 * conversation.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
42 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
43 * 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
44 */
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
45 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
46 PURPLE_CMD_STATUS_OK,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
47 PURPLE_CMD_STATUS_FAILED,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
48 PURPLE_CMD_STATUS_NOT_FOUND,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
49 PURPLE_CMD_STATUS_WRONG_ARGS,
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
50 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
51 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
52 } PurpleCmdStatus;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
53
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
54 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
55 * 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
56 * @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
57 * 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
58 * @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
59 * @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
60 * name to call.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
61 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
62 * 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
63 * 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
64 * 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
65 * 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
66 * #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
67 * 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
68 */
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
69 typedef enum {
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
70 PURPLE_CMD_RET_OK,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
71 PURPLE_CMD_RET_FAILED,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
72 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
73 } PurpleCmdRet;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
74
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
75 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
76 * PurpleCmdFunc:
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
77 * @conversation: The #PurpleConversation where the command is being run.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
78 * @cmd: The name of the command.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
79 * @args: The arguments to the command.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
80 * @error: (out): A return address for a #GError.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
81 * @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
82 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
83 * 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
84 */
38745
f4376b1f4682 A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 38716
diff changeset
85 typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *conversation, const gchar *cmd,
9597
c6f672b593cb [gaim-migrate @ 10440]
Tim Ringenbach <marv@pidgin.im>
parents: 9343
diff changeset
86 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
87 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
88 * PurpleCmdId:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
89 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
90 * 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
91 * 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
92 * 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
93 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
94 typedef guint PurpleCmdId;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
95
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
96 /**
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
97 * PurpleCmdPriority:
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
98 * @PURPLE_CMD_P_VERY_LOW: Lowest priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
99 * @PURPLE_CMD_P_LOW: Low priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
100 * @PURPLE_CMD_P_DEFAULT: Default priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
101 * @PURPLE_CMD_P_PROTOCOL: Priority for protocol plugins.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
102 * @PURPLE_CMD_P_PLUGIN: Priority for plugins.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
103 * @PURPLE_CMD_P_ALIAS: Priority for aliasing commands.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
104 * @PURPLE_CMD_P_HIGH: High priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
105 * @PURPLE_CMD_P_VERY_HIGH: Highest priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
106 *
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
107 * 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
108 * 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
109 * run.
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
110 */
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
111 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
112 PURPLE_CMD_P_VERY_LOW = -1000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
113 PURPLE_CMD_P_LOW = 0,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
114 PURPLE_CMD_P_DEFAULT = 1000,
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
115 PURPLE_CMD_P_PROTOCOL = 2000,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
116 PURPLE_CMD_P_PLUGIN = 3000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
117 PURPLE_CMD_P_ALIAS = 4000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
118 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
119 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
120 } PurpleCmdPriority;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
121
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
122 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
123 * PurpleCmdFlag:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
124 * @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
125 * @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
126 * @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
127 * protocol.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
128 * @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
129 * should be accepted anyway.
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
130 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
131 * 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
132 * 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
133 * 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
134 *
35471
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
135 * See purple_cmd_register().
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
136 */
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
137 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
138 PURPLE_CMD_FLAG_IM = 0x01,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
139 PURPLE_CMD_FLAG_CHAT = 0x02,
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
140 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
141 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
142 } PurpleCmdFlag;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
143
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
144 G_BEGIN_DECLS
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
145
10231
047177cee39f [gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents: 10052
diff changeset
146 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35471
diff changeset
147 /* Commands API */
10231
047177cee39f [gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents: 10052
diff changeset
148 /**************************************************************************/
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
149
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
150 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
151 * purple_cmd_register:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
152 * @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
153 * or other white space.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
154 * @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
155 * 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
156 * 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
157 * 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
158 * 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
159 * 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
160 * <itemizedlist>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
161 * <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
162 * <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
163 * formatting.</listitem>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
164 * <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
165 * 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
166 * 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
167 * <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
168 * 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
169 * </itemizedlist>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
170 * 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
171 * 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
172 * 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
173 * 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
174 * #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
175 * @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
176 * 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
177 * called.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
178 * @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
179 * <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
180 * #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
181 * 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
182 * @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
183 * 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
184 * <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
185 * parameter is ignored; pass %NULL (or a humourous string of
d0aecd9a8104 Get rid of <tt>
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
186 * your choice!).
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
187 * @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
188 * command.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
189 * @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
190 * 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
191 * 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
192 * 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
193 * 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
194 * 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
195 * command name.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
196 * @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
197 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
198 * Register a new command with the core.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
199 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
200 * The command will only happen if commands are enabled,
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
201 * 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
202 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
203 * 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
204 * #purple_cmd_unregister, or 0 on failure.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
205 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
206 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
207 const gchar *protocol_id, PurpleCmdFunc func, const gchar *helpstr, void *data);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
208
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
209 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
210 * purple_cmd_unregister:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
211 * @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
212 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
213 * Unregister a command with the core.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
214 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
215 * 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
216 * 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
217 * unloads itself.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
218 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
219 void purple_cmd_unregister(PurpleCmdId id);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
220
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
221 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
222 * purple_cmd_do_command:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
223 * @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
224 * @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
225 * 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
226 * 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
227 * 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
228 * @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
229 * HTML, with < > and &, at least, escaped to html entities, and should
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9143
diff changeset
230 * 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
231 * @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
232 * 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
233 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
234 * Do a command.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
235 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
236 * 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
237 * if aliases are ever implemented.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
238 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
239 * Returns: A #PurpleCmdStatus indicating if the command succeeded or failed.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
240 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
241 PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline,
9175
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9143
diff changeset
242 const gchar *markup, gchar **errormsg);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
243
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
244 /**
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
245 * purple_cmd_execute:
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
246 * @id: The command to execute.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
247 * @conv: The conversation the command was typed in.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
248 * @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
249 * 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
250 * 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
251 * in plain text (no HTML entities).
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
252 *
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
253 * Execute a specific command.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
254 *
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
255 * 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
256 * command name.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
257 *
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
258 * 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
259 */
37903
caf372ae8882 Fix up the commands execute stuff
Gary Kramlich <grim@reaperworld.com>
parents: 37901
diff changeset
260 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
261 const gchar *cmdline);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
262
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
263 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
264 * purple_cmd_list:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
265 * @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
266 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
267 * List registered commands.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
268 *
38716
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
269 * 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
270 * 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
271 * %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
272 * 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
273 * then.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
274 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
275 GList *purple_cmd_list(PurpleConversation *conv);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
276
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
277 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
278 * purple_cmd_help:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
279 * @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
280 * @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
281 * commands if %NULL.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
282 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
283 * Get the help string for a command.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
284 *
38716
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
285 * 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
286 * given command, one node for each matching command.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
287 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
288 GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
289
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
290 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
291 * purple_cmds_get_handle:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
292 *
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
293 * Get the handle for the commands API
35538
d95fa87c8429 Add missing blank line before 'Returns:'
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
294 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
295 * 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
296 */
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
297 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
298
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
299 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
300 * purple_cmds_init:
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
301 *
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
302 * 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
303 */
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
304 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
305
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
306 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
307 * purple_cmds_uninit:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
308 *
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
309 * 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
310 */
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
311 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
312
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
313 G_END_DECLS
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
314
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
315 #endif /* PURPLE_CMDS_H */

mercurial