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

KTextEditor

KTextEditor::CommandInterface

KTextEditor::CommandInterface Class Reference
[Editor Extension Interfaces]

Command extension interface for the Editor. More...

#include <commandinterface.h>

List of all members.


Public Member Functions

virtual QStringList commandList () const =0
virtual QList< Command * > commands () const =0
virtual Command * queryCommand (const QString &cmd) const =0
virtual bool registerCommand (Command *cmd)=0
virtual bool unregisterCommand (Command *cmd)=0
virtual ~CommandInterface ()

Detailed Description

Command extension interface for the Editor.

Introduction

The CommandInterface extends the Editor to support command line commands. An application or a Plugin can register new commands by using registerCommand(). To unregister a command call unregisterCommand(). To check, whether a command with a given name exists use queryCommand().

Accessing the CommandInterface

The CommandInterface is supposed to be an extension interface for the Editor, i.e. the Editor inherits the interface provided that the used KTextEditor library implements the interface. Use qobject_cast to access the interface:
 // editor is of type KTextEditor::Editor*
 KTextEditor::CommandInterface *iface =
     qobject_cast<KTextEditor::CommandInterface*>( editor );

 if( iface ) {
     // the implementation supports the interface
     // do stuff
 }

See also:
KTextEditor::Editor, KTextEditor::Command, KTextEditor::CommandExtension
Author:
Christoph Cullmann <cullmann@kde.org>

Definition at line 233 of file commandinterface.h.


Constructor & Destructor Documentation

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

Virtual destructor.

Definition at line 239 of file commandinterface.h.


Member Function Documentation

virtual QStringList KTextEditor::CommandInterface::commandList (  )  const [pure virtual]

Get a list of available command line strings.

Returns:
command line strings
See also:
commands()

virtual QList<Command*> KTextEditor::CommandInterface::commands (  )  const [pure virtual]

Get a list of all registered commands.

Returns:
list of all commands
See also:
queryCommand(), commandList()

virtual Command* KTextEditor::CommandInterface::queryCommand ( const QString &  cmd  )  const [pure virtual]

Query for the command cmd.

If the command cmd does not exist the return value is NULL.

Parameters:
cmd name of command to query for
Returns:
the found command or NULL if no such command exists

virtual bool KTextEditor::CommandInterface::registerCommand ( Command *  cmd  )  [pure virtual]

Register a the new command cmd.

The command will be registered for all documents, i.e. every command is global.

Parameters:
cmd command to register
Returns:
true on success, otherwise false
See also:
unregisterCommand()

virtual bool KTextEditor::CommandInterface::unregisterCommand ( Command *  cmd  )  [pure virtual]

Unregister the command cmd.

The command will be unregistered for all documents.

Parameters:
cmd command to unregister
Returns:
true on success, otherwise false
See also:
registerCommand()


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
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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