Kate
KateScriptManager Class Reference
Manage the scripts on disks -- find them and query them. More...
#include <katescriptmanager.h>

Public Member Functions | |
const QStringList & | cmds () |
void | collect (const QString &resourceFile, const QString &directory, bool force=false) |
bool | exec (KTextEditor::View *view, const QString &cmd, QString &errorMsg) |
bool | help (KTextEditor::View *view, const QString &cmd, QString &msg) |
KateIndentScript * | indentationScript (const QString &scriptname) |
KateIndentScript * | indentationScriptByIndex (int index) |
int | indentationScripts () |
KateIndentScript * | indenter (const QString &language) |
KateScriptManager () | |
const QVector< KateScript * > & | scripts () |
~KateScriptManager () | |
Static Public Member Functions | |
static bool | parseMetaInformation (const QString &url, QHash< QString, QString > &pairs) |
Detailed Description
Manage the scripts on disks -- find them and query them.
Provides access to loaded scripts too.
Definition at line 40 of file katescriptmanager.h.
Constructor & Destructor Documentation
KateScriptManager::KateScriptManager | ( | ) |
This file is part of the KDE libraries Copyright (C) 2005 Christoph Cullmann <cullmann@kde.org> Copyright (C) 2005 Joseph Wenninger <jowenn@kde.org> Copyright (C) 2006 Dominik Haumann <dhaumann kde="" org>=""> Copyright (C) 2008 Paul Giannaros <paul@giannaros.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.
Definition at line 40 of file katescriptmanager.cpp.
KateScriptManager::~KateScriptManager | ( | ) |
Definition at line 46 of file katescriptmanager.cpp.
Member Function Documentation
const QStringList & KateScriptManager::cmds | ( | ) | [virtual] |
supported commands as prefixes
- Returns:
- prefix list
Implements KTextEditor::Command.
Definition at line 342 of file katescriptmanager.cpp.
void KateScriptManager::collect | ( | const QString & | resourceFile, | |
const QString & | directory, | |||
bool | force = false | |||
) |
Find all of the scripts matching the wildcard directory
.
The resource file with the name resourceFile
is used for caching. If force
is true, then the cache will not be used. This populates the internal lists of scripts. This is automatically called by init so you shouldn't call it yourself unless you want to refresh the collected list.
Definition at line 75 of file katescriptmanager.cpp.
bool KateScriptManager::exec | ( | KTextEditor::View * | view, | |
const QString & | cmd, | |||
QString & | errorMsg | |||
) | [virtual] |
execute command
Kate::Command stuff.
- Parameters:
-
view view to use for execution cmd cmd string errorMsg error to return if no success
- Returns:
- success
Implements KTextEditor::Command.
Definition at line 272 of file katescriptmanager.cpp.
bool KateScriptManager::help | ( | KTextEditor::View * | view, | |
const QString & | cmd, | |||
QString & | msg | |||
) | [virtual] |
get help for a command
- Parameters:
-
view view to use cmd cmd name msg help message
- Returns:
- help available or not
Implements KTextEditor::Command.
Definition at line 324 of file katescriptmanager.cpp.
KateIndentScript* KateScriptManager::indentationScript | ( | const QString & | scriptname | ) | [inline] |
Definition at line 102 of file katescriptmanager.h.
KateIndentScript* KateScriptManager::indentationScriptByIndex | ( | int | index | ) | [inline] |
Definition at line 105 of file katescriptmanager.h.
int KateScriptManager::indentationScripts | ( | ) | [inline] |
Definition at line 104 of file katescriptmanager.h.
KateIndentScript * KateScriptManager::indenter | ( | const QString & | language | ) |
Get an indentation script for the given language -- if there is more than one result, this will return the script with the highest priority.
If both have the same priority, an arbitrary script will be returned. If no scripts are found, 0 is returned.
Definition at line 51 of file katescriptmanager.cpp.
bool KateScriptManager::parseMetaInformation | ( | const QString & | url, | |
QHash< QString, QString > & | pairs | |||
) | [static] |
Extract the meta data from the script at url
and put in pairs
.
Returns true if metadata was found and extracted successfuly, false otherwise.
Definition at line 222 of file katescriptmanager.cpp.
const QVector<KateScript*>& KateScriptManager::scripts | ( | ) | [inline] |
Get a vector containing all of the scripts that the manager knows about.
Definition at line 48 of file katescriptmanager.h.
The documentation for this class was generated from the following files: