• Skip to content
  • Skip to link menu
KDE 4.2 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 
00094 class SedReplace : public KTextEditor::Command, public KTextEditor::RangeCommand
00095 {
00096   public:
00112     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00113 
00114     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg,
00115         const KTextEditor::Range &r);
00116 
00117     bool supportsRange(const QString &) { return true; }
00118 
00120     bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00121 
00126     const QStringList &cmds () { static QStringList l("s"); if (l.isEmpty()) l << "%s" << "$s"; return l; }
00127 
00128   private:
00148     static int sedMagic(KateDocument *doc, int &line,
00149                         const QString &find, const QString &replace, const QString &delim,
00150                         bool noCase, bool repeat,
00151                         uint startcol=0, int endcol=-1);
00152 };
00153 
00162 class Character : public KTextEditor::Command
00163 {
00164   public:
00172     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00173 
00175     bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00176 
00181     const QStringList &cmds () { static QStringList test("char"); return test; }
00182 };
00183 
00187 class Date : public KTextEditor::Command
00188 {
00189   public:
00197     bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00198 
00200     bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00201 
00206     const QStringList &cmds () { static QStringList test("date"); return test; }
00207 };
00208 
00209 
00210 } // namespace KateCommands
00211 #endif
00212 
00213 // 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
  • 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