katecmds.h
/* This file is part of the KDE libraries
Copyright (C) 2003 Anders Lund <anders@alweb.dk>
Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2001 Charles Samuels <charles@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __KATE_CMDS_H__
#define __KATE_CMDS_H__
#include "../interfaces/document.h"
#include "../interfaces/view.h"
class KateDocument;
class KCompletion;
namespace KateCommands
{
class CoreCommands : public Kate::Command, public Kate::CommandExtension
{
public:
bool exec( class Kate::View *view, const QString &cmd, QString &errorMsg );
bool help( class Kate::View *, const QString &, QString & ) {return false;};
QStringList cmds();
KCompletion *completionObject( const QString &cmd, Kate::View *view );
};
class SedReplace : public Kate::Command
{
public:
bool exec (class Kate::View *view, const QString &cmd, QString &errorMsg);
bool help (class Kate::View *, const QString &, QString &) { return false; };
QStringList cmds () { QStringList l("s"); l << "%s" << "$s"; return l; };
private:
static int sedMagic(KateDocument *doc, int &line,
const QString &find, const QString &replace, const QString &delim,
bool noCase, bool repeat,
uint startcol=0, int endcol=-1);
};
class Character : public Kate::Command
{
public:
bool exec (class Kate::View *view, const QString &cmd, QString &errorMsg);
bool help (class Kate::View *, const QString &, QString &) { return false; };
QStringList cmds () { return QStringList("char"); };
};
class Date : public Kate::Command
{
public:
bool exec (class Kate::View *view, const QString &cmd, QString &errorMsg);
bool help (class Kate::View *, const QString &, QString &) { return false; };
QStringList cmds () { return QStringList("date"); };
};
} // namespace KateCommands
#endif
// kate: space-indent on; indent-width 2; replace-tabs on;
KateCommands::CoreCommands
This Kate::Command provides access to a lot of the core functionality of kate part, settings, utilities, navigation etc.
Definition: katecmds.h:39
KateCommands::CoreCommands::cmds
QStringList cmds()
supported commands as prefixes
Definition: katecmds.cpp:72
Kate::CommandExtension
Extension to the Command interface, allowing to interact with commands during typing.
Definition: document.h:129
KateCommands::Date
insert the current date/time in the given format
Definition: katecmds.h:153
KateCommands::CoreCommands::exec
bool exec(class Kate::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:89
KateCommands::Date::cmds
QStringList cmds()
supported commands as prefixes
Definition: katecmds.h:171
KateCommands::CoreCommands::help
bool help(class Kate::View *, const QString &, QString &)
Shows help for the given view and cmd string, return a bool about success, msg for status...
Definition: katecmds.h:51
KateCommands::SedReplace
– Charles Samuels charles@kde.org Support vim/sed find and replace s/search/replace/ find search...
Definition: katecmds.h:75
KateCommands::Character::help
bool help(class Kate::View *, const QString &, QString &)
Shows help for the given view and cmd string, return a bool about success, msg for status...
Definition: katecmds.h:141
Kate::View
The Kate::View text editor interface.
Definition: view.h:42
KateCommands::Character
insert a unicode or ascii character base 9+1: 1234 hex: 0x1234 or x1234 octal: 01231 ...
Definition: katecmds.h:129
KateCommands::SedReplace::cmds
QStringList cmds()
supported commands as prefixes
Definition: katecmds.h:93
KCompletion
KateCommands::Character::exec
bool exec(class Kate::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:549
Kate::Command
Kate Commands.
Definition: document.h:96
KateCommands::Character::cmds
QStringList cmds()
supported commands as prefixes
Definition: katecmds.h:147
KateCommands::CoreCommands::completionObject
KCompletion * completionObject(const QString &cmd, Kate::View *view)
override completionObject from interfaces/document.h .
Definition: katecmds.cpp:282
KateCommands::Date::help
bool help(class Kate::View *, const QString &, QString &)
Shows help for the given view and cmd string, return a bool about success, msg for status...
Definition: katecmds.h:165
KateCommands::SedReplace::exec
bool exec(class Kate::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:471
KateCommands::Date::exec
bool exec(class Kate::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:591
KateCommands::SedReplace::help
bool help(class Kate::View *, const QString &, QString &)
Shows help for the given view and cmd string, return a bool about success, msg for status...
Definition: katecmds.h:87

KDE Home | KDE Accessibility Home | Description of Access Keys