summaryrefslogtreecommitdiffstats
path: root/src/JSObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/JSObject.h')
-rw-r--r--src/JSObject.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/JSObject.h b/src/JSObject.h
new file mode 100644
index 0000000..58ce633
--- /dev/null
+++ b/src/JSObject.h
@@ -0,0 +1,102 @@
+/*
+ * jsObject.h
+ *
+ * Created on: Feb 1, 2011
+ * Author: niklas
+ * The purpose of the jsObject class is to provide signals which will be emited in the javascript functions.
+ * Those javascript functions are writen in a seperate file: jsFunktions.js
+ */
+
+#ifndef JSOBJECT_H_
+#define JSOBJECT_H_
+
+#include "fbbrowser.h"
+#include <QObject>
+
+typedef enum
+{
+ QUIT,
+ SHOW_USB_DEVICES,
+ SHOW_HARDDRIVES,
+ SHOW_MAC_ADDRESS,
+ SHOW_IP_ADDRESS,
+ SHOW_TIME,
+ SHOW_DATE
+} jsAction;
+
+class fbbrowser;
+class QWebFrame;
+class JSObject : public QObject
+{
+ Q_OBJECT
+private:
+ QWebFrame* target;
+ fbbrowser* browser;
+public:
+ JSObject(QWebFrame* qwf);
+ virtual ~JSObject();
+
+//private:
+// fbbrowser browser;
+
+// no slots needed. class provides only signals
+// private slots:
+// void performAction(jsAction a);
+
+// define all the needed signals.
+// every action gets its own signal. (the former enum is not needed anymore)
+// the signals will be connected in the fbbrowser class with slots of the fbbrowser class
+signals:
+ // should be the last signal to be emited.
+ // Will close the browser and continues the boot sequenze
+ void closeBrowser();
+ void signalQuitAll();
+ // will start the download of all needed files for the following boot sequence
+ void startDownload(QString filename);
+ void downloadFile(QString filename);
+ // starts the slot which is responsible for extracting the MAC address of the machine
+ // the MAC Address will be the parameter of a javascript function which will present it on the webpage
+ void getMacAddress();
+ // starts the slot which is responsible for extracting the IP address of the machine
+ // the IP address will be the parameter of a javascript function which will present it on the webpage
+ void getIpAddress();
+ // starts the slot which is responsible for extracting the integrated hardware devices of the machine
+ // the array of integrated hardware devices will be the parameter of a javascript function which will present // it on the webpage
+ void getIntegratedHardwareDevices();
+ // starts the slot which is responsible for extracting the usb devices of the machine
+ // the array of usb devices will be the parameter of a javascript function which will present it on the webpag
+ void getUsbDevices();
+ // starts the slot which is responsible for extracting the hard drive devices of the machine
+ // the array of hard rive devices will be the parameter of a javascript function which will present it on the // webpag
+ void getHardDrives();
+
+ // for testing
+ void showTime();
+ void showDate();
+ void showHelloWorld();
+
+public slots:
+
+ void enableJavascriptAccess();
+ // slots which are emited by the jsObject signals
+
+ void quitAll();
+ void startDownload_Slot(QString filename);
+ void updateProgressSlot(int i);
+
+ // System info stuff
+ void getSysInfo();
+ void getMacAddress_Slot();
+ void getIpAddress_Slot();
+ void getIntegratedHardwareDevices_Slot();
+ void getUsbDevices_Slot();
+ void getHardDrives_Slot();
+
+ // for testing reasons
+ void showTime_Slot();
+ void showDate_Slot();
+ void showHelloWorld_Slot();
+
+};
+
+#endif /* JSOBJECT_H_ */