libpurple/purpleprotocolmedia.h

Tue, 09 Apr 2024 21:50:31 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 09 Apr 2024 21:50:31 -0500
changeset 42656
df9aafbae930
parent 42615
2f3308794a8f
permissions
-rw-r--r--

Add a doc-check unit test to libpurple and fix the issues it has found

Testing Done:
Ran ninja turtles

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

40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
40584
6f198a69ac48 A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
2 * Purple - Internet Messaging Library
6f198a69ac48 A bunch of documentation cleanups
Gary Kramlich <grim@reaperworld.com>
parents: 40539
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
9 * This library is free software; you can redistribute it and/or modify it
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
10 * under the terms of the GNU General Public License as published by the Free
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
11 * Software Foundation; either version 2 of the License, or (at your option)
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
12 * any later version.
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
14 * This library is distributed in the hope that it will be useful, but WITHOUT
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
17 * more details.
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
42594
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
19 * You should have received a copy of the GNU General Public License along with
eddde70cedd8 Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents: 42391
diff changeset
20 * this library; if not, see <https://www.gnu.org/licenses/>.
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 # error "only <purple.h> may be included directly"
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #endif
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #ifndef PURPLE_PROTOCOL_MEDIA_H
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #define PURPLE_PROTOCOL_MEDIA_H
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <glib.h>
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib-object.h>
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32
42338
2548eb61acc9 Make sure all internal includes use double quotes
Gary Kramlich <grim@reaperworld.com>
parents: 41686
diff changeset
33 #include "media.h"
42344
c51d37734155 Rename account.[ch] to purpleaccount.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 42338
diff changeset
34 #include "purpleaccount.h"
42338
2548eb61acc9 Make sure all internal includes use double quotes
Gary Kramlich <grim@reaperworld.com>
parents: 41686
diff changeset
35 #include "purpleprotocol.h"
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
36 #include "purpleversion.h"
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #define PURPLE_TYPE_PROTOCOL_MEDIA (purple_protocol_media_get_type())
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42387
diff changeset
39
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42387
diff changeset
40 PURPLE_AVAILABLE_IN_3_0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 G_DECLARE_INTERFACE(PurpleProtocolMedia, purple_protocol_media, PURPLE,
41024
a2ad2d034162 Set the prereq type for all Protocol interfaces to PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents: 40584
diff changeset
42 PROTOCOL_MEDIA, PurpleProtocol)
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 G_BEGIN_DECLS
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 /**
41205
c5513eb740aa Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[o-z]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41155
diff changeset
47 * PurpleProtocolMedia:
c5513eb740aa Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[o-z]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41155
diff changeset
48 *
c5513eb740aa Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[o-z]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41155
diff changeset
49 * #PurpleProtocolMedia describes the multimedia api that is available for
c5513eb740aa Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[o-z]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41155
diff changeset
50 * protocols.
42391
090b03385984 Add Since and symbol visibility to new-in-3.0 things
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42387
diff changeset
51 *
42615
2f3308794a8f Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
52 * Since: 3.0
41205
c5513eb740aa Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[o-z]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41155
diff changeset
53 */
c5513eb740aa Remove unnecessary gtk-doc comments and move them where possible from libpurple/purple[o-z]*.h
Gary Kramlich <grim@reaperworld.com>
parents: 41155
diff changeset
54
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 struct _PurpleProtocolMediaInterface {
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 /*< private >*/
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 GTypeInterface parent;
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 /*< public >*/
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 gboolean (*initiate_session)(PurpleProtocolMedia *media, PurpleAccount *account, const gchar *who, PurpleMediaSessionType type);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 PurpleMediaCaps (*get_caps)(PurpleProtocolMedia *media, PurpleAccount *account, const gchar *who);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 gboolean (*send_dtmf)(PurpleProtocolMedia *protocol_media, PurpleMedia *media, gchar dtmf, guint8 volume, guint8 duration);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 /*< private >*/
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 gpointer reserved[4];
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 };
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 /**
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * purple_protocol_media_initiate_session:
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * @media: The #PurpleProtocolMedia instance.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * @account: The #PurpleAccount instance.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 * @who: The user to initiate a media session with.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * @type: The type of media session to create.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 * Initiates a media connection of @type to @who.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 * Returns: %TRUE if successful, %FALSE otherwise.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 *
42615
2f3308794a8f Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
81 * Since: 3.0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 */
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
83 PURPLE_AVAILABLE_IN_3_0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 gboolean purple_protocol_media_initiate_session(PurpleProtocolMedia *media, PurpleAccount *account, const gchar *who, PurpleMediaSessionType type);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 /**
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 * purple_protocol_media_get_caps:
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 * @media: The #PurpleProtocolMedia instance.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 * @account: The #PurpleAccount instance.
41083
590d533cf290 Fix several typos in libpurple
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41024
diff changeset
90 * @who: The user to get the media capabilities for.
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * Gets the #PurpleMediaCaps for @who which determine what types of media are
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * available.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * Returns: the media capabilities of @who.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 *
42615
2f3308794a8f Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
97 * Since: 3.0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 */
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
99 PURPLE_AVAILABLE_IN_3_0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 PurpleMediaCaps purple_protocol_media_get_caps(PurpleProtocolMedia *media, PurpleAccount *account, const gchar *who);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 /**
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 * purple_protocol_media_send_dtmf:
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 * @protocol_media: The #PurpleProtocolMedia instance.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 * @media: The #PurpleMedia instance.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 * @dtmf: A DTMF to send.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 * @volume: The volume to send @dtmf at.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 * @duration: The duration to send @dtmf (in ms?)
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 * Sends a DTMF (dual-tone multi-frequency) signal via the established @media
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 * for the given @duration at the given @volume.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 * It is up to the specific implementation if DTMF is send in or out of band.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 *
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 * Returns: %TRUE if successful, %FALSE otherwise.
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 *
42615
2f3308794a8f Remove the micro version from since tags for libpurple part 4
Gary Kramlich <grim@reaperworld.com>
parents: 42594
diff changeset
117 * Since: 3.0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 */
42387
d9350cda1556 Export symbols added for 3.0.0
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42344
diff changeset
119 PURPLE_AVAILABLE_IN_3_0
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 gboolean purple_protocol_media_send_dtmf(PurpleProtocolMedia *protocol_media, PurpleMedia *media, gchar dtmf, guint8 volume, guint8 duration);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 G_END_DECLS
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 #endif /* PURPLE_PROTOCOL_MEDIA_H */

mercurial