KTextEditor
#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().
Definition at line 138 of file commandinterface.h.
Constructor & Destructor Documentation
|
inlinevirtual |
Virtual destructor.
Definition at line 144 of file commandinterface.h.
Member Function Documentation
|
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
|
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
|
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()
|
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:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.