Changeset View
Changeset View
Standalone View
Standalone View
plugins/scratchpad/scratchpadview.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | * | ||||
3 | * Copyright 2018 Amish K. Naidu <amhndu@gmail.com> | ||||
4 | * | ||||
5 | * This program is free software; you can redistribute it and/or | ||||
6 | * modify it under the terms of the GNU General Public License | ||||
7 | * as published by the Free Software Foundation; either version 2 | ||||
8 | * of the License, or (at your option) any later version. | ||||
9 | * | ||||
10 | * This program is distributed in the hope that it will be useful, | ||||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
13 | * GNU General Public License for more details. | ||||
14 | * | ||||
15 | * You should have received a copy of the GNU General Public License | ||||
16 | * along with this program; if not, write to the Free Software | ||||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||||
18 | * 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef SCRATCHPADVIEW_H | ||||
22 | #define SCRATCHPADVIEW_H | ||||
23 | | ||||
24 | #include <QWidget> | ||||
25 | | ||||
26 | #include <vector> | ||||
27 | | ||||
28 | #include "ui_scratchpadview.h" | ||||
29 | | ||||
30 | class Scratchpad; | ||||
31 | | ||||
32 | class QModelIndex; | ||||
33 | class QLineEdit; | ||||
34 | class QAbstractProxyModel; | ||||
35 | | ||||
36 | class ScratchpadView | ||||
37 | : public QWidget | ||||
38 | , public Ui::ScratchpadBaseView | ||||
39 | { | ||||
40 | Q_OBJECT | ||||
41 | | ||||
42 | public: | ||||
43 | ScratchpadView(QWidget* parent, Scratchpad* scratchpad); | ||||
44 | | ||||
45 | private Q_SLOTS: | ||||
46 | void runSelectedScratch(); | ||||
47 | void scratchActivated(const QModelIndex& index); | ||||
48 | void createScratch(); | ||||
49 | | ||||
50 | private: | ||||
51 | QAbstractProxyModel* proxyModel() const; | ||||
52 | QModelIndex currentIndex() const; | ||||
53 | | ||||
54 | void setupActions(); | ||||
55 | void validateItemActions(); | ||||
56 | | ||||
57 | Scratchpad* m_scratchpad; | ||||
58 | QLineEdit* m_filter = nullptr; | ||||
59 | QVector<QAction*> m_itemActions; | ||||
60 | }; | ||||
61 | | ||||
62 | #endif // SCRATCHPADVIEW_H |