/***************************************************************************
 *   Copyright (C) 2008 by SK Communications.                              *
 *   http://kldp.net/projects/nateon/                                      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program 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 General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "linklabel.h"

LinkLabel::LinkLabel(QWidget *parent, const char *name)
	: QLabel(parent, name), bEnable(true)
{
	_ov = QColor( 0, 0, 0 );
	_lv = QColor( 255, 255, 255 );
}

LinkLabel::~LinkLabel()
{
}

void LinkLabel::setDisabled()
{
	bEnable = false;
}

void LinkLabel::setEnabled()
{
	bEnable = true;
}

void LinkLabel::mousePressEvent(QMouseEvent *)
{
#if 0
	grabMouse();
	repaint();
#endif
}

void LinkLabel::mouseReleaseEvent(QMouseEvent *)
{
#if 0
	releaseMouse();
	repaint();
#endif
	emit clicked();
}

void LinkLabel::enterEvent(QEvent *)
{
	setPaletteForegroundColor( _ov );
	repaint();
}

void LinkLabel::leaveEvent(QEvent *)
{
	setPaletteForegroundColor( _lv );
	repaint();
}

void LinkLabel::setMouseOverColor(QColor color)
{
	_ov = color;
}

void LinkLabel::setMouseLeaveColor(QColor color)
{
	_lv = color;
}

void LinkLabel::init()
{
	setPaletteForegroundColor( _lv );
}


#include "linklabel.moc"
