pgLab/pglab/SqlCodePreview.h
eelke f0c1035378 Reorganize files in pglablib
The enitities and containers of the catalog now go into catalog subfolder
Models go into model
2018-12-16 11:31:33 +01:00

30 lines
762 B
C++

#ifndef SQLCODEPREVIEW_H
#define SQLCODEPREVIEW_H
#include "catalog/PgDatabaseCatalog.h"
#include <QPlainTextEdit>
#include <memory>
class SqlSyntaxHighlighter;
class PgDatabaseCatalog;
class SqlCodePreview : public QPlainTextEdit {
Q_OBJECT
public:
SqlCodePreview(QWidget *parent = nullptr);
/** Sets the database catalog that the syntax highlighter is to use.
*/
void setCatalog(std::shared_ptr<const PgDatabaseCatalog> catalog);
SqlSyntaxHighlighter *highlighter() { return m_highlighter; }
private:
SqlSyntaxHighlighter *m_highlighter = nullptr;
std::shared_ptr<const PgDatabaseCatalog> m_catalog;
private slots:
void catalogRefresh(const PgDatabaseCatalog *catalog, PgDatabaseCatalog::RefreshFlags flags);
};
#endif // SQLCODEPREVIEW_H