/*****************************************************************************
 *
 *  widgetbridge.cpp -- Communication bridge within widgets which can 
 *                    communicate without knowing each others (ensure nice
 *                    independant widget implementation).
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the Gui4 module of the DVDx 4 application.
 *
 *  GNU Lesser General Public License Usage
 *  This file may be used under the terms of the GNU Lesser General
 *  Public License version 2.1 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.LGPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU Lesser General Public License version 2.1 requirements
 *  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 *
 *  GNU General Public License Usage
 *  Alternatively, this file may be used under the terms of the GNU
 *  General Public License version 3.0 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.GPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU General Public License version 3.0 requirements will be
 *  met: http://www.gnu.org/copyleft/gpl.html.
 *
 *****************************************************************************/

#include "widgetbridge.h"

WidgetBridge::WidgetBridge() 
{
};

WidgetBridge::~WidgetBridge() 
{
};

WidgetBridge *WidgetBridge::getIt()
{
	if ( singleton == 0 )
	{
		singleton = new WidgetBridge;  // only one instance can be created
	}

	return singleton;
};

void WidgetBridge::sendData(const QString &message) 
{
	emit sendMessage(message);
}; 

void WidgetBridge::sendData(const QString &message, const bool data) 
{
	emit sendMessage(message, data);
}; 

void WidgetBridge::sendData(const QString &message, const int data) 
{
	emit sendMessage(message, data);
}; 

void WidgetBridge::sendData(const QString &message, const double data) 
{
	emit sendMessage(message, data);
}; 

void WidgetBridge::sendData(const QString &message, const QString data) 
{
	emit sendMessage(message, data);
}; 

void WidgetBridge::sendData(const QString &message, const QStringList data) 
{
	emit sendMessage(message, data);
}; 

void WidgetBridge::sendData(const QString &message, void *data) 
{
	emit sendMessage(message, data);
}; 

// Singleton static member must be initialized
WidgetBridge *WidgetBridge::singleton = 0;