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: *//*
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:
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))
melunko@250:
melunko@250: typedef struct _GMythUPnP GMythUPnP;
melunko@250: typedef struct _GMythUPnPClass GMythUPnPClass;
rosfran@696: typedef struct _GMythUPnPPrivate GMythUPnPPrivate;
melunko@250:
melunko@250: /****************************************
melunko@250: * Data Type
melunko@250: ****************************************/
melunko@250:
rosfran@696: typedef enum upnp_device_list_status {
rosfran@696: GMYTH_UPNP_DEVICE_ADDED = 0,
rosfran@699: GMYTH_UPNP_DEVICE_UPDATED,
rosfran@699: GMYTH_UPNP_DEVICE_REMOVED
rosfran@696: } GMythUPnPDeviceStatus;
rosfran@696:
rosfran@700: typedef void (*GMythUPnPDeviceListener) ( GMythUPnP *gmyth_upnp, GMythUPnPDeviceStatus status, gchar *dev, gpointer obj );
rosfran@696:
melunko@250: struct _GMythUPnPClass
melunko@250: {
rosfran@696: GObjectClass parent_class;
melunko@250:
rosfran@696: /* callbacks */
rosfran@696: guint device_found_handler_signal_id;
rosfran@696:
rosfran@696: GMythUPnPDeviceListener device_found_handler;
rosfran@696:
rosfran@696: /* no one for now */
melunko@250: };
melunko@250:
rosfran@696: struct _GMythUPnPDevice {
rosfran@696: gchar *uri;
rosfran@696: gchar *host;
rosfran@696: gint port;
rosfran@696: gchar *protocol;
rosfran@696: };
rosfran@696:
rosfran@696: typedef struct _GMythUPnPDevice GMythUPnPDevice;
rosfran@696:
melunko@250: struct _GMythUPnP {
melunko@250:
melunko@250: GObject parent;
rosfran@696: GMythUPnPPrivate *priv;
melunko@250:
rosfran@696:
melunko@250: CgUpnpControlPoint* control_point;
melunko@250:
melunko@250: gchar *udn;
melunko@250:
rosfran@696: GMythBackendInfo *backend_info;
rosfran@696:
melunko@250: gboolean upnp_dev_found;
melunko@250: };
melunko@250:
melunko@250: GType gmyth_upnp_get_type (void);
rosfran@696: GMythUPnP * gmyth_upnp_new ( GMythBackendInfo *gmyth_backend_info,
rosfran@696: GMythUPnPDeviceListener handler );
rosfran@699:
rosfran@699: GList * gmyth_upnp_do_search_sync( GMythUPnP* gmyth_upnp );
rosfran@699:
rosfran@696: GMythBackendInfo* gmyth_upnp_get_backend_info ( GMythUPnP *gmyth_upnp );
melunko@250:
melunko@250: G_END_DECLS
melunko@250:
melunko@250: #endif /* _GMYTH_UPNP_H_ */