• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KateScript Class Reference

#include <katescript.h>

Inheritance diagram for KateScript:
Inheritance graph
[legend]

Public Types

enum  InputType { InputURL, InputSCRIPT }
 

Public Member Functions

 KateScript (const QString &urlOrScript, enum InputType inputType=InputURL)
 
virtual ~KateScript ()
 
QString backtrace (const QScriptValue &error, const QString &header=QString())
 
void clearExceptions ()
 
void displayBacktrace (const QScriptValue &error, const QString &header=QString())
 
const QString & errorMessage ()
 
QScriptValue function (const QString &name)
 
KateScriptHeader & generalHeader ()
 
QScriptValue global (const QString &name)
 
bool load ()
 
void setGeneralHeader (const KateScriptHeader &generalHeader)
 
bool setView (KateView *view)
 
const QString & url ()
 

Protected Member Functions

bool hasException (const QScriptValue &object, const QString &file)
 

Protected Attributes

QScriptEngine * m_engine
 

Detailed Description

KateScript objects represent a script that can be executed and inspected.

Definition at line 106 of file katescript.h.

Member Enumeration Documentation

enum KateScript::InputType
Enumerator
InputURL 
InputSCRIPT 

Definition at line 109 of file katescript.h.

Constructor & Destructor Documentation

KateScript::KateScript ( const QString &  urlOrScript,
enum InputType  inputType = InputURL 
)

Create a new script representation, passing either a file or the script content urlOrScript to it.

In case of a file, loading of the script will happen lazily.

Definition at line 78 of file katescript.cpp.

KateScript::~KateScript ( )
virtual

Definition at line 90 of file katescript.cpp.

Member Function Documentation

QString KateScript::backtrace ( const QScriptValue &  error,
const QString &  header = QString() 
)

Returns the backtrace when a script has errored out.

Definition at line 106 of file katescript.cpp.

void KateScript::clearExceptions ( )

Clears any uncaught exceptions in the script engine.

Definition at line 128 of file katescript.cpp.

void KateScript::displayBacktrace ( const QScriptValue &  error,
const QString &  header = QString() 
)

Displays the backtrace when a script has errored out.

Definition at line 119 of file katescript.cpp.

const QString& KateScript::errorMessage ( )
inline

Return a context-specific error message.

Definition at line 153 of file katescript.h.

QScriptValue KateScript::function ( const QString &  name)

Return a function in the script of the given name, or an invalid QScriptValue if no such function exists.

Definition at line 143 of file katescript.cpp.

KateScriptHeader & KateScript::generalHeader ( )

Return the general header.

Definition at line 234 of file katescript.cpp.

QScriptValue KateScript::global ( const QString &  name)

Get a QScriptValue for a global item in the script given its name, or an invalid QScriptValue if no such global item exists.

Definition at line 135 of file katescript.cpp.

bool KateScript::hasException ( const QScriptValue &  object,
const QString &  file 
)
protected

Checks for exception and gives feedback on the console.

Definition at line 206 of file katescript.cpp.

bool KateScript::load ( )

Load the script.

If loading is successful, returns true. Otherwise, returns returns false and an error message will be set (see errorMessage()). Note that you don't have to call this – it is called as necessary by the functions that require it. Subsequent calls to load will return the value it returned the first time.

Definition at line 151 of file katescript.cpp.

void KateScript::setGeneralHeader ( const KateScriptHeader &  generalHeader)

set the general header after construction of the script

Definition at line 229 of file katescript.cpp.

bool KateScript::setView ( KateView *  view)

set view for this script for the execution will trigger load!

Definition at line 219 of file katescript.cpp.

const QString& KateScript::url ( )
inline

The script's URL.

Definition at line 123 of file katescript.h.

Member Data Documentation

QScriptEngine* KateScript::m_engine
protected

The Qt interpreter for this script.

Definition at line 188 of file katescript.h.


The documentation for this class was generated from the following files:
  • katescript.h
  • katescript.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:57:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal