Frameworks/libpurple.framework/Versions/0.6.2/Headers/mediamanager.h
author Zachary West <zacw@adium.im>
Fri Aug 21 13:25:11 2009 -0700 (2009-08-21)
changeset 2592 e8d15275025e
parent 2069 Frameworks/libpurple.framework/Versions/0.6.0/Headers/mediamanager.h@1346acdb9a2b
permissions -rw-r--r--
im.pidgin.adium.1-4 at 267c6165e02e34318a1823960bd04c0639952f73
     1 /**
     2  * @file mediamanager.h Media Manager API
     3  * @ingroup core
     4  */
     5 
     6 /* purple
     7  *
     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.
    11  *
    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.
    16  *
    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.
    21  *
    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
    25  */
    26 
    27 #ifndef _PURPLE_MEDIA_MANAGER_H_
    28 #define _PURPLE_MEDIA_MANAGER_H_
    29 
    30 #include <glib.h>
    31 #include <glib-object.h>
    32 
    33 /** @copydoc _PurpleMediaManager */
    34 typedef struct _PurpleMediaManager PurpleMediaManager;
    35 /** @copydoc _PurpleMediaManagerClass */
    36 typedef struct _PurpleMediaManagerClass PurpleMediaManagerClass;
    37 
    38 #include "account.h"
    39 #include "media.h"
    40 
    41 G_BEGIN_DECLS
    42 
    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))
    49 
    50 #ifdef __cplusplus
    51 extern "C" {
    52 #endif
    53 
    54 /**************************************************************************/
    55 /** @name Media Manager API                                              */
    56 /**************************************************************************/
    57 /*@{*/
    58 
    59 /**
    60  * Gets the media manager's GType.
    61  *
    62  * @return The media manager's GType.
    63  *
    64  * @since 2.6.0
    65  */
    66 GType purple_media_manager_get_type(void);
    67 
    68 /**
    69  * Gets the "global" media manager object. It's created if it doesn't already exist.
    70  *
    71  * @return The "global" instance of the media manager object.
    72  *
    73  * @since 2.6.0
    74  */
    75 PurpleMediaManager *purple_media_manager_get(void);
    76 
    77 /**
    78  * Creates a media session.
    79  *
    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.
    84  *
    85  * @return A newly created media session.
    86  *
    87  * @since 2.6.0
    88  */
    89 PurpleMedia *purple_media_manager_create_media(PurpleMediaManager *manager,
    90 						PurpleAccount *account,
    91 						const char *conference_type,
    92 						const char *remote_user,
    93 						gboolean initiator);
    94 
    95 /**
    96  * Gets all of the media sessions.
    97  *
    98  * @param manager The media manager to get all of the sessions from.
    99  *
   100  * @return A list of all the media sessions.
   101  *
   102  * @since 2.6.0
   103  */
   104 GList *purple_media_manager_get_media(PurpleMediaManager *manager);
   105 
   106 /**
   107  * Gets all of the media sessions for a given account.
   108  *
   109  * @param manager The media manager to get the sessions from.
   110  * @param account The account the sessions are on.
   111  *
   112  * @return A list of the media sessions on the given account.
   113  *
   114  * @since 2.6.0
   115  */
   116 GList *purple_media_manager_get_media_by_account(
   117 		PurpleMediaManager *manager, PurpleAccount *account);
   118 
   119 /**
   120  * Removes a media session from the media manager.
   121  *
   122  * @param manager The media manager to remove the media session from.
   123  * @param media The media session to remove.
   124  *
   125  * @since 2.6.0
   126  */
   127 void
   128 purple_media_manager_remove_media(PurpleMediaManager *manager,
   129 				  PurpleMedia *media);
   130 
   131 /**
   132  * Signals that output windows should be created for the chosen stream.
   133  *
   134  * This shouldn't be called outside of mediamanager.c and media.c
   135  *
   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.
   140  *
   141  * @return TRUE if it succeeded, FALSE if it failed.
   142  *
   143  * @since 2.6.0
   144  */
   145 gboolean purple_media_manager_create_output_window(
   146 		PurpleMediaManager *manager, PurpleMedia *media,
   147 		const gchar *session_id, const gchar *participant);
   148 
   149 /**
   150  * Registers a video output window to be created for a given stream.
   151  *
   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.
   157  *
   158  * @return A unique ID to the registered output window, 0 if it failed.
   159  *
   160  * @since 2.6.0
   161  */
   162 gulong purple_media_manager_set_output_window(PurpleMediaManager *manager,
   163 		PurpleMedia *media, const gchar *session_id,
   164 		const gchar *participant, gulong window_id);
   165 
   166 /**
   167  * Remove a previously registerd output window.
   168  *
   169  * @param manager The manager the output window was registered with.
   170  * @param output_window_id The ID of the output window.
   171  *
   172  * @return TRUE if it found the output window and was successful, else FALSE.
   173  *
   174  * @since 2.6.0
   175  */
   176 gboolean purple_media_manager_remove_output_window(
   177 		PurpleMediaManager *manager, gulong output_window_id);
   178 
   179 /**
   180  * Remove all output windows for a given conference/session/participant/stream.
   181  *
   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.
   186  *
   187  * @since 2.6.0
   188  */
   189 void purple_media_manager_remove_output_windows(
   190 		PurpleMediaManager *manager, PurpleMedia *media,
   191 		const gchar *session_id, const gchar *participant);
   192 
   193 /**
   194  * Sets which media caps the UI supports.
   195  *
   196  * @param manager The manager to set the caps on.
   197  * @param caps The caps to set.
   198  *
   199  * @since 2.6.0
   200  */
   201 void purple_media_manager_set_ui_caps(PurpleMediaManager *manager,
   202 		PurpleMediaCaps caps);
   203 
   204 /**
   205  * Gets which media caps the UI supports.
   206  *
   207  * @param manager The manager to get caps from.
   208  *
   209  * @return caps The caps retrieved.
   210  *
   211  * @since 2.6.0
   212  */
   213 PurpleMediaCaps purple_media_manager_get_ui_caps(PurpleMediaManager *manager);
   214 
   215 /*}@*/
   216 
   217 #ifdef __cplusplus
   218 }
   219 #endif
   220 
   221 G_END_DECLS
   222 
   223 #endif  /* _PURPLE_MEDIA_MANAGER_H_ */