kate Library API Documentation

Kate::CommandExtension Class Reference

Extension to the Command interface, allowing to interact with commands during typing. More...

#include <document.h>

Inheritance diagram for Kate::CommandExtension:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CommandExtension ()
virtual ~CommandExtension ()
virtual void flagCompletions (QStringList &)
virtual KCompletioncompletionObject (const QString &cmdname, Kate::View *)
virtual bool wantsToProcessText (const QString &cmdname)
virtual void processText (Kate::View *view, const QString &text)

Detailed Description

Extension to 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 thu user types the arguments, or that has flags, you can have your command inherit this class.

Definition at line 129 of file document.h.


Member Function Documentation

virtual void Kate::CommandExtension::flagCompletions QStringList  )  [inline, 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.

Definition at line 146 of file document.h.

virtual KCompletion* Kate::CommandExtension::completionObject const QString cmdname,
Kate::View
[inline, virtual]
 

Returns:
a KCompletion object that will substitute the command line default one while typing the first argument to the command. The text will be added to the command seperated by one space character.
Implement this method if your command can provide a completion object.

Parameters:
cmdname The command name associated with this request.

Reimplemented in KateCommands::CoreCommands.

Definition at line 157 of file document.h.

Referenced by KateCmdLine::keyPressEvent().

virtual bool Kate::CommandExtension::wantsToProcessText const QString cmdname  )  [inline, virtual]
 

Returns:
whether this command wants to process text interactively given the cmdname. If true, the command's processText() method is called when the text in the command line is changed.
Reimplement this to return true, if your commands wants to process the text as typed.

Parameters:
cmdname the command name associated with this query.

Reimplemented in SearchCommand.

Definition at line 169 of file document.h.

Referenced by KateCmdLine::keyPressEvent().

virtual void Kate::CommandExtension::processText Kate::View view,
const QString text
[inline, virtual]
 

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

Parameters:
view The current view
text The current command text typed by the user.

Reimplemented in SearchCommand.

Definition at line 177 of file document.h.

Referenced by KateCmdLine::keyPressEvent().


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kate Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 14:18:57 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003