melunko@250: /**
melunko@250: * GMyth Library
melunko@250: *
melunko@250: * @file gmyth/gmyth_upnp.h
melunko@250: *
melunko@250: * @brief
GMythUPnP allows that a MythTV frontend discovers a
melunko@250: * MythTV backend, using the UPnP architecture.
melunko@250: *
melunko@250: * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
melunko@250: * @author Rosfran Lins Borges
melunko@250: *
melunko@250: * This program is free software; you can redistribute it and/or modify
melunko@250: * it under the terms of the GNU Lesser General Public License as published by
melunko@250: * the Free Software Foundation; either version 2 of the License, or
melunko@250: * (at your option) any later version.
melunko@250: *
melunko@250: * This program is distributed in the hope that it will be useful,
melunko@250: * but WITHOUT ANY WARRANTY; without even the implied warranty of
melunko@250: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
melunko@250: * GNU General Public License for more details.
melunko@250: *
melunko@250: * You should have received a copy of the GNU Lesser General Public License
melunko@250: * along with this program; if not, write to the Free Software
melunko@250: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
melunko@250: *
melunko@250: */
melunko@250:
melunko@250: #ifndef _GMYTH_UPNP_H_
melunko@250: #define _GMYTH_UPNP_H_
melunko@250:
melunko@250: #include
melunko@250: #include
melunko@250:
melunko@250: #include
melunko@250: #include
melunko@250: #include
melunko@250:
melunko@250: #include
rosfran@260: #include
melunko@250:
melunko@250: G_BEGIN_DECLS
melunko@250: #define GMYTH_UPNP_TYPE (gmyth_upnp_get_type ())
melunko@250: #define GMYTH_UPNP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_UPNP_TYPE, GMythUPnP))
melunko@250: #define GMYTH_UPNP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_UPNP_TYPE, GMythUPnPClass))
melunko@250: #define IS_GMYTH_UPNP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_UPNP_TYPE))
melunko@250: #define IS_GMYTH_UPNP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_UPNP_TYPE))
melunko@250: #define GMYTH_UPNP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_UPNP_TYPE, GMythUPnPClass))
renatofilho@754: typedef struct _GMythUPnP GMythUPnP;
renatofilho@754: typedef struct _GMythUPnPClass GMythUPnPClass;
renatofilho@754: typedef struct _GMythUPnPPrivate GMythUPnPPrivate;
melunko@250:
melunko@250: /****************************************
melunko@250: * Data Type
melunko@250: ****************************************/
melunko@250:
rosfran@696: typedef enum upnp_device_list_status {
renatofilho@754: GMYTH_UPNP_DEVICE_ADDED = 0,
renatofilho@754: GMYTH_UPNP_DEVICE_UPDATED,
renatofilho@754: GMYTH_UPNP_DEVICE_REMOVED
rosfran@696: } GMythUPnPDeviceStatus;
rosfran@696:
renatofilho@754: typedef void (*GMythUPnPDeviceListener) (GMythUPnP * gmyth_upnp,
renatofilho@754: GMythUPnPDeviceStatus status,
renatofilho@754: gchar * dev);
rosfran@696:
renatofilho@754: struct _GMythUPnPClass {
renatofilho@754: GObjectClass parent_class;
melunko@250:
renatofilho@754: /*
renatofilho@754: * callbacks
renatofilho@754: */
renatofilho@754: guint device_found_handler_signal_id;
rosfran@696:
renatofilho@754: GMythUPnPDeviceListener device_found_handler;
rosfran@696:
renatofilho@754: /*
renatofilho@754: * no one for now
renatofilho@754: */
melunko@250: };
melunko@250:
rosfran@696: struct _GMythUPnPDevice {
renatofilho@754: gchar *uri;
renatofilho@754: gchar *host;
renatofilho@754: gint port;
renatofilho@754: gchar *protocol;
rosfran@696: };
rosfran@696:
rosfran@696: typedef struct _GMythUPnPDevice GMythUPnPDevice;
rosfran@696:
melunko@250: struct _GMythUPnP {
rosfran@696:
renatofilho@754: GObject parent;
renatofilho@754: GMythUPnPPrivate *priv;
rosfran@696:
renatofilho@754:
renatofilho@754: CgUpnpControlPoint *control_point;
renatofilho@754:
renatofilho@754: gchar *udn;
renatofilho@754:
renatofilho@754: GMythBackendInfo *backend_info;
renatofilho@754:
renatofilho@754: gboolean upnp_dev_found;
melunko@250: };
melunko@250:
renatofilho@754: GType gmyth_upnp_get_type(void);
renatofilho@754: GMythUPnP *gmyth_upnp_new(GMythBackendInfo * gmyth_backend_info,
renatofilho@754: GMythUPnPDeviceListener handler);
rosfran@699:
renatofilho@754: GList *gmyth_upnp_do_search_sync(GMythUPnP * gmyth_upnp);
rosfran@699:
renatofilho@754: GMythBackendInfo *gmyth_upnp_get_backend_info(GMythUPnP * gmyth_upnp);
melunko@250:
renatofilho@754: gchar *gmyth_upnp_device_status_to_string(GMythUPnPDeviceStatus
renatofilho@754: status);
rosfran@706:
melunko@250: G_END_DECLS
renatofilho@754: #endif /* _GMYTH_UPNP_H_ */