libpurple/cmds.h

Sun, 14 Apr 2024 01:14:59 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 14 Apr 2024 01:14:59 -0500
changeset 42725
ceb13f1de2d2
parent 42656
df9aafbae930
permissions
-rw-r--r--

Remove PurpleBuddy

PurpleContactInfo was created long ago to replace this, it is now its time!

Testing Done:
Ran the turtles.

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

42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
1 /*
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
2 * Purple - Internet Messaging Library
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
4 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
7 * source distribution.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
12 * any later version.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
17 * more details.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42422
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 */
35487
494f09f7f331 Move section blocks inside inclusion guards -- otherwise g-ir-scanner yells
Ankit Vani <a@nevitus.org>
parents: 35486
diff changeset
22
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40230
diff changeset
23 #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
24 # 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
25 #endif
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 40230
diff changeset
26
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
27 #ifndef PURPLE_CMDS_H
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
28 #define PURPLE_CMDS_H
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
29
42340
807dda9de806 Fix more internal includes that were using just angle brackets
Gary Kramlich <grim@reaperworld.com>
parents: 41722
diff changeset
30 #include "purpleconversation.h"
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
31 #include "purpleversion.h"
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
33 /******************************************************************************
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
34 * Structures
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
35 *****************************************************************************/
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
36
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
37 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
38 * PurpleCmdStatus:
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
39 * @PURPLE_CMD_STATUS_OK: The command executed successfully.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
40 * @PURPLE_CMD_STATUS_FAILED: The command failed to execute.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
41 * @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
42 * @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
43 * @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
44 * 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
45 * @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
46 * conversation.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
47 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
48 * The possible results of running a command with purple_cmd_do_command().
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
49 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
50 * Since: 2.0
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
51 */
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
52 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
53 PURPLE_CMD_STATUS_OK,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
54 PURPLE_CMD_STATUS_FAILED,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
55 PURPLE_CMD_STATUS_NOT_FOUND,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
56 PURPLE_CMD_STATUS_WRONG_ARGS,
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
57 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
58 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
59 } PurpleCmdStatus;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
60
35397
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 * 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
63 * @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
64 * 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
65 * @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
66 * @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
67 * name to call.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
68 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
69 * 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
70 * 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
71 * 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
72 * 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
73 * #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
74 * commands with the same name.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
75 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
76 * Since: 2.0
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
77 */
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
78 typedef enum {
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
79 PURPLE_CMD_RET_OK,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
80 PURPLE_CMD_RET_FAILED,
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
81 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
82 } PurpleCmdRet;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
83
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
84 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
85 * PurpleCmdFunc:
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
86 * @conversation: The #PurpleConversation where the command is being run.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
87 * @cmd: The name of the command.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
88 * @args: The arguments to the command.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
89 * @error: (out): A return address for a #GError.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
90 * @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
91 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
92 * A function implementing a command, as passed to purple_cmd_register().
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
93 *
42656
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
94 * Returns: The result of the command.
df9aafbae930 Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents: 42612
diff changeset
95 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
96 * Since: 2.0
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
97 */
38745
f4376b1f4682 A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 38716
diff changeset
98 typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *conversation, const gchar *cmd,
9597
c6f672b593cb [gaim-migrate @ 10440]
Tim Ringenbach <marv@pidgin.im>
parents: 9343
diff changeset
99 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
100 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
101 * PurpleCmdId:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
102 *
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
103 * 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
104 * 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
105 * 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
106 */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
107 typedef guint PurpleCmdId;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
108
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
109 /**
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
110 * PurpleCmdPriority:
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
111 * @PURPLE_CMD_P_VERY_LOW: Lowest priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
112 * @PURPLE_CMD_P_LOW: Low priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
113 * @PURPLE_CMD_P_DEFAULT: Default priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
114 * @PURPLE_CMD_P_PROTOCOL: Priority for protocol plugins.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
115 * @PURPLE_CMD_P_PLUGIN: Priority for plugins.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
116 * @PURPLE_CMD_P_ALIAS: Priority for aliasing commands.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
117 * @PURPLE_CMD_P_HIGH: High priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
118 * @PURPLE_CMD_P_VERY_HIGH: Highest priority.
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
119 *
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
120 * 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
121 * 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
122 * run.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
123 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
124 * Since: 2.0
39862
595bac8cac23 Add missing documentation for commands
Gary Kramlich <grim@reaperworld.com>
parents: 39659
diff changeset
125 */
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
126 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
127 PURPLE_CMD_P_VERY_LOW = -1000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
128 PURPLE_CMD_P_LOW = 0,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
129 PURPLE_CMD_P_DEFAULT = 1000,
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
130 PURPLE_CMD_P_PROTOCOL = 2000,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
131 PURPLE_CMD_P_PLUGIN = 3000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
132 PURPLE_CMD_P_ALIAS = 4000,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
133 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
134 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
135 } PurpleCmdPriority;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
136
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
137 /**
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
138 * PurpleCmdFlag:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
139 * @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
140 * @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
141 * @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
142 * protocol.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
143 * @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
144 * should be accepted anyway.
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
145 *
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
146 * 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
147 * 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
148 * 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
149 *
35471
a23769351b31 Remove @see
Ankit Vani <a@nevitus.org>
parents: 35468
diff changeset
150 * See purple_cmd_register().
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
151 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
152 * Since: 2.0
20370
f24b280e0c29 Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents: 20147
diff changeset
153 */
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
154 typedef enum {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
155 PURPLE_CMD_FLAG_IM = 0x01,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
156 PURPLE_CMD_FLAG_CHAT = 0x02,
37040
91119588bc3a Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 37035 35397
diff changeset
157 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
158 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
159 } PurpleCmdFlag;
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
160
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
161 G_BEGIN_DECLS
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
162
10231
047177cee39f [gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents: 10052
diff changeset
163 /**************************************************************************/
35472
474e26199560 Removed @name
Ankit Vani <a@nevitus.org>
parents: 35471
diff changeset
164 /* Commands API */
10231
047177cee39f [gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents: 10052
diff changeset
165 /**************************************************************************/
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
166
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
167 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
168 * purple_cmd_register:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
169 * @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
170 * or other white space.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
171 * @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
172 * 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
173 * 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
174 * 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
175 * 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
176 * 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
177 * <itemizedlist>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
178 * <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
179 * <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
180 * formatting.</listitem>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
181 * <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
182 * 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
183 * 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
184 * <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
185 * 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
186 * </itemizedlist>
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
187 * 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
188 * 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
189 * 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
190 * 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
191 * #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
192 * @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
193 * 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
194 * called.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
195 * @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
196 * <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
197 * #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
198 * 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
199 * @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
200 * 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
201 * <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
202 * parameter is ignored; pass %NULL (or a humourous string of
d0aecd9a8104 Get rid of <tt>
Ankit Vani <a@nevitus.org>
parents: 35397
diff changeset
203 * your choice!).
35682
65c1912ee2c8 Add (scope) annotation to callback parameters (account.h to proxy.h)
Ankit Vani <a@nevitus.org>
parents: 35538
diff changeset
204 * @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
205 * command.
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
206 * @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
207 * 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
208 * 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
209 * 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
210 * 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
211 * 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
212 * command name.
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
213 * @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
214 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
215 * Register a new command with the core.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
216 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
217 * The command will only happen if commands are enabled,
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
218 * 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
219 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
220 * 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
221 * #purple_cmd_unregister, or 0 on failure.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
222 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
223 * Since: 2.0
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
224 */
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
225 PURPLE_AVAILABLE_IN_ALL
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
226 PurpleCmdId purple_cmd_register(const gchar *cmd, const gchar *args, PurpleCmdPriority p, PurpleCmdFlag f, const gchar *protocol_id, PurpleCmdFunc func, const gchar *helpstr, void *data);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
227
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
228 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
229 * purple_cmd_unregister:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
230 * @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
231 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
232 * Unregister a command with the core.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
233 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
234 * 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
235 * 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
236 * unloads itself.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
237 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
238 * Since: 2.0
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
239 */
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
240 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
241 void purple_cmd_unregister(PurpleCmdId id);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
242
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
243 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
244 * purple_cmd_do_command:
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
245 * @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
246 * @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
247 * 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
248 * 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
249 * 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
250 * @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
251 * HTML, with < > and &, at least, escaped to html entities, and should
50bd82a24830 [gaim-migrate @ 9970]
Tim Ringenbach <marv@pidgin.im>
parents: 9143
diff changeset
252 * 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
253 * @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
254 * 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
255 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
256 * Do a command.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
257 *
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
258 * 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
259 * if aliases are ever implemented.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
260 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
261 * Returns: A #PurpleCmdStatus indicating if the command succeeded or failed.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
262 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
263 * Since: 2.0
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
264 */
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
265 PURPLE_AVAILABLE_IN_ALL
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
266 PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline, const gchar *markup, gchar **errormsg);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
267
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
268 /**
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
269 * purple_cmd_execute:
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
270 * @id: The command to execute.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
271 * @conv: The conversation the command was typed in.
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
272 * @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
273 * 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
274 * 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
275 * in plain text (no HTML entities).
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
276 *
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
277 * Execute a specific command.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
278 *
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
279 * 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
280 * command name.
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
281 *
38556
5912dabcde42 libpurple: Update documentation to GtkDoc style
Mike Ruprecht <cmaiku@gmail.com>
parents: 38545
diff changeset
282 * Returns: %TRUE if the command handled the @cmdline, %FALSE otherwise.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
283 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
284 * Since: 2.11
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
285 */
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
286 PURPLE_AVAILABLE_IN_2_11
37903
caf372ae8882 Fix up the commands execute stuff
Gary Kramlich <grim@reaperworld.com>
parents: 37901
diff changeset
287 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
288 const gchar *cmdline);
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
289
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
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_cmd_list:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
292 * @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
293 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
294 * List registered commands.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
295 *
38716
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
296 * 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
297 * 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
298 * %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
299 * 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
300 * then.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
301 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
302 * Since: 2.0
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
303 */
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
304 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
305 GList *purple_cmd_list(PurpleConversation *conv);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
306
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
307 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
308 * purple_cmd_help:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
309 * @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
310 * @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
311 * commands if %NULL.
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
312 *
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
313 * Get the help string for a command.
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
314 *
38716
b9bed228745a Add many libpurple element-type annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38556
diff changeset
315 * 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
316 * given command, one node for each matching command.
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
317 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
318 * Since: 2.0
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
319 */
42422
ef31fdd95157 Make sure all of the command API is marked with the proper version
Gary Kramlich <grim@reaperworld.com>
parents: 42396
diff changeset
320 PURPLE_AVAILABLE_IN_ALL
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
321 GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
322
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
323 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
324 * purple_cmds_get_handle:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
325 *
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
326 * Get the handle for the commands API
35538
d95fa87c8429 Add missing blank line before 'Returns:'
Ankit Vani <a@nevitus.org>
parents: 35487
diff changeset
327 *
35393
00f876b129bc Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents: 32787
diff changeset
328 * Returns: The handle
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
329 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
330 * Since: 2.5
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 */
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
332 PURPLE_AVAILABLE_IN_2_5
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
333 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
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 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
336 * purple_cmds_init:
37685
ef161f30f8bc Add PurpleCommandsUiOps API from instantbird
Florian Quèze <florian@instantbird.org>
parents: 25105
diff changeset
337 *
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
338 * Initialize the commands subsystem.
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
339 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
340 * Since: 2.5
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
341 */
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
342 PURPLE_AVAILABLE_IN_2_5
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
343 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
344
82dab41b4163 cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 23510
diff changeset
345 /**
35397
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
346 * purple_cmds_uninit:
31fa3a1aeff5 Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents: 35393
diff changeset
347 *
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
348 * Uninitialize the commands subsystem.
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
349 *
42612
d905313bc732 Remove the micro version from since tags for libpurple part 1
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
350 * Since: 2.5
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
351 */
42396
31bf5a42ac84 Export symbols and add Since tags for 2.5 API
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42340
diff changeset
352 PURPLE_AVAILABLE_IN_2_5
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
353 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
354
32787
7072f190d6ad Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32438
diff changeset
355 G_END_DECLS
9130
2e67295dd047 [gaim-migrate @ 9908]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
356
39659
e4dfb99b0cef Fix libpurple header guards using reserved names.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38745
diff changeset
357 #endif /* PURPLE_CMDS_H */

mercurial