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

KTextEditor

  • sources
  • kde-4.12
  • kdelibs
  • interfaces
  • ktexteditor
commandinterface.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2005 Christoph Cullmann (cullmann@kde.org)
3  Copyright (C) 2005-2006 Dominik Haumann (dhdev@gmx.de)
4  Copyright (C) 2008 Erlend Hamberg (ehamberg@gmail.com)
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KDELIBS_KTEXTEDITOR_COMMANDINTERFACE_H
23 #define KDELIBS_KTEXTEDITOR_COMMANDINTERFACE_H
24 
25 #include <ktexteditor/ktexteditor_export.h>
26 #include <ktexteditor/range.h>
27 #include <QtCore/QObject>
28 
29 class QStringList;
30 class KCompletion;
31 
32 namespace KTextEditor
33 {
34 
35 class Editor;
36 class View;
37 
76 class KTEXTEDITOR_EXPORT Command
77 {
78  public:
82  virtual ~Command () {}
83 
84  public:
92  virtual const QStringList &cmds () = 0;
93 
104  virtual bool exec (KTextEditor::View *view, const QString &cmd, QString &msg) = 0;
105 
113  virtual bool help (KTextEditor::View *view, const QString &cmd, QString &msg) = 0;
114 };
115 
138 class KTEXTEDITOR_EXPORT CommandExtension
139 {
140  public:
144  virtual ~CommandExtension() {}
145  //### this is yet to be tried
157  virtual void flagCompletions( QStringList&list ) = 0;
158 
171  virtual KCompletion *completionObject( KTextEditor::View *view,
172  const QString & cmdname ) = 0;
173 
188  virtual bool wantsToProcessText( const QString &cmdname ) = 0;
189  // ### yet to be tested. The obvious candidate is isearch.
197  virtual void processText( KTextEditor::View *view, const QString &text ) = 0;
198 };
199 
233 class KTEXTEDITOR_EXPORT CommandInterface
234 {
235  public:
239  virtual ~CommandInterface () {}
240 
241  public:
250  virtual bool registerCommand (Command *cmd) = 0;
251 
260  virtual bool unregisterCommand (Command *cmd) = 0;
261 
269  virtual Command *queryCommand (const QString &cmd) const = 0;
270 
276  virtual QList<Command*> commands() const = 0;
277 
283  virtual QStringList commandList() const = 0;
284 };
285 
306 class KTEXTEDITOR_EXPORT RangeCommand
307 {
308  public:
312  virtual ~RangeCommand() {}
313 
320  virtual bool exec (KTextEditor::View *view, const QString &cmd, QString &msg,
321  const KTextEditor::Range &range) = 0;
322 
331  virtual bool supportsRange (const QString &cmd) = 0;
332 };
333 
334 }
335 
336 Q_DECLARE_INTERFACE(KTextEditor::CommandInterface, "org.kde.KTextEditor.CommandInterface")
337 
338 #endif
339 
340 // kate: space-indent on; indent-width 2; replace-tabs on;
help
KAction * help(const QObject *recvr, const char *slot, QObject *parent)
KTextEditor::Command::~Command
virtual ~Command()
Virtual destructor.
Definition: commandinterface.h:82
KTextEditor::CommandExtension::~CommandExtension
virtual ~CommandExtension()
Virtual destructor.
Definition: commandinterface.h:144
QString
KTextEditor::CommandInterface::~CommandInterface
virtual ~CommandInterface()
Virtual destructor.
Definition: commandinterface.h:239
range.h
ktexteditor_export.h
QStringList
KCompletion
KTextEditor::RangeCommand::~RangeCommand
virtual ~RangeCommand()
Virtual destructor.
Definition: commandinterface.h:312
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:54
KTextEditor::Command
An Editor command line command.
Definition: commandinterface.h:76
KTextEditor::RangeCommand
Extension interface for a Command making the exec method take a line range.
Definition: commandinterface.h:306
KTextEditor::CommandInterface
Command extension interface for the Editor.
Definition: commandinterface.h:233
KTextEditor::CommandExtension
Extension interface for a Command.
Definition: commandinterface.h:138
KTextEditor::View
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:145
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:20 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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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