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

Kate

katecmds.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2003 Anders Lund <anders@alweb.dk>
00003    Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
00004    Copyright (C) 2001 Charles Samuels <charles@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef __KATE_CMDS_H__
00022 #define __KATE_CMDS_H__
00023 
00024 #include <ktexteditor/commandinterface.h>
00025 
00026 #include <QtCore/QStringList>
00027 
00028 class KateDocument;
00029 class KCompletion;
00030 
00035 namespace KateCommands
00036 {
00037 
00044 class CoreCommands : public KTextEditor::Command, public KTextEditor::CommandExtension,
00045   public KTextEditor::RangeCommand
00046 {
00047   public:
00055     bool exec( class KTextEditor::View *view, const QString &cmd, QString &errorMsg );
00056 
00066     bool exec( class KTextEditor::View *view, const QString &cmd, QString &errorMsg,
00067         const KTextEditor::Range &range = KTextEditor::Range(-1, -0, -1, 0));
00068 
00069     bool supportsRange(const QString &range);
00070 
00072     bool help( class KTextEditor::View *, const QString &, QString & ) {return false;}
00073 
00078     const QStringList &cmds();
00079 
00083     KCompletion *completionObject( KTextEditor::View *, const QString & );
00084 
00085     virtual void flagCompletions( QStringList& ) {}
00086     virtual bool wantsToProcessText( const QString & ) { return false; }
00087     virtual void processText( KTextEditor::View *, const QString & ) {}
00088 };
00089 
00093 class ViCommands : public KTextEditor::Command, public KTextEditor::CommandExtension,
00094   public KTextEditor::RangeCommand
00095 {
00096   public:
00104     bool exec( class KTextEditor::View *view, const QString &cmd, QString &msg );
00105 
00115     bool exec( class KTextEditor::View *view, const QString &cmd, QString &msg,
00116         const KTextEditor::Range &range = KTextEditor::Range(-1, -0, -1, 0));
00117 
00118     bool supportsRange(const QString &range);
00119 
00121     bool help( class KTextEditor::View *, const QString &, QString & ) {return false;}
00122 
00127     const QStringList &cmds();
00128 
00132     KCompletion *completionObject( KTextEditor::View *, const QString & );
00133 
00134     virtual void flagCompletions( QStringList& ) {}
00135     virtual bool wantsToProcessText( const QString & ) { return false; }
00136     virtual void processText( KTextEditor::View *, const QString & ) {}
00137 };
00138 
00139 
00144 class SedReplace : public KTextEditor::Command, public KTextEditor::RangeCommand
00145 {
00146   public:
00162     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00163 
00164     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg,
00165         const KTextEditor::Range &r);
00166 
00167     bool supportsRange(const QString &) { return true; }
00168 
00170     bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00171 
00176     const QStringList &cmds () { static QStringList l("s"); if (l.isEmpty()) l << "%s" << "$s"; return l; }
00177 
00178   private:
00198     static int sedMagic(KateDocument *doc, int &line,
00199                         const QString &find, const QString &replace, const QString &delim,
00200                         bool noCase, bool repeat,
00201                         uint startcol=0, int endcol=-1);
00202 };
00203 
00212 class Character : public KTextEditor::Command
00213 {
00214   public:
00222     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00223 
00225     bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00226 
00231     const QStringList &cmds () { static QStringList test("char"); return test; }
00232 };
00233 
00237 class Date : public KTextEditor::Command
00238 {
00239   public:
00247     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00248 
00250     bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00251 
00256     const QStringList &cmds () { static QStringList test("date"); return test; }
00257 };
00258 
00259 
00260 } // namespace KateCommands
00261 #endif
00262 
00263 // kate: space-indent on; indent-width 2; replace-tabs on;

Kate

Skip menu "Kate"
  • Main Page
  • 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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