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

KTextEditor

  • KTextEditor
  • CommandInterface
Public Member Functions | List of all members
KTextEditor::CommandInterface Class Referenceabstract
Editor Extension Interfaces

#include <commandinterface.h>

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 <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>

Definition at line 233 of file commandinterface.h.

Constructor & Destructor Documentation

virtual KTextEditor::CommandInterface::~CommandInterface ( )
inlinevirtual

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
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal