Files
sqlitebrowser/src/SqlUiLexer.h
Martin Kleusberg cde2393539 Use QScintilla instead of own implementation of a code editor
This is a first rough implementation of QScintilla support as SQL text
editor.

It should work mostly and build fine with qmake as well as cmake. The
new code supports all the features of the old one plus adding a few
subtle improvements. The main point of this, however, is reducing the
code we have to maintain and making it easier to add new features to the
editor.
2015-04-23 19:51:54 +02:00

42 lines
784 B
C++

#ifndef SQLUILEXER_H
#define SQLUILEXER_H
#include "Qsci/qscilexersql.h"
#include <QMap>
class QsciAPIs;
class SqlUiLexer : public QsciLexerSQL
{
Q_OBJECT
public:
explicit SqlUiLexer(QObject *parent = 0);
enum ApiCompleterIconId
{
ApiCompleterIconIdKeyword = 1,
ApiCompleterIconIdFunction,
ApiCompleterIconIdTable,
ApiCompleterIconIdColumn,
};
typedef QMap<QString, QList<QString> > TablesAndColumnsMap;
void setTableNames(const TablesAndColumnsMap& tables);
virtual const char* keywords(int set) const;
virtual QStringList autoCompletionWordSeparators() const;
private:
QsciAPIs* autocompleteApi;
void setupAutoCompletion();
QStringList listTables;
QStringList listFunctions;
};
#endif