-
Notifications
You must be signed in to change notification settings - Fork 0
/
completion.h
112 lines (95 loc) · 3.19 KB
/
completion.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
ktigcc - TIGCC IDE for KDE
Copyright (C) 2006 Kevin Kofler
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include <qobject.h>
#include <qpopupmenu.h>
#include <qmap.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qvaluelist.h>
#include <kate/view.h>
struct CompletionInfo {
CompletionInfo() : dirty(false), searched(false) {}
bool dirty;
bool searched;
QStringList includedSystem;
QStringList included;
QMap<QString,unsigned> lineNumbers;
QValueList<KTextEditor::CompletionEntry> entries;
};
// Maps file name to a CompletionInfo.
extern QMap<QString,CompletionInfo> systemHeaderCompletion, projectCompletion;
class MainForm;
bool findSymbolInFile(const QString &symbol,
const QString &fileText,
const QString &fileName,
MainForm *mainForm,
QString &symbolFile,
unsigned &symbolLine,
bool &systemHeader);
bool completionEntriesForFile(const QString &fileText,
const QString &fileName,
MainForm *mainForm,
QValueList<KTextEditor::CompletionEntry> &result);
class QWidget;
bool parseHelpSources(QWidget *parent, const QString &directory,
QMap<QString,CompletionInfo> &sysHdrCompletion);
bool parseSystemHeaders(QWidget *parent, const QString &directory,
QMap<QString,CompletionInfo> &sysHdrCompletion);
void loadSystemHeaderCompletion(void);
void saveSystemHeaderCompletion(void);
class TemplatePopup : public QPopupMenu {
Q_OBJECT
public:
TemplatePopup(Kate::View *parent);
virtual ~TemplatePopup() {}
private slots:
void QPopupMenu_activated(int id);
private:
Kate::View *view;
};
class QEvent;
class QWidget;
class CompletionPopup : public QObject {
Q_OBJECT
public:
CompletionPopup(Kate::View *parent, const QString &fileName,
MainForm *mainForm, QObject *receiver);
virtual ~CompletionPopup() {}
private slots:
void slotDone();
signals:
void closed();
protected:
bool eventFilter(QObject *o, QEvent *e);
private:
bool done;
QWidget *completionPopup;
};
class ArgHintPopup : public QObject {
Q_OBJECT
public:
ArgHintPopup(Kate::View *parent, const QString &fileName,
MainForm *mainForm);
virtual ~ArgHintPopup() {}
private slots:
void slotDone();
protected:
bool eventFilter(QObject *o, QEvent *e);
private:
bool done;
QWidget *argHintPopup;
};