#ifndef QGLOGGERDOCKWIDGET_H
#define QGLOGGERDOCKWIDGET_H

#include <QDockWidget>
#include <QTime>

#include "qglogger.h"

namespace Ui {
class QgLoggerDockWidget;
}

class QgLoggerDockWidget : public QDockWidget
{
    Q_OBJECT

public:

    explicit QgLoggerDockWidget(QWidget *parent = 0);
    ~QgLoggerDockWidget();

public slots:
    void log(const QString& str, QgLogger::LogMessageType type=QgLogger::InfoMsg, const QString& originator=QString());


private slots:
    void log_asynch(const QString& msg, QgLogger::LogMessageType type=QgLogger::InfoMsg, const QString& originator=QString());
    void onLogAsynch(const QString& msg, int rawType/*QgLogger::LogMessageType type=QgLogger::InfoMsg*/, const QString& originator=QString());

    void log_(const QString& str, QgLogger::LogMessageType type=QgLogger::InfoMsg, const QString& originator=QString());

signals:
    void log_asynch_(const QString& msg, int rawType /*QgLogger::LogMessageType type=QgLogger::InfoMsg*/, const QString& originator=QString());
private:
    Ui::QgLoggerDockWidget *ui;

    QTime loggerTime;

    class Implementation;
    Implementation& p_;
};

#endif // QGLOGGERDOCKWIDGET_H
