Changeset View
Changeset View
Standalone View
Standalone View
addons/kate-ctags/kate_ctags_view.h
Show All 15 Lines | |||||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * General Public License for more details. | 18 | * General Public License for more details. | ||
19 | * | 19 | * | ||
20 | * You should have received a copy of the GNU General Public | 20 | * You should have received a copy of the GNU General Public | ||
21 | * License along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | * License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | */ | 22 | */ | ||
23 | 23 | | |||
24 | | ||||
25 | #include <KTextEditor/View> | 24 | #include <KTextEditor/View> | ||
26 | #include <KTextEditor/Document> | 25 | #include <KTextEditor/Document> | ||
27 | 26 | | |||
28 | #include <KTextEditor/Application> | 27 | #include <KTextEditor/Application> | ||
29 | #include <KTextEditor/MainWindow> | 28 | #include <KTextEditor/MainWindow> | ||
30 | #include <ktexteditor/sessionconfiginterface.h> | 29 | #include <ktexteditor/sessionconfiginterface.h> | ||
31 | 30 | | |||
32 | #include <QProcess> | 31 | #include <QProcess> | ||
33 | #include <KXMLGUIClient> | 32 | #include <KXMLGUIClient> | ||
34 | 33 | | |||
35 | #include <QStack> | 34 | #include <QStack> | ||
36 | #include <QTimer> | 35 | #include <QTimer> | ||
37 | #include <KActionMenu> | | |||
38 | #include <QPointer> | 36 | #include <QPointer> | ||
39 | 37 | | |||
40 | #include "tags.h" | 38 | #include "tags.h" | ||
41 | 39 | | |||
42 | #include "ui_kate_ctags.h" | 40 | #include "ui_kate_ctags.h" | ||
43 | 41 | | |||
44 | const static QString DEFAULT_CTAGS_CMD = QLatin1String("ctags -R --c++-types=+px --extra=+q --excmd=pattern --exclude=Makefile --exclude=."); | 42 | const static QString DEFAULT_CTAGS_CMD = QLatin1String("ctags -R --c++-types=+px --extra=+q --excmd=pattern --exclude=Makefile --exclude=."); | ||
45 | 43 | | |||
46 | typedef struct | 44 | typedef struct | ||
47 | { | 45 | { | ||
48 | QUrl url; | 46 | QUrl url; | ||
49 | KTextEditor::Cursor cursor; | 47 | KTextEditor::Cursor cursor; | ||
50 | } TagJump; | 48 | } TagJump; | ||
51 | 49 | | |||
52 | /******************************************************************/ | | |||
53 | class KateCTagsView : public QObject, public KXMLGUIClient, public KTextEditor::SessionConfigInterface | 50 | class KateCTagsView : public QObject, public KXMLGUIClient, public KTextEditor::SessionConfigInterface | ||
54 | { | 51 | { | ||
55 | Q_OBJECT | 52 | Q_OBJECT | ||
56 | Q_INTERFACES(KTextEditor::SessionConfigInterface) | 53 | Q_INTERFACES(KTextEditor::SessionConfigInterface) | ||
57 | 54 | | |||
58 | public: | 55 | public: | ||
59 | KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin); | 56 | KateCTagsView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainWin); | ||
60 | ~KateCTagsView() override; | 57 | ~KateCTagsView() override; | ||
61 | 58 | | |||
62 | // reimplemented: read and write session config | 59 | // reimplemented: read and write session config | ||
63 | void readSessionConfig (const KConfigGroup& config) override; | 60 | void readSessionConfig (const KConfigGroup& config) override; | ||
64 | void writeSessionConfig (KConfigGroup& config) override; | 61 | void writeSessionConfig (KConfigGroup& config) override; | ||
65 | 62 | | |||
66 | public Q_SLOTS: | 63 | public Q_SLOTS: | ||
67 | void gotoDefinition(); | 64 | void gotoDefinition(); | ||
68 | void gotoDeclaration(); | 65 | void gotoDeclaration(); | ||
69 | void lookupTag(); | 66 | void lookupTag(); | ||
70 | void stepBack(); | 67 | void stepBack(); | ||
71 | void editLookUp(); | 68 | void editLookUp(); | ||
72 | void aboutToShow(); | | |||
73 | void tagHitClicked(QTreeWidgetItem *); | 69 | void tagHitClicked(QTreeWidgetItem *); | ||
74 | void startEditTmr(); | 70 | void startEditTmr(); | ||
75 | 71 | | |||
76 | void addTagTarget(); | 72 | void addTagTarget(); | ||
77 | void delTagTarget(); | 73 | void delTagTarget(); | ||
78 | 74 | | |||
79 | void updateSessionDB(); | 75 | void updateSessionDB(); | ||
80 | void updateDone(int exitCode, QProcess::ExitStatus status); | 76 | void updateDone(int exitCode, QProcess::ExitStatus status); | ||
Show All 11 Lines | 85 | private: | |||
92 | QString currentWord(); | 88 | QString currentWord(); | ||
93 | 89 | | |||
94 | void setNewLookupText(const QString &newText); | 90 | void setNewLookupText(const QString &newText); | ||
95 | void displayHits(const Tags::TagList &list); | 91 | void displayHits(const Tags::TagList &list); | ||
96 | 92 | | |||
97 | void gotoTagForTypes(const QString &tag, QStringList const &types); | 93 | void gotoTagForTypes(const QString &tag, QStringList const &types); | ||
98 | void jumpToTag(const QString &file, const QString &pattern, const QString &word); | 94 | void jumpToTag(const QString &file, const QString &pattern, const QString &word); | ||
99 | 95 | | |||
100 | | ||||
101 | KTextEditor::MainWindow *m_mWin; | 96 | KTextEditor::MainWindow *m_mWin; | ||
102 | QWidget *m_toolView; | 97 | QWidget *m_toolView; | ||
103 | Ui::kateCtags m_ctagsUi; | 98 | Ui::kateCtags m_ctagsUi; | ||
104 | 99 | | |||
105 | QPointer<KActionMenu> m_menu; | | |||
106 | QAction *m_gotoDef; | | |||
107 | QAction *m_gotoDec; | | |||
108 | QAction *m_lookup; | | |||
109 | | ||||
110 | QProcess m_proc; | 100 | QProcess m_proc; | ||
111 | QString m_commonDB; | 101 | QString m_commonDB; | ||
112 | 102 | | |||
113 | QTimer m_editTimer; | 103 | QTimer m_editTimer; | ||
114 | QStack<TagJump> m_jumpStack; | 104 | QStack<TagJump> m_jumpStack; | ||
115 | }; | 105 | }; | ||
116 | 106 | | |||
117 | | ||||
118 | #endif | 107 | #endif | ||
119 | 108 | |