-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwingcompleter.h
More file actions
60 lines (46 loc) · 1.59 KB
/
wingcompleter.h
File metadata and controls
60 lines (46 loc) · 1.59 KB
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
56
57
58
59
60
/****************************************************************************
**
** Copyright (C) 2025-2028 WingSummer
**
** This file may be used under the terms of the GNU General Public License
** version 3 as published by the Free Software Foundation.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** You should have received a copy of the GNU General Public License version 3
** along with this program. If not, see <https://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef WINGCOMPLETER_H
#define WINGCOMPLETER_H
#include <QCompleter>
#include <QSortFilterProxyModel>
#include <QTextCursor>
class WingCodeEdit;
class WingCodePopup;
class WingCompleter : public QCompleter {
Q_OBJECT
public:
explicit WingCompleter(WingCodeEdit *editor);
virtual ~WingCompleter();
public:
QStringList triggerList() const;
qint32 triggerAmount() const;
void setTriggerAmount(qint32 newTriggerAmount);
virtual QString wordSeperators() const;
bool enabled() const;
void setEnabled(bool newEnabled);
public slots:
void setTriggerList(const QStringList &triggers);
void trigger(const QString &trigger, const QString &content,
const QRect &cursorRect);
protected:
virtual bool processTrigger(const QString &trigger, const QString &content);
private:
WingCodePopup *m_popUp;
QStringList m_triggerList;
qint32 m_triggerAmount;
bool _enabled = true;
};
#endif // WINGCOMPLETER_H