Kate
katecmds.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 {
00046 public:
00054 bool exec( class KTextEditor::View *view, const QString &cmd, QString &errorMsg );
00055
00057 bool help( class KTextEditor::View *, const QString &, QString & ) {return false;}
00058
00063 const QStringList &cmds();
00064
00068 KCompletion *completionObject( KTextEditor::View *, const QString & );
00069
00070 virtual void flagCompletions( QStringList& ) {}
00071 virtual bool wantsToProcessText( const QString & ) { return false; }
00072 virtual void processText( KTextEditor::View *, const QString & ) {}
00073 };
00074
00079 class SedReplace : public KTextEditor::Command
00080 {
00081 public:
00097 bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00098
00100 bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00101
00106 const QStringList &cmds () { static QStringList l("s"); if (l.isEmpty()) l << "%s" << "$s"; return l; }
00107
00108 private:
00128 static int sedMagic(KateDocument *doc, int &line,
00129 const QString &find, const QString &replace, const QString &delim,
00130 bool noCase, bool repeat,
00131 uint startcol=0, int endcol=-1);
00132 };
00133
00142 class Character : public KTextEditor::Command
00143 {
00144 public:
00152 bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00153
00155 bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00156
00161 const QStringList &cmds () { static QStringList test("char"); return test; }
00162 };
00163
00167 class Date : public KTextEditor::Command
00168 {
00169 public:
00177 bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg);
00178
00180 bool help (class KTextEditor::View *, const QString &, QString &) { return false; }
00181
00186 const QStringList &cmds () { static QStringList test("date"); return test; }
00187 };
00188
00189
00190 }
00191 #endif
00192
00193