/*****************************************************************************
 *
 *  advancedmonitorwidget.h -- Show and control advanced monitoring data.
 *
 *  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.
 *
 *  Notes: the first Widget parameter is the console reference to resize and 
 *  move when the second Widget parameter is 0 (case of no parent Widget so 
 *  display the monitor in its own window.
 *
 *****************************************************************************/

#ifndef ADVANCEDMONITORWIDGET_H
#define ADVANCEDMONITORWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QTextEdit>
#include <QStringList>

struct attachedLog_t
{
	QTextEdit *log;
	QTextEdit *attached;
	QLabel *label;
};

class AdvancedMonitorWidget: public QWidget
{
	Q_OBJECT

public:
	AdvancedMonitorWidget(QWidget *, QWidget *);

    void resetAppearance(QWidget *);
	void addLog(const QString, QTextEdit *);
	void setLineWrapMode(QTextEdit *, QTextEdit::LineWrapMode);
	void setVerbosity(const int);
	void showLog(QTextEdit *);
	void hideLog(QTextEdit *);
	void reset();  // empty log list and detach signals
	void clearChannels();

signals:
	void hidden();
	void visible();

private slots:
	void updateLog();

private:
	void hideEvent(QHideEvent *);
	void showEvent(QShowEvent *);

private:
	QList<attachedLog_t> logs;
};

#endif
