aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
commit7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch)
treea35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h b/SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h
new file mode 100644
index 0000000..7c933c8
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/completer/completerwindow.h
@@ -0,0 +1,64 @@
+#ifndef COMPLETERWINDOW_H
+#define COMPLETERWINDOW_H
+
+#include "expectedtoken.h"
+#include "completionhelper.h"
+#include "guiSQLiteStudio_global.h"
+#include <QDialog>
+#include <QModelIndex>
+
+namespace Ui {
+ class CompleterWindow;
+}
+
+class CompleterModel;
+class QSizeGrip;
+class SqlEditor;
+
+class GUI_API_EXPORT CompleterWindow : public QDialog
+{
+ Q_OBJECT
+
+ public:
+ explicit CompleterWindow(SqlEditor* parent = 0);
+ ~CompleterWindow();
+
+ void reset();
+ void setData(const CompletionHelper::Results& completionResults);
+ void setDb(Db* db);
+ ExpectedTokenPtr getSelected();
+ int getNumberOfCharsToRemove();
+ void shringFilterBy(int chars);
+ void extendFilterBy(const QString& text);
+ bool immediateResolution();
+
+ protected:
+ void changeEvent(QEvent *e);
+ void keyPressEvent(QKeyEvent* e);
+
+ private:
+ void updateCurrent();
+ QString getStatusMsg(const QModelIndex& index);
+ void updateFilter();
+ void init();
+
+ Ui::CompleterWindow *ui = nullptr;
+ CompleterModel* model = nullptr;
+ SqlEditor* sqlEditor = nullptr;
+ QString filter;
+ Db* db = nullptr;
+ bool wrappedFilter = false;
+
+ private slots:
+ void focusOut();
+ void doubleClicked(const QModelIndex& index);
+ void currentRowChanged(const QModelIndex& current, const QModelIndex& previous);
+
+ signals:
+ void textTyped(const QString& text);
+ void backspacePressed();
+ void leftPressed();
+ void rightPressed();
+};
+
+#endif // COMPLETERWINDOW_H