Showing the changes to interface/src/scripting/LocationScriptingInterface.h (1 of 10 files). Show all
Unified · Split
| @@ -1,48 +0,0 @@ | |||
| 1 | // | ||
| 2 | // LocationScriptingInterface.h | ||
| 3 | // interface/src/scripting | ||
| 4 | // | ||
| 5 | // Created by Ryan Huffman on 4/29/14. | ||
| 6 | // Copyright 2014 High Fidelity, Inc. | ||
| 7 | // | ||
| 8 | // Distributed under the Apache License, Version 2.0. | ||
| 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | ||
| 10 | // | ||
| 11 | |||
| 12 | #ifndef hifi_LocationScriptingInterface_h | ||
| 13 | #define hifi_LocationScriptingInterface_h | ||
| 14 | |||
| 15 | #include <QObject> | ||
| 16 | #include <QScriptContext> | ||
| 17 | #include <QScriptEngine> | ||
| 18 | #include <QScriptValue> | ||
| 19 | #include <QString> | ||
| 20 | |||
| 21 | #include "Application.h" | ||
| 22 | |||
| 23 | class LocationScriptingInterface : public QObject { | ||
| 24 | Q_OBJECT | ||
| 25 | Q_PROPERTY(bool isConnected READ isConnected) | ||
| 26 | Q_PROPERTY(QString href READ getHref) | ||
| 27 | Q_PROPERTY(QString protocol READ getProtocol) | ||
| 28 | Q_PROPERTY(QString hostname READ getHostname) | ||
| 29 | Q_PROPERTY(QString pathname READ getPathname) | ||
| 30 | LocationScriptingInterface() { }; | ||
| 31 | public: | ||
| 32 | static LocationScriptingInterface* getInstance(); | ||
| 33 | |||
| 34 | bool isConnected(); | ||
| 35 | QString getHref(); | ||
| 36 | QString getProtocol() { return CUSTOM_URL_SCHEME; }; | ||
| 37 | QString getPathname(); | ||
| 38 | QString getHostname(); | ||
| 39 | |||
| 40 | static QScriptValue locationGetter(QScriptContext* context, QScriptEngine* engine); | ||
| 41 | static QScriptValue locationSetter(QScriptContext* context, QScriptEngine* engine); | ||
| 42 | |||
| 43 | public slots: | ||
| 44 | void assign(const QString& url); | ||
| 45 | |||
| 46 | }; | ||
| 47 | |||
| 48 | #endif // hifi_LocationScriptingInterface_h | ||