ndgui/NetworkDiscovery

JavascriptInterface Class Reference

#include <javascriptinterface.h>

List of all members.

Public Slots

void attachToDOM ()
void startDownload (const QString &filename)
void setCallbackOnFinished (const QString &function)
const QString getSysInfo (const QString &info)
void quit ()
void shutDown ()
void reboot ()
void callbackOnFinished ()
void updateProgressBar (const int &percent, const double &speed, const QString &unit)
void downloadInfo (const QString &filename, const double &filesize)
void notify (const QString &msg)
void trigger ()

Signals

void requestFile (const QString &filename)
void quitFbgui ()
void shutDownClient ()
void rebootClient ()

Public Member Functions

 JavascriptInterface (QWebFrame *parent)
 ~JavascriptInterface ()

Constructor & Destructor Documentation

JavascriptInterface::JavascriptInterface ( QWebFrame *  parent)

A constructor.

Parameters:
parentIs of type QWebFrame.
JavascriptInterface::~JavascriptInterface ( )

An empty destructor.


Member Function Documentation

void JavascriptInterface::attachToDOM ( ) [slot]

Attaches an instance of this class to the DOM of the HTML page.

Attaches an instance of this class to the DOM of the HTML page. This enables the possibility to call slots/methods of this class in JavaScript functions of HTML page. It also calls the JavascriptInterface::loadJQuery() method.

See also:
JavascriptInterface::loadJQuery()
void JavascriptInterface::callbackOnFinished ( ) [slot]

Sets a callback function for when downloads are finished (will be called when the queue is empty).

void JavascriptInterface::downloadInfo ( const QString &  filename,
const double &  filesize 
) [slot]

This method delivers some informations about the downloading file.

This method delivers some informations about the downloading file.

Todo:
add some more informations
const QString JavascriptInterface::getSysInfo ( const QString &  info) [slot]

This method delivers system informations.

This method delivers system informations. Type of informations, are defined by the parameter. The output of this method depends on the parameter. Can be called from inside a JavaScript function of the HTML page.

Parameters:
infoNameIs of type QString. Defines which method will be called. Possible values are:

  • mac
  • ip
  • mbserial
  • usb
Returns:
QString the output of the called method or "info_error" if an error occurred (e. g. invalid parameter).
See also:
SysInfo::getInfo(const QString& infoName)

Here is the call graph for this function:

void JavascriptInterface::notify ( const QString &  msg) [slot]

This method sends out messages to Javascript. A corresponding function must be implemented on the webpage to receive these.

void JavascriptInterface::quit ( ) [slot]

This method quits the whole program.

This method quits the whole program. Can be called from inside a JavaScript function of the HTML page. Emits JavascriptInterface::quitFbgui() signal

Here is the call graph for this function:

void JavascriptInterface::quitFbgui ( ) [signal]

Here is the caller graph for this function:

void JavascriptInterface::reboot ( ) [slot]

This method performs a reboot of the client.

This method performs a reboot of the client. Emits the JavascriptInterface::rebootClient() signal. It is connected with the fbgui::performReboot() method.

See also:
fbgui::performReboot()

Here is the call graph for this function:

void JavascriptInterface::rebootClient ( ) [signal]

Here is the caller graph for this function:

void JavascriptInterface::requestFile ( const QString &  filename) [signal]

Here is the caller graph for this function:

void JavascriptInterface::setCallbackOnFinished ( const QString &  function) [slot]

This method start a download.

This method start a download. Can be called from inside a JavaScript function of the HTML page.

Todo:
add some more informations
void JavascriptInterface::shutDown ( ) [slot]

This method performs a shutdown of the client.

This method performs a shutdown of the client. Emits the JavascriptInterface::shutDownClient() signal.It is connected with the fbgui::performShutDown() method.

See also:
fbgui::performShutDown()

Here is the call graph for this function:

void JavascriptInterface::shutDownClient ( ) [signal]

Here is the caller graph for this function:

void JavascriptInterface::startDownload ( const QString &  filename) [slot]

This method start a download.

This method start a download. Can be called from inside a JavaScript function of the HTML page. Emits the JavascriptInterface::requestFile(const QString) signal.

Here is the call graph for this function:

void JavascriptInterface::trigger ( ) [slot]

This method triggers the URL load *FOR DEBUGGING/TESTING PURPOSES*

void JavascriptInterface::updateProgressBar ( const int &  percent,
const double &  speed,
const QString &  unit 
) [slot]

This method updates the progress bar.

This method calls a Javascript function to update the progress bar of the download. Javascript must have a function called "updateProgress" to receive this information.

Todo:
add some more informations

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines