2006-03-05 17:24:44 +00:00
|
|
|
// -*- 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"
|
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
|
|
|
|
#include "ui/LogUi.h"
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QCloseEvent>
|
2007-03-26 04:25:49 +00:00
|
|
|
#include <QSyntaxHighlighter>
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-04-24 19:37:34 +00:00
|
|
|
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_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
class ControlLog;
|
2007-04-24 19:37:34 +00:00
|
|
|
class LogHighlighter;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
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();
|
2007-03-26 04:25:49 +00:00
|
|
|
/// log syntax highlighter
|
2007-04-24 19:37:34 +00:00
|
|
|
LogHighlighter * highlighter;
|
2007-03-26 04:25:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
///
|
2007-04-24 19:37:34 +00:00
|
|
|
class LogHighlighter : public QSyntaxHighlighter
|
2007-03-26 04:25:49 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-04-24 19:37:34 +00:00
|
|
|
LogHighlighter(QTextDocument * parent);
|
2007-03-26 04:25:49 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void highlightBlock(QString const & text);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QTextCharFormat infoFormat;
|
|
|
|
QTextCharFormat warningFormat;
|
|
|
|
QTextCharFormat errorFormat;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2007-03-26 04:25:49 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QLOG_H
|