aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/windows/ddlhistorywindow.h
blob: c8de66a83d6d0254f780bee2c73a9f68a9a76ed4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef DDLHISTORYWINDOW_H
#define DDLHISTORYWINDOW_H

#include "mdichild.h"

namespace Ui {
    class DdlHistoryWindow;
}

class QStringListModel;
class UserInputFilter;
class DdlHistoryModel;

class GUI_API_EXPORT DdlHistoryWindow : public MdiChild
{
        Q_OBJECT

    public:
        enum ToolBar
        {
        };

        explicit DdlHistoryWindow(QWidget *parent = 0);
        ~DdlHistoryWindow();

        bool restoreSessionNextTime();
        bool isUncommitted() const;
        QString getQuitUncommittedConfirmMessage() const;

    protected:
        void changeEvent(QEvent *e);
        QVariant saveSession();
        bool restoreSession(const QVariant& sessionValue);
        Icon* getIconNameForMdiWindow();
        QString getTitleForMdiWindow();
        void createActions();
        void setupDefShortcuts();
        QToolBar* getToolBar(int toolbar) const;

    private:
        void init();

        Ui::DdlHistoryWindow *ui = nullptr;
        QStringListModel* dbListModel = nullptr;
        DdlHistoryModel* dataModel = nullptr;
        UserInputFilter* filter = nullptr;

    private slots:
        void activated(const QModelIndex& current, const QModelIndex& previous);
        void applyFilter(const QString& filterValue);
        void refreshDbList();
        void clearHistory();
};

#endif // DDLHISTORYWINDOW_H