lyx_mirror/src/frontends/qt4/QLog.h
André Pönitz 24bb9669a5 more Foo/FooDialog merge
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17956 a592a061-630c-0410-9148-cb99ea01b6c8
2007-04-24 19:37:34 +00:00

86 lines
1.4 KiB
C++

// -*- C++ -*-
/**
* \file QLog.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QLOG_H
#define QLOG_H
#include "QDialogView.h"
#include "ui/LogUi.h"
#include <QDialog>
#include <QCloseEvent>
#include <QSyntaxHighlighter>
namespace lyx {
namespace frontend {
class QLog;
class QLogDialog : public QDialog, public Ui::QLogUi {
Q_OBJECT
public:
QLogDialog(QLog * form);
protected Q_SLOTS:
virtual void updateClicked();
protected:
virtual void closeEvent(QCloseEvent * e);
private:
QLog * form_;
};
class ControlLog;
class LogHighlighter;
///
class QLog
: public QController<ControlLog, QView<QLogDialog> >
{
public:
///
friend class QLogDialog;
///
QLog(Dialog &);
private:
/// Apply changes
virtual void apply() {}
/// update
virtual void update_contents();
/// build the dialog
virtual void build_dialog();
/// log syntax highlighter
LogHighlighter * highlighter;
};
///
class LogHighlighter : public QSyntaxHighlighter
{
public:
LogHighlighter(QTextDocument * parent);
protected:
void highlightBlock(QString const & text);
private:
QTextCharFormat infoFormat;
QTextCharFormat warningFormat;
QTextCharFormat errorFormat;
};
} // namespace frontend
} // namespace lyx
#endif // QLOG_H