2 * @file mediamanager.h Media Manager API
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #ifndef _PURPLE_MEDIA_MANAGER_H_
28 #define _PURPLE_MEDIA_MANAGER_H_
31 #include <glib-object.h>
33 /** @copydoc _PurpleMediaManager */
34 typedef struct _PurpleMediaManager PurpleMediaManager;
35 /** @copydoc _PurpleMediaManagerClass */
36 typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass;
43 #define PURPLE_TYPE_MEDIA_MANAGER (purple_media_manager_get_type())
44 #define PURPLE_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManager))
45 #define PURPLE_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass))
46 #define PURPLE_IS_MEDIA_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_MANAGER))
47 #define PURPLE_IS_MEDIA_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_MANAGER))
48 #define PURPLE_MEDIA_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_MANAGER, PurpleMediaManagerClass))
54 /**************************************************************************/
55 /** @name Media Manager API */
56 /**************************************************************************/
60 * Gets the media manager's GType.
62 * @return The media manager's GType.
66 GType purple_media_manager_get_type(void);
69 * Gets the "global" media manager object. It's created if it doesn't already exist.
71 * @return The "global" instance of the media manager object.
75 PurpleMediaManager *purple_media_manager_get(void);
78 * Creates a media session.
80 * @param manager The media manager to create the session under.
81 * @param account The account to create the session on.
82 * @param conference_type The conference type to feed into Farsight2.
83 * @param remote_user The remote user to initiate the session with.
85 * @return A newly created media session.
89 PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager,
90 PurpleAccount *account,
91 const char *conference_type,
92 const char *remote_user,
96 * Gets all of the media sessions.
98 * @param manager The media manager to get all of the sessions from.
100 * @return A list of all the media sessions.
104 GList *purple_media_manager_get_media(PurpleMediaManager *manager);
107 * Gets all of the media sessions for a given account.
109 * @param manager The media manager to get the sessions from.
110 * @param account The account the sessions are on.
112 * @return A list of the media sessions on the given account.
116 GList *purple_media_manager_get_media_by_account(
117 PurpleMediaManager *manager, PurpleAccount *account);
120 * Removes a media session from the media manager.
122 * @param manager The media manager to remove the media session from.
123 * @param media The media session to remove.
128 purple_media_manager_remove_media(PurpleMediaManager *manager,
132 * Signals that output windows should be created for the chosen stream.
134 * This shouldn't be called outside of mediamanager.c and media.c
136 * @param manager Manager the output windows are registered with.
137 * @param media Media session the output windows are registered for.
138 * @param session_id The session the output windows are registered with.
139 * @param participant The participant the output windows are registered with.
141 * @return TRUE if it succeeded, FALSE if it failed.
145 gboolean purple_media_manager_create_output_window(
146 PurpleMediaManager *manager, PurpleMedia *media,
147 const gchar *session_id, const gchar *participant);
150 * Registers a video output window to be created for a given stream.
152 * @param manager The manager to register the output window with.
153 * @param media The media instance to find the stream in.
154 * @param session_id The session the stream is associated with.
155 * @param participant The participant the stream is associated with.
156 * @param window_id The window ID to embed the video in.
158 * @return A unique ID to the registered output window, 0 if it failed.
162 gulong purple_media_manager_set_output_window(PurpleMediaManager *manager,
163 PurpleMedia *media, const gchar *session_id,
164 const gchar *participant, gulong window_id);
167 * Remove a previously registerd output window.
169 * @param manager The manager the output window was registered with.
170 * @param output_window_id The ID of the output window.
172 * @return TRUE if it found the output window and was successful, else FALSE.
176 gboolean purple_media_manager_remove_output_window(
177 PurpleMediaManager *manager, gulong output_window_id);
180 * Remove all output windows for a given conference/session/participant/stream.
182 * @param manager The manager the output windows were registered with.
183 * @param media The media instance the output windows were registered for.
184 * @param session_id The session the output windows were registered for.
185 * @param participant The participant the output windows were registered for.
189 void purple_media_manager_remove_output_windows(
190 PurpleMediaManager *manager, PurpleMedia *media,
191 const gchar *session_id, const gchar *participant);
194 * Sets which media caps the UI supports.
196 * @param manager The manager to set the caps on.
197 * @param caps The caps to set.
201 void purple_media_manager_set_ui_caps(PurpleMediaManager *manager,
202 PurpleMediaCaps caps);
205 * Gets which media caps the UI supports.
207 * @param manager The manager to get caps from.
209 * @return caps The caps retrieved.
213 PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager);
223 #endif /* _PURPLE_MEDIA_MANAGER_H_ */