• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KTextEditor

KTextEditor::CommandExtension

KTextEditor::CommandExtension Class Reference
[Command Extension Interfaces]

Extension interface for a Command. More...

#include <commandinterface.h>

List of all members.

Public Member Functions

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
virtual ~CommandExtension ()

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 <cullmann@kde.org>

Definition at line 138 of file commandinterface.h.


Constructor & Destructor Documentation

virtual KTextEditor::CommandExtension::~CommandExtension (  )  [inline, virtual]

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:
view the view the command will work on
cmdname the 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:
list flag 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:
view the current view
text the 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:
cmdname the 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

KTextEditor

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal