libpurple/purplecommand.h

Thu, 07 Aug 2025 21:32:18 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 07 Aug 2025 21:32:18 -0500
changeset 43300
0604c6839974
parent 43068
a974441beed0
permissions
-rw-r--r--

Clean up and modernize PurpleImage

Testing Done:
Ran the tests under valgrind and called in the turtles.

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

42964
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * any later version.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * more details.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License along with
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <purple.h> may be included directly"
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PURPLE_COMMAND_H
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PURPLE_COMMAND_H
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib-object.h>
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #include "purpleconversation.h"
42967
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
34 #include "purpletags.h"
42964
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #include "purpleversion.h"
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 G_BEGIN_DECLS
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 * PurpleCommand:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 * An object that represents a command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 *
43068
a974441beed0 Add an overview on how commands work
Gary Kramlich <grim@reaperworld.com>
parents: 43053
diff changeset
44 * See the [Commands Overview](section-commands.html) for more information.
a974441beed0 Add an overview on how commands work
Gary Kramlich <grim@reaperworld.com>
parents: 43053
diff changeset
45 *
42964
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 #define PURPLE_TYPE_COMMAND (purple_command_get_type())
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 G_DECLARE_FINAL_TYPE(PurpleCommand, purple_command, PURPLE, COMMAND, GObject)
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 * purple_command_execute:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * @conversation: (nullable): The conversation where the command was run.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * @params: (nullable): The parameters for the command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 * Emits the [signal@Command::executed] signal.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 * User interfaces should call this method when the user wants to execute the
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 * command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 void purple_command_execute(PurpleCommand *command, PurpleConversation *conversation, const char *params);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * purple_command_executev:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * @conversation: (nullable): The conversation where the command was run.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 * @params: (nullable): The parameters for the command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 * Emits the [signal@Command::executed] signal.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * User interfaces should call this method when the user wants to execute the
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 * command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 void purple_command_executev(PurpleCommand *command, PurpleConversation *conversation, GStrv params);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * purple_command_get_icon_name:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 * Gets the icon name of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * Returns: (transfer none) (nullable): The icon-name if set, otherwise %NULL.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 const char *purple_command_get_icon_name(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 * purple_command_get_last_used:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 * Gets the last used date time of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 * Returns: (nullable): The time that @command was last used or %NULL.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 GDateTime *purple_command_get_last_used(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 * purple_command_get_name:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 * Gets the name of the command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 * Returns: The name of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 const char *purple_command_get_name(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 * purple_command_get_priority:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 * Gets the priority of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 * Returns: The priority.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 int purple_command_get_priority(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 * purple_command_get_source:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 * Gets the source of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 * When presenting commands to the user, this value can be used to help them
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 * determine where the command came from.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 * Returns: The source.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 const char *purple_command_get_source(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155 * purple_command_get_summary:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158 * Gets the summary of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 * When presenting commands to the user, this value can be used to help them
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 * determine exactly what this command will do.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 * Returns: The summary.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
167 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 const char *purple_command_get_summary(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 /**
42967
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
171 * purple_command_get_tags:
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
172 * @command: The instance.
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
173 *
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
174 * Gets the [class@Tags] from @command.
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
175 *
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
176 * These tags will be matched against [property@Conversation:tags] using
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
177 * [method@Tags.contains] to determine if command is available for a
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
178 * [class@Conversation].
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
179 *
43053
f2f944ac775c Implement Purple.CommandManager
Gary Kramlich <grim@reaperworld.com>
parents: 42967
diff changeset
180 * If this is empty, it will match all conversations.
f2f944ac775c Implement Purple.CommandManager
Gary Kramlich <grim@reaperworld.com>
parents: 42967
diff changeset
181 *
42967
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
182 * Returns: (transfer none): The tags object.
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
183 *
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
184 * Since: 3.0
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
185 */
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
186 PURPLE_AVAILABLE_IN_3_0
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
187 PurpleTags *purple_command_get_tags(PurpleCommand *command);
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
188
9da19bb7e207 Add a tags property to Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents: 42964
diff changeset
189 /**
42964
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
190 * purple_command_get_use_count:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
191 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
192 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
193 * Gets the use count of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
194 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
195 * Returns: The use count of @command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
196 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
197 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
198 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
199 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
200 guint purple_command_get_use_count(PurpleCommand *command);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
201
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
202 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
203 * purple_command_new:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
204 * @name: The name of the command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
205 * @source: The source of the command. This will be displayed to users and
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
206 * should be marked for translation.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
207 * @priority: The priority of the command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
208 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 * Creates a new command with the given properties.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
211 * Returns: (transfer full): The new command.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
212 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
213 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
214 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
215 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
216 PurpleCommand *purple_command_new(const char *name, const char *source, int priority);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
217
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
218 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
219 * purple_command_set_icon_name:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
220 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
221 * @icon_name: (nullable): The new icon name.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
222 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
223 * Sets the icon name of @command to @icon_name.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
224 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
225 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
226 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
227 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
228 void purple_command_set_icon_name(PurpleCommand *command, const char *icon_name);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
229
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
230 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
231 * purple_command_set_last_used:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
232 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
233 * @last_used: (nullable): The new last used time stamp.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
234 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
235 * Sets the last used time of @command to @last_used.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
236 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
237 * Typically this won't need to be called as the default handler for
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
238 * [signal@Command::executed] will set it.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
239 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
240 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
241 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
242 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
243 void purple_command_set_last_used(PurpleCommand *command, GDateTime *last_used);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
244
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
245 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
246 * purple_command_set_summary:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
247 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
248 * @summary: (nullable): The new summary.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
249 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
250 * Sets the summary of @command to @summary.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
251 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
253 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
254 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
255 void purple_command_set_summary(PurpleCommand *command, const char *summary);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
256
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
257 /**
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
258 * purple_command_set_use_count:
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
259 * @command: The instance.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
260 * @use_count: The new use count.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
261 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
262 * Sets the use count of @command to @use_count.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
263 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
264 * Typically this won't need to be called directly as the default handler for
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
265 * [signal@Command::executed] will increment it.
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
266 *
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
267 * Since: 3.0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
268 */
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
269 PURPLE_AVAILABLE_IN_3_0
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
270 void purple_command_set_use_count(PurpleCommand *command, guint use_count);
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
271
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
272 G_END_DECLS
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
273
f0edc907e018 Implement Purple.Command
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
274 #endif /* PURPLE_COMMAND_H */

mercurial