Changeset View
Changeset View
Standalone View
Standalone View
completion/keyworditem.h
Show All 38 Lines | 34 | public: | |||
---|---|---|---|---|---|
39 | /// | 39 | /// | ||
40 | /// NOTE: By default (i.e. when this function never gets called) @p keyword will be used as replacement. | 40 | /// NOTE: By default (i.e. when this function never gets called) @p keyword will be used as replacement. | ||
41 | explicit KeywordItem(const QString &keyword, | 41 | explicit KeywordItem(const QString &keyword, | ||
42 | QExplicitlySharedDataPointer<Php::CodeCompletionContext> context = {}, | 42 | QExplicitlySharedDataPointer<Php::CodeCompletionContext> context = {}, | ||
43 | const QString &customReplacement = QString()) | 43 | const QString &customReplacement = QString()) | ||
44 | : NormalDeclarationCompletionItem(KDevelop::DeclarationPointer(), context, 0), | 44 | : NormalDeclarationCompletionItem(KDevelop::DeclarationPointer(), context, 0), | ||
45 | m_keyword(keyword), m_replacement(customReplacement) {} | 45 | m_keyword(keyword), m_replacement(customReplacement) {} | ||
46 | 46 | | |||
47 | virtual void execute(KTextEditor::View* view, | 47 | void execute(KTextEditor::View* view, | ||
48 | const KTextEditor::Range& word) override; | 48 | const KTextEditor::Range& word) override; | ||
49 | 49 | | |||
50 | virtual QVariant data(const QModelIndex& index, | 50 | QVariant data(const QModelIndex& index, | ||
51 | int role, | 51 | int role, | ||
52 | const KDevelop::CodeCompletionModel* model) const override; | 52 | const KDevelop::CodeCompletionModel* model) const override; | ||
53 | 53 | | |||
54 | private: | 54 | private: | ||
55 | const QString m_keyword; | 55 | const QString m_keyword; | ||
56 | QString m_replacement; | 56 | QString m_replacement; | ||
57 | }; | 57 | }; | ||
58 | 58 | | |||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | #endif // KEYWORDITEM_H | 61 | #endif // KEYWORDITEM_H |