0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-26 09:28:11 +03:00
LimeReport/limereport/scripteditor/lrscripteditor.h

55 lines
1.3 KiB
C
Raw Normal View History

2017-09-13 17:16:54 +03:00
#ifndef LRSCRIPTEDITOR_H
#define LRSCRIPTEDITOR_H
#include <QWidget>
#include <QCompleter>
#include <QTextEdit>
#include <QKeyEvent>
#include <QScrollBar>
namespace LimeReport{
class ReportEnginePrivate;
class BaseDesignIntf;
2017-09-21 00:44:09 +03:00
class PageDesignIntf;
class BandDesignIntf;
2017-09-13 17:16:54 +03:00
namespace Ui {
class ScriptEditor;
}
class ScriptEditor : public QWidget
{
Q_OBJECT
public:
explicit ScriptEditor(QWidget *parent = 0);
~ScriptEditor();
void setReportEngine(ReportEnginePrivate* reportEngine);
2017-09-21 00:44:09 +03:00
void setReportPage(PageDesignIntf* page);
void setPageBand(BandDesignIntf* band);
2017-09-13 17:16:54 +03:00
void initCompleter();
2017-09-20 00:51:17 +03:00
QByteArray saveState();
void restoreState(QByteArray state);
void setPlainText(const QString &text);
2017-09-21 00:44:09 +03:00
void setEditorFont(QFont font);
QFont editorFont();
2017-09-20 00:51:17 +03:00
QString toPlainText();
2017-09-21 00:44:09 +03:00
signals:
void splitterMoved(int, int);
2017-09-20 00:51:17 +03:00
private slots:
void on_twData_doubleClicked(const QModelIndex &index);
void on_twScriptEngine_doubleClicked(const QModelIndex &index);
2017-09-13 17:16:54 +03:00
private:
void addItemToCompleater(const QString& pageName, BaseDesignIntf* item, QStringList& dataWords);
private:
Ui::ScriptEditor *ui;
ReportEnginePrivate* m_reportEngine;
2017-09-21 00:44:09 +03:00
PageDesignIntf* m_page;
2017-09-13 17:16:54 +03:00
QCompleter* m_completer;
};
} // namespace LimeReport
#endif // LRSCRIPTEDITOR_H