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

KTextEditor

  • KTextEditor
  • CommandInterface
Public Member Functions
KTextEditor::CommandInterface Class Reference
Editor Extension Interfaces

#include <commandinterface.h>

List of all members.

Public Member Functions

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

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>

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:
cmdname 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:
cmdcommand 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:
cmdcommand 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
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.5
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