KTextEditor

codecompletionmodelcontrollerinterface.h
1 /* SPDX-License-Identifier: LGPL-2.0-or-later
2 
3  Copyright (C) 2008 Niko Sams <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
22 #define KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
23 
24 #include "codecompletionmodel.h"
25 #include <ktexteditor/cursor.h>
26 #include <ktexteditor_export.h>
27 
28 class QModelIndex;
29 
30 namespace KTextEditor
31 {
32 class View;
33 
73 {
74 public:
77 
92  virtual bool shouldStartCompletion(View *view, const QString &insertedText, bool userInsertion, const Cursor &position);
93 
108  virtual Range completionRange(View *view, const Cursor &position);
109 
120  virtual Range updateCompletionRange(View *view, const Range &range);
121 
134  virtual QString filterString(View *view, const Range &range, const Cursor &position);
135 
147  virtual bool shouldAbortCompletion(View *view, const Range &range, const QString &currentCompletion);
148 
156  virtual bool shouldExecute(const QModelIndex &selected, QChar inserted);
157 
162  virtual void aborted(View *view);
163 
165  None = 0,
166  HideListIfAutomaticInvocation = 1,
167  ForExtension = 0xffff
168  };
169 
175  virtual MatchReaction matchingItem(const QModelIndex &matched);
176 
183  virtual bool shouldHideItemsWithEqualNames() const;
184 };
185 
186 }
187 
188 Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface, "org.kde.KTextEditor.CodeCompletionModelControllerInterface")
189 
190 #endif // KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
The Cursor represents a position in a Document.
Definition: cursor.h:83
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
An object representing a section of text, from one Cursor to another.
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:153
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 24 2020 23:10:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.