Fri, 07 Feb 2014 17:54:55 +0530
Remove /*@{*/ and /*@}*/
|
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 | */ | |
|
35433
8dcae6cd6628
Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
18 | /** |
|
8dcae6cd6628
Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
19 | * SECTION:cmds |
|
8dcae6cd6628
Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
20 | * @section_id: libpurple-cmds |
|
35436
a69d2e5604c5
Swap @title and @short_description roles
Ankit Vani <a@nevitus.org>
parents:
35433
diff
changeset
|
21 | * @short_description: <filename>cmds.h</filename> |
|
a69d2e5604c5
Swap @title and @short_description roles
Ankit Vani <a@nevitus.org>
parents:
35433
diff
changeset
|
22 | * @title: Commands API |
|
35433
8dcae6cd6628
Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
23 | * @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
|
24 | */ |
|
8dcae6cd6628
Add section blocks for account.h to connection.h
Ankit Vani <a@nevitus.org>
parents:
35419
diff
changeset
|
25 | |
| 15884 | 26 | #ifndef _PURPLE_CMDS_H_ |
| 27 | #define _PURPLE_CMDS_H_ | |
| 9130 | 28 | |
| 29 | #include "conversation.h" | |
| 30 | ||
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10052
diff
changeset
|
31 | /**************************************************************************/ |
| 35472 | 32 | /* Structures */ |
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10052
diff
changeset
|
33 | /**************************************************************************/ |
| 9130 | 34 | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
35 | /** |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
36 | * PurpleCmdStatus: |
|
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 | * 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
|
39 | */ |
|
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
|
40 | typedef enum { |
| 15884 | 41 | PURPLE_CMD_STATUS_OK, |
| 42 | PURPLE_CMD_STATUS_FAILED, | |
| 43 | PURPLE_CMD_STATUS_NOT_FOUND, | |
| 44 | PURPLE_CMD_STATUS_WRONG_ARGS, | |
| 45 | PURPLE_CMD_STATUS_WRONG_PRPL, | |
|
25105
fe13c190ca13
Remove the commas at the end of enumerator lists. This resolves warnings
Florian Quèze <florian@instantbird.org>
parents:
23555
diff
changeset
|
46 | 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
|
47 | } PurpleCmdStatus; |
| 9130 | 48 | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
49 | /** |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
50 | * PurpleCmdRet: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
51 | * @PURPLE_CMD_RET_OK: Everything's okay; Don't look for another command |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
52 | * to call. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
53 | * @PURPLE_CMD_RET_FAILED: The command failed, but stop looking. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
54 | * @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
|
55 | * name to call. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
56 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
57 | * 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
|
58 | * 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
|
59 | * 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
|
60 | * 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
|
61 | * #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
|
62 | * 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
|
63 | */ |
|
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
|
64 | typedef enum { |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
65 | PURPLE_CMD_RET_OK, |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
66 | PURPLE_CMD_RET_FAILED, |
|
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 |
|
22051
61dc80506e49
C++ doesn't really allow forward declarations of enums, and we
Mark Doliner <markdoliner@pidgin.im>
parents:
20370
diff
changeset
|
68 | } PurpleCmdRet; |
| 9130 | 69 | |
| 15884 | 70 | #define PURPLE_CMD_FUNC(func) ((PurpleCmdFunc)func) |
| 9597 | 71 | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
72 | /** |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
73 | * PurpleCmdFunc: |
|
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
|
74 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
75 | * 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
|
76 | */ |
| 35473 | 77 | /* TODO document the arguments to these functions. */ |
| 15884 | 78 | typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *, const gchar *cmd, |
| 9597 | 79 | 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
|
80 | /** |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
81 | * PurpleCmdId: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
82 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
83 | * 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
|
84 | * 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
|
85 | * 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
|
86 | */ |
| 15884 | 87 | typedef guint PurpleCmdId; |
| 9130 | 88 | |
|
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
|
89 | typedef enum { |
| 15884 | 90 | PURPLE_CMD_P_VERY_LOW = -1000, |
| 91 | PURPLE_CMD_P_LOW = 0, | |
| 92 | PURPLE_CMD_P_DEFAULT = 1000, | |
| 93 | PURPLE_CMD_P_PRPL = 2000, | |
| 94 | PURPLE_CMD_P_PLUGIN = 3000, | |
| 95 | PURPLE_CMD_P_ALIAS = 4000, | |
| 96 | 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
|
97 | 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
|
98 | } PurpleCmdPriority; |
| 9130 | 99 | |
|
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 | * PurpleCmdFlag: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
102 | * @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
|
103 | * @PURPLE_CMD_FLAG_CHAT: Command is usable in multi-user chats. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
104 | * @PURPLE_CMD_FLAG_PRPL_ONLY: Command is usable only for a particular |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
105 | * protocol. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
106 | * @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
|
107 | * should be accepted anyway. |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
108 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
109 | * 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
|
110 | * 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
|
111 | * 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
|
112 | * |
| 35471 | 113 | * See purple_cmd_register(). |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
114 | */ |
|
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
|
115 | typedef enum { |
| 15884 | 116 | PURPLE_CMD_FLAG_IM = 0x01, |
| 117 | PURPLE_CMD_FLAG_CHAT = 0x02, | |
| 118 | PURPLE_CMD_FLAG_PRPL_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
|
119 | 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
|
120 | } PurpleCmdFlag; |
| 9130 | 121 | |
| 122 | ||
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
123 | G_BEGIN_DECLS |
| 9130 | 124 | |
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10052
diff
changeset
|
125 | /**************************************************************************/ |
| 35472 | 126 | /* Commands API */ |
|
10231
047177cee39f
[gaim-migrate @ 11366]
Andrew Hart <arhart@users.sourceforge.net>
parents:
10052
diff
changeset
|
127 | /**************************************************************************/ |
| 9130 | 128 | |
| 129 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
130 | * purple_cmd_register: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
131 | * @cmd: The command. This should be a UTF-8 (or ASCII) string, with no spaces |
| 9130 | 132 | * or other white space. |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
133 | * @args: A string of characters describing to libpurple how to parse this |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
134 | * command's arguments. If what the user types doesn't match this |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
135 | * pattern, libpurple will keep looking for another command, unless |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
136 | * the flag #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed in @f. |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
137 | * This string should contain no whitespace, and use a single |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
138 | * character for each argument. The recognized characters are: |
|
35468
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
139 | * <itemizedlist> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
140 | * <listitem><literal>'w'</literal>: Matches a single word.</listitem> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
141 | * <listitem><literal>'W'</literal>: Matches a single word, with |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
142 | * formatting.</listitem> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
143 | * <listitem><literal>'s'</literal>: Matches the rest of the |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
144 | * arguments after this point, |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
145 | * as a single string.</listitem> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
146 | * <listitem><literal>'S'</literal>: Same as <literal>'s'</literal> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
147 | * but with formatting.</listitem> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
148 | * </itemizedlist> |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
149 | * If args is the empty string, then the command accepts no |
|
65e7b4566de4
Fix HTML generation warnings by using DocBook tags
Ankit Vani <a@nevitus.org>
parents:
35436
diff
changeset
|
150 | * arguments. The args passed to the callback @func will be a %NULL |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
151 | * terminated array of %NULL terminated strings, and will always |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
152 | * match the number of arguments asked for, unless |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
153 | * #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
|
154 | * @p: This is the priority. Higher priority commands will be run first, |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
155 | * and usually the first command will stop any others from being |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
156 | * called. |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
157 | * @f: Flags specifying various options about this command, combined with |
| 35419 | 158 | * <literal>|</literal> (bitwise OR). You need to at least pass one of |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
159 | * #PURPLE_CMD_FLAG_IM or #PURPLE_CMD_FLAG_CHAT (you may pass both) in |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
160 | * order for the command to ever actually be called. |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
161 | * @protocol_id: If the #PURPLE_CMD_FLAG_PRPL_ONLY flag is set, this is the id |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
162 | * of the protocol to which the command applies (such as |
| 35419 | 163 | * <literal>"prpl-msn"</literal>). If the flag is not set, this |
| 164 | * parameter is ignored; pass %NULL (or a humourous string of | |
| 165 | * your choice!). | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
166 | * @func: This is the function to call when someone enters this command. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
167 | * @helpstr: a whitespace sensitive, UTF-8, HTML string describing how to |
|
20370
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
168 | * use the command. The preferred format of this string is the |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
169 | * command's name, followed by a space and any arguments it |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
170 | * accepts (if it takes any arguments, otherwise no space), |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
171 | * followed by a colon, two spaces, and a description of the |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
172 | * command in sentence form. Do not include a slash before the |
|
f24b280e0c29
Let's document more of cmds.h!
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
173 | * command name. |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
174 | * @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
|
175 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
176 | * Register a new command with the core. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
177 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
178 | * The command will only happen if commands are enabled, |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
179 | * which is a UI pref. UIs don't have to support commands at all. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
180 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
181 | * 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
|
182 | * #purple_cmd_unregister, or 0 on failure. |
| 9130 | 183 | */ |
| 15884 | 184 | 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
|
185 | const gchar *protocol_id, PurpleCmdFunc func, const gchar *helpstr, void *data); |
| 9130 | 186 | |
| 187 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
188 | * purple_cmd_unregister: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
189 | * @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
|
190 | * |
| 9130 | 191 | * Unregister a command with the core. |
| 192 | * | |
| 193 | * All registered commands must be unregistered, if they're registered by a plugin | |
| 194 | * or something else that might go away. Normally this is called when the plugin | |
| 195 | * unloads itself. | |
| 196 | */ | |
| 15884 | 197 | void purple_cmd_unregister(PurpleCmdId id); |
| 9130 | 198 | |
| 199 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
200 | * purple_cmd_do_command: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
201 | * @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
|
202 | * @cmdline: The command the user typed (including all arguments) as a single string. |
| 9130 | 203 | * The caller doesn't have to do any parsing, except removing the command |
| 9597 | 204 | * prefix, which the core has no knowledge of. cmd should not contain any |
| 205 | * 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
|
206 | * @markup: This is the same as cmd, but is the formatted version. It should be in |
| 9175 | 207 | * HTML, with < > and &, at least, escaped to html entities, and should |
| 208 | * 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
|
209 | * @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
|
210 | * 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
|
211 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
212 | * Do a command. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
213 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
214 | * Normally the UI calls this to perform a command. This might also be useful |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
215 | * if aliases are ever implemented. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
216 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
217 | * Returns: A #PurpleCmdStatus indicating if the command succeeded or failed. |
| 9130 | 218 | */ |
| 15884 | 219 | PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline, |
| 9175 | 220 | const gchar *markup, gchar **errormsg); |
| 9130 | 221 | |
| 222 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
223 | * purple_cmd_list: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
224 | * @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
|
225 | * |
| 9130 | 226 | * List registered commands. |
| 227 | * | |
| 35419 | 228 | * Returns a #GList (which must be freed by the caller) of all commands |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
229 | * 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
|
230 | * %NULL. Don't keep this list around past the main loop, or anything else that |
| 35419 | 231 | * 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
|
232 | * then. |
| 9130 | 233 | * |
| 35419 | 234 | * Returns: A #GList of <type>const char *</type>, which must be freed with |
| 235 | * g_list_free(). | |
| 9130 | 236 | */ |
| 15884 | 237 | GList *purple_cmd_list(PurpleConversation *conv); |
| 9130 | 238 | |
| 239 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
240 | * purple_cmd_help: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
241 | * @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
|
242 | * @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
|
243 | * commands if %NULL. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
244 | * |
| 9130 | 245 | * Get the help string for a command. |
| 246 | * | |
| 247 | * Returns the help strings for a given command in the form of a GList, | |
| 248 | * one node for each matching command. | |
| 249 | * | |
| 35419 | 250 | * Returns: A #GList of <type>const char *</type>s, which is the help string |
| 9130 | 251 | * for that command. |
| 252 | */ | |
| 15884 | 253 | GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd); |
| 9130 | 254 | |
|
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
|
255 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
256 | * purple_cmds_get_handle: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
257 | * |
|
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
|
258 | * Get the handle for the commands API |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
32787
diff
changeset
|
259 | * 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
|
260 | */ |
|
82dab41b4163
cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23510
diff
changeset
|
261 | 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
|
262 | |
|
82dab41b4163
cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23510
diff
changeset
|
263 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
264 | * purple_cmds_init: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
265 | * |
|
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
|
266 | * 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
|
267 | */ |
|
82dab41b4163
cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23510
diff
changeset
|
268 | 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
|
269 | |
|
82dab41b4163
cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23510
diff
changeset
|
270 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
271 | * purple_cmds_uninit: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
272 | * |
|
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
|
273 | * 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
|
274 | */ |
|
82dab41b4163
cmd-added and cmd-removed signals to emit when commands are registered/unregistered.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23510
diff
changeset
|
275 | 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
|
276 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
277 | G_END_DECLS |
| 9130 | 278 | |
| 15884 | 279 | #endif /* _PURPLE_CMDS_H_ */ |