• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • interfaces
  • 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
28class QModelIndex;
29
30namespace KTextEditor {
31class View;
70class KTEXTEDITOR_EXPORT_DEPRECATED CodeCompletionModelControllerInterface
71{
72public:
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
170class 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
226class KTEXTEDITOR_EXPORT CodeCompletionModelControllerInterface3
227{
228public:
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
344Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface, "org.kde.KTextEditor.CodeCompletionModelControllerInterface")
345Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface2, "org.kde.KTextEditor.CodeCompletionModelControllerInterface2")
346#endif
347
348Q_DECLARE_INTERFACE(KTextEditor::CodeCompletionModelControllerInterface3, "org.kde.KTextEditor.CodeCompletionModelControllerInterface3")
349
350#endif // KDELIBS_KTEXTEDITOR_CODECOMPLETIONMODELCONTROLLERINTERFACE_H
KTextEditor::CodeCompletionModelControllerInterface2
Extension of CodeCompletionModelControllerInterface.
Definition: codecompletionmodelcontrollerinterface.h:170
KTextEditor::CodeCompletionModelControllerInterface2::MatchReaction
MatchReaction
Definition: codecompletionmodelcontrollerinterface.h:172
KTextEditor::CodeCompletionModelControllerInterface2::None
@ None
Definition: codecompletionmodelcontrollerinterface.h:173
KTextEditor::CodeCompletionModelControllerInterface3
Controller interface for a CodeCompletionModel.
Definition: codecompletionmodelcontrollerinterface.h:227
KTextEditor::CodeCompletionModelControllerInterface3::MatchReaction
MatchReaction
Definition: codecompletionmodelcontrollerinterface.h:326
KTextEditor::CodeCompletionModelControllerInterface
Controller interface for a CodeCompletionModel.
Definition: codecompletionmodelcontrollerinterface.h:71
KTextEditor::Cursor
An object which represents a position in a Document.
Definition: cursor.h:62
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:55
KTextEditor::SmartRange
A Range which is bound to a specific Document, and maintains its position.
Definition: smartrange.h:95
KTextEditor::View
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:146
codecompletionmodel.h
cursor.h
ktexteditor_export.h
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
None
None
org
smartrange.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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