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

KTextEditor

  • kde-4.14
  • applications
  • kate
  • ktexteditor
codecompletionmodelcontrollerinterface.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2008 Niko Sams <niko.sams@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 as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
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 KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
21 #define KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
22 
23 #include <ktexteditor/ktexteditor_export.h>
24 #include <ktexteditor/smartrange.h>
25 #include <ktexteditor/cursor.h>
26 #include "codecompletionmodel.h"
27 
28 class QModelIndex;
29 
30 namespace KTextEditor {
31 class View;
70 class KTEXTEDITOR_EXPORT_DEPRECATED CodeCompletionModelControllerInterface
71 {
72 public:
73  CodeCompletionModelControllerInterface();
74  virtual ~CodeCompletionModelControllerInterface();
75 
90  virtual bool shouldStartCompletion(View* view, const QString &insertedText, bool userInsertion, const Cursor &position);
91 
106  virtual Range completionRange(View* view, const Cursor &position);
107 
120  virtual void updateCompletionRange(View* view, SmartRange& range);
121 
136  virtual QString filterString(View* view, const SmartRange& range, const Cursor &position);
137 
151  virtual bool shouldAbortCompletion(View* view, const SmartRange& range, const QString &currentCompletion);
152 
160  virtual bool shouldExecute(const QModelIndex& selected, QChar inserted);
161 
166  virtual void aborted(View* view);
167 };
168 
170 class KTEXTEDITOR_EXPORT_DEPRECATED CodeCompletionModelControllerInterface2 : public CodeCompletionModelControllerInterface {
171  public:
172  enum MatchReaction {
173  None,
174  HideListIfAutomaticInvocation
175  };
181  virtual MatchReaction matchingItem(const QModelIndex& matched);
182 };
183 
184 
185 
186 //BEGIN V3
226 class KTEXTEDITOR_EXPORT CodeCompletionModelControllerInterface3
227 {
228 public:
229  CodeCompletionModelControllerInterface3();
230  virtual ~CodeCompletionModelControllerInterface3();
231 
246  virtual bool shouldStartCompletion(View* view, const QString &insertedText, bool userInsertion, const Cursor &position);
247 
262  virtual Range completionRange(View* view, const Cursor &position);
263 
277  virtual Range updateCompletionRange(View* view, const Range& range);
278 
293  virtual QString filterString(View* view, const Range& range, const Cursor &position);
294 
308  virtual bool shouldAbortCompletion(View* view, const Range& range, const QString &currentCompletion);
309 
317  virtual bool shouldExecute(const QModelIndex& selected, QChar inserted);
318 
323  virtual void aborted(View* view);
324 
325  public:
326  enum MatchReaction {
327  None=0,
328  HideListIfAutomaticInvocation=1,
329  ForExtension=0xffff
330  };
336  virtual MatchReaction matchingItem(const QModelIndex& matched);
337 };
338 //END V3
339 
340 
341 }
342 
343 #ifndef KTEXTEDITOR_NO_DEPRECATED
344 Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface, "org.kde.KTextEditor.CodeCompletionModelControllerInterface")
345 Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface2, "org.kde.KTextEditor.CodeCompletionModelControllerInterface2")
346 #endif
347 
348 Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface3, "org.kde.KTextEditor.CodeCompletionModelControllerInterface3")
349 
350 #endif // KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
QModelIndex
KTextEditor::CodeCompletionModelControllerInterface2
Extension of CodeCompletionModelControllerInterface.
Definition: codecompletionmodelcontrollerinterface.h:170
KTextEditor::CodeCompletionModelControllerInterface2::MatchReaction
MatchReaction
Definition: codecompletionmodelcontrollerinterface.h:172
KTextEditor::CodeCompletionModelControllerInterface3::MatchReaction
MatchReaction
Definition: codecompletionmodelcontrollerinterface.h:326
KTextEditor::CodeCompletionModelControllerInterface
Controller interface for a CodeCompletionModel.
Definition: codecompletionmodelcontrollerinterface.h:70
QChar
cursor.h
KTextEditor::SmartRange
A Range which is bound to a specific Document, and maintains its position.
Definition: smartrange.h:94
smartrange.h
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:55
KTextEditor::CodeCompletionModelControllerInterface3
Controller interface for a CodeCompletionModel.
Definition: codecompletionmodelcontrollerinterface.h:226
KTextEditor::CodeCompletionModelControllerInterface2::None
Definition: codecompletionmodelcontrollerinterface.h:173
ktexteditor_export.h
KTEXTEDITOR_EXPORT
#define KTEXTEDITOR_EXPORT
Definition: ktexteditor_export.h:35
QString
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:54
KTEXTEDITOR_EXPORT_DEPRECATED
#define KTEXTEDITOR_EXPORT_DEPRECATED
Definition: ktexteditor_export.h:41
codecompletionmodel.h
KTextEditor::View
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:145
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • 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