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