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

KTextEditor

  • KTextEditor
  • CommandExtension
Public Member Functions | List of all members
KTextEditor::CommandExtension Class Referenceabstract
Command Extension Interfaces

#include <commandinterface.h>

Public Member Functions

virtual ~CommandExtension ()
 
virtual KCompletion * completionObject (KTextEditor::View *view, const QString &cmdname)=0
 
virtual void flagCompletions (QStringList &list)=0
 
virtual void processText (KTextEditor::View *view, const QString &text)=0
 
virtual bool wantsToProcessText (const QString &cmdname)=0
 

Detailed Description

Extension interface for a Command.

Introduction

The CommandExtension extends the Command interface allowing to interact with commands during typing. This allows for completion and for example the isearch plugin. If you develop a command that wants to complete or process text as the user types the arguments, or that has flags, you can have your command inherit this class.

If your command supports flags return them by reimplementing flagCompletions(). You can return your own KCompletion object if the command has available completion data. If you want to interactively react on changes return true in wantsToProcessText() for the given command and reimplement processText().

See also
KTextEditor::CommandInterface, KTextEditor::Command, KCompletion
Author
Christoph Cullmann <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>

Definition at line 138 of file commandinterface.h.

Constructor & Destructor Documentation

virtual KTextEditor::CommandExtension::~CommandExtension ( )
inlinevirtual

Virtual destructor.

Definition at line 144 of file commandinterface.h.

Member Function Documentation

virtual KCompletion* KTextEditor::CommandExtension::completionObject ( KTextEditor::View *  view,
const QString &  cmdname 
)
pure virtual

Return a KCompletion object that will substitute the command line default one while typing the first argument of the command cmdname.

The text will be added to the command separated by one space character.

Implement this method if your command can provide a completion object.

Parameters
viewthe view the command will work on
cmdnamethe command name associated with this request.
Returns
the completion object or NULL, if you do not support a completion object
virtual void KTextEditor::CommandExtension::flagCompletions ( QStringList &  list)
pure virtual

Fill in a list of flags to complete from.

Each flag is a single letter, any following text in the string is taken to be a description of the flag's meaning, and showed to the user as a hint. Implement this method if your command has flags.

This method is called each time the flag string in the typed command is changed, so that the available flags can be adjusted. When completions are displayed, existing flags are left out.

Parameters
listflag list
virtual void KTextEditor::CommandExtension::processText ( KTextEditor::View *  view,
const QString &  text 
)
pure virtual

This is called by the command line each time the argument text for the command changed, if wantsToProcessText() returns true.

Parameters
viewthe current view
textthe current command text typed by the user
See also
wantsToProcessText()
virtual bool KTextEditor::CommandExtension::wantsToProcessText ( const QString &  cmdname)
pure virtual

Check, whether the command wants to process text interactively for the given command with name cmdname.

If you return true, the command's processText() method is called whenever the text in the command line changed.

Reimplement this to return true, if your commands wants to process the text while typing.

Parameters
cmdnamethe command name associated with this query.
Returns
true, if your command wants to process text interactively, otherwise false
See also
processText()

The documentation for this class was generated from the following file:
  • commandinterface.h
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