/* rygel-ruih-server-plugin.c generated by valac 0.30.0, the Vala compiler
 * generated from rygel-ruih-server-plugin.vala, do not modify */

/*
 * Copyright (C) 2013  Cable Television Laboratories, Inc.
 *
 * Author: Neha Shanbhag <N.Shanbhag@cablelabs.com>
 * Contact: http://www.cablelabs.com/
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <rygel-core.h>
#include <stdlib.h>
#include <string.h>
#include <config.h>
#include <libgupnp/gupnp.h>


#define RYGEL_TYPE_RUIH_SERVER_PLUGIN (rygel_ruih_server_plugin_get_type ())
#define RYGEL_RUIH_SERVER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_RUIH_SERVER_PLUGIN, RygelRuihServerPlugin))
#define RYGEL_RUIH_SERVER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_RUIH_SERVER_PLUGIN, RygelRuihServerPluginClass))
#define RYGEL_IS_RUIH_SERVER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_RUIH_SERVER_PLUGIN))
#define RYGEL_IS_RUIH_SERVER_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_RUIH_SERVER_PLUGIN))
#define RYGEL_RUIH_SERVER_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_RUIH_SERVER_PLUGIN, RygelRuihServerPluginClass))

typedef struct _RygelRuihServerPlugin RygelRuihServerPlugin;
typedef struct _RygelRuihServerPluginClass RygelRuihServerPluginClass;
typedef struct _RygelRuihServerPluginPrivate RygelRuihServerPluginPrivate;

#define RYGEL_TYPE_RUIH_SERVICE (rygel_ruih_service_get_type ())
#define RYGEL_RUIH_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TYPE_RUIH_SERVICE, RygelRuihService))
#define RYGEL_RUIH_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TYPE_RUIH_SERVICE, RygelRuihServiceClass))
#define RYGEL_IS_RUIH_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TYPE_RUIH_SERVICE))
#define RYGEL_IS_RUIH_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TYPE_RUIH_SERVICE))
#define RYGEL_RUIH_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TYPE_RUIH_SERVICE, RygelRuihServiceClass))

typedef struct _RygelRuihService RygelRuihService;
typedef struct _RygelRuihServiceClass RygelRuihServiceClass;
#define _rygel_resource_info_unref0(var) ((var == NULL) ? NULL : (var = (rygel_resource_info_unref (var), NULL)))

struct _RygelRuihServerPlugin {
	RygelPlugin parent_instance;
	RygelRuihServerPluginPrivate * priv;
};

struct _RygelRuihServerPluginClass {
	RygelPluginClass parent_class;
};


static gpointer rygel_ruih_server_plugin_parent_class = NULL;

GType rygel_ruih_server_plugin_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_RUIH_SERVER_PLUGIN_DUMMY_PROPERTY
};
#define RYGEL_RUIH_SERVER_PLUGIN_RUIH_SERVER_DESC_PATH DATA_DIR "/xml/RuihServer2.xml"
#define RYGEL_RUIH_SERVER_PLUGIN_RUIH "urn:schemas-upnp-org:device:RemoteUIServer"
RygelRuihServerPlugin* rygel_ruih_server_plugin_new (const gchar* name, const gchar* title, const gchar* description, RygelPluginCapabilities capabilities);
RygelRuihServerPlugin* rygel_ruih_server_plugin_construct (GType object_type, const gchar* name, const gchar* title, const gchar* description, RygelPluginCapabilities capabilities);
static void rygel_ruih_server_plugin_real_constructed (GObject* base);
#define RYGEL_RUIH_SERVICE_UPNP_ID "urn:upnp-org:serviceId:RemoteUIServer"
#define RYGEL_RUIH_SERVICE_UPNP_TYPE "urn:schemas-upnp-org:service:RemoteUIServer:1"
#define RYGEL_RUIH_SERVICE_DESCRIPTION_PATH "xml/RemoteUIServerService.xml"
GType rygel_ruih_service_get_type (void) G_GNUC_CONST;


/**
     * Create an instance of the plugin.
     *
     * @param name The non-human-readable name for the plugin, used in UPnP
     * messages and in the Rygel configuration file.
     * @param title An optional human-readable name (friendlyName) of the UPnP
     * RUIH server provided by the plugin. If the title is empty then the name
     * will be used.
     * @param description An optional human-readable description
     * (modelDescription) of the UPnP RUIH server provided by the plugin.
     */
RygelRuihServerPlugin* rygel_ruih_server_plugin_construct (GType object_type, const gchar* name, const gchar* title, const gchar* description, RygelPluginCapabilities capabilities) {
	RygelRuihServerPlugin * self = NULL;
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	RygelPluginCapabilities _tmp3_ = 0;
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = name;
	_tmp1_ = title;
	_tmp2_ = description;
	_tmp3_ = capabilities;
	self = (RygelRuihServerPlugin*) g_object_new (object_type, "desc-path", RYGEL_RUIH_SERVER_PLUGIN_RUIH_SERVER_DESC_PATH, "name", _tmp0_, "title", _tmp1_, "description", _tmp2_, "capabilities", _tmp3_, NULL);
	return self;
}


RygelRuihServerPlugin* rygel_ruih_server_plugin_new (const gchar* name, const gchar* title, const gchar* description, RygelPluginCapabilities capabilities) {
	return rygel_ruih_server_plugin_construct (RYGEL_TYPE_RUIH_SERVER_PLUGIN, name, title, description, capabilities);
}


static void rygel_ruih_server_plugin_real_constructed (GObject* base) {
	RygelRuihServerPlugin * self;
	RygelResourceInfo* resource = NULL;
	RygelResourceInfo* _tmp0_ = NULL;
	self = (RygelRuihServerPlugin*) base;
	G_OBJECT_CLASS (rygel_ruih_server_plugin_parent_class)->constructed ((GObject*) G_TYPE_CHECK_INSTANCE_CAST (self, RYGEL_TYPE_PLUGIN, RygelPlugin));
	_tmp0_ = rygel_resource_info_new (RYGEL_RUIH_SERVICE_UPNP_ID, RYGEL_RUIH_SERVICE_UPNP_TYPE, RYGEL_RUIH_SERVICE_DESCRIPTION_PATH, RYGEL_TYPE_RUIH_SERVICE);
	resource = _tmp0_;
	rygel_plugin_add_resource ((RygelPlugin*) self, resource);
	_rygel_resource_info_unref0 (resource);
}


static void rygel_ruih_server_plugin_class_init (RygelRuihServerPluginClass * klass) {
	rygel_ruih_server_plugin_parent_class = g_type_class_peek_parent (klass);
	((GObjectClass *) klass)->constructed = rygel_ruih_server_plugin_real_constructed;
}


static void rygel_ruih_server_plugin_instance_init (RygelRuihServerPlugin * self) {
}


/**
 * This is the base class for every Rygel UPnP Ruih plugin.
 *
 * This class is useful when implementing Rygel Ruih Server plugins.
 *
 */
GType rygel_ruih_server_plugin_get_type (void) {
	static volatile gsize rygel_ruih_server_plugin_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_ruih_server_plugin_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelRuihServerPluginClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_ruih_server_plugin_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelRuihServerPlugin), 0, (GInstanceInitFunc) rygel_ruih_server_plugin_instance_init, NULL };
		GType rygel_ruih_server_plugin_type_id;
		rygel_ruih_server_plugin_type_id = g_type_register_static (RYGEL_TYPE_PLUGIN, "RygelRuihServerPlugin", &g_define_type_info, 0);
		g_once_init_leave (&rygel_ruih_server_plugin_type_id__volatile, rygel_ruih_server_plugin_type_id);
	}
	return rygel_ruih_server_plugin_type_id__volatile;
}



