• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • completion
katekeywordcompletion.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2014 Sven Brauch <svenbrauch@gmail.com>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2, or any later version,
7  as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef KATEKEYWORDCOMPLETIONMODEL_H
21 #define KATEKEYWORDCOMPLETIONMODEL_H
22 
23 #include "ktexteditor/codecompletionmodel.h"
24 #include "codecompletionmodelcontrollerinterfacev4.h"
25 
34 class KateKeywordCompletionModel : public KTextEditor::CodeCompletionModel2
35  , public KTextEditor::CodeCompletionModelControllerInterface4
36 {
37  Q_OBJECT
38  Q_INTERFACES(KTextEditor::CodeCompletionModelControllerInterface4)
39 
40 public:
41  KateKeywordCompletionModel(QObject* parent);
42  virtual QVariant data(const QModelIndex& index, int role) const;
43  virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
44  virtual QModelIndex parent(const QModelIndex& index) const;
45  virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const;
46  virtual void completionInvoked(KTextEditor::View* view, const KTextEditor::Range& range,
47  InvocationType invocationType);
48  virtual KTextEditor::Range completionRange(KTextEditor::View* view, const KTextEditor::Cursor& position);
49  virtual bool shouldAbortCompletion(KTextEditor::View* view, const KTextEditor::Range& range,
50  const QString& currentCompletion);
51  virtual bool shouldStartCompletion(KTextEditor::View* view, const QString& insertedText, bool userInsertion,
52  const KTextEditor::Cursor& position);
53  virtual MatchReaction matchingItem(const QModelIndex& matched);
54  virtual bool shouldHideItemsWithEqualNames() const;
55 
56 private:
57  QList<QString> m_items;
58 };
59 
60 #endif // KATEKEYWORDCOMPLETIONMODEL_H
61 
62 // kate: indent-width 4; replace-tabs on
QModelIndex
KateKeywordCompletionModel::shouldHideItemsWithEqualNames
virtual bool shouldHideItemsWithEqualNames() const
When multiple completion models are used at the same time, it may happen that multiple models add ite...
Definition: katekeywordcompletion.cpp:168
KateKeywordCompletionModel::completionInvoked
virtual void completionInvoked(KTextEditor::View *view, const KTextEditor::Range &range, InvocationType invocationType)
Definition: katekeywordcompletion.cpp:35
KateKeywordCompletionModel::completionRange
virtual KTextEditor::Range completionRange(KTextEditor::View *view, const KTextEditor::Cursor &position)
Definition: katekeywordcompletion.cpp:126
codecompletionmodelcontrollerinterfacev4.h
KateKeywordCompletionModel::matchingItem
virtual MatchReaction matchingItem(const QModelIndex &matched)
Definition: katekeywordcompletion.cpp:201
QObject
KateKeywordCompletionModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: katekeywordcompletion.cpp:108
KateKeywordCompletionModel::KateKeywordCompletionModel
KateKeywordCompletionModel(QObject *parent)
Definition: katekeywordcompletion.cpp:29
QString
QList< QString >
KTextEditor::CodeCompletionModelControllerInterface4
Extension of CodeCompletionModelControllerInterface3.
Definition: codecompletionmodelcontrollerinterfacev4.h:32
KateKeywordCompletionModel::parent
virtual QModelIndex parent(const QModelIndex &index) const
Definition: katekeywordcompletion.cpp:82
KateKeywordCompletionModel::shouldAbortCompletion
virtual bool shouldAbortCompletion(KTextEditor::View *view, const KTextEditor::Range &range, const QString &currentCompletion)
Definition: katekeywordcompletion.cpp:143
KateKeywordCompletionModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: katekeywordcompletion.cpp:90
KateKeywordCompletionModel
Highlighting-file based keyword completion for the editor.
Definition: katekeywordcompletion.h:34
KateKeywordCompletionModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Definition: katekeywordcompletion.cpp:173
KateKeywordCompletionModel::shouldStartCompletion
virtual bool shouldStartCompletion(KTextEditor::View *view, const QString &insertedText, bool userInsertion, const KTextEditor::Cursor &position)
Definition: katekeywordcompletion.cpp:158
QVariant
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal