Showing the changes to interface/src/scripting/WindowScriptingInterface.h (1 of 4 files). Show all
Unified · Split
| @@ -0,0 +1,43 @@ | ||
| 1 | +// | |
| 2 | +// WindowScriptingInterface.cpp | |
| 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_WindowScriptingInterface_h | |
| 13 | +#define hifi_WindowScriptingInterface_h | |
| 14 | + | |
| 15 | +#include <QDebug> | |
| 16 | +#include <QMutex> | |
| 17 | +#include <QObject> | |
| 18 | +#include <QString> | |
| 19 | + | |
| 20 | +#include "LocationScriptingInterface.h" | |
| 21 | + | |
| 22 | +class WindowScriptingInterface : public QObject { | |
| 23 | + Q_OBJECT | |
| 24 | + Q_PROPERTY(int innerWidth READ getInnerWidth) | |
| 25 | + Q_PROPERTY(int innerHeight READ getInnerHeight) | |
| 26 | + WindowScriptingInterface() { }; | |
| 27 | +public: | |
| 28 | + static WindowScriptingInterface* getInstance(); | |
| 29 | + int getInnerWidth(); | |
| 30 | + int getInnerHeight(); | |
| 31 | + | |
| 32 | +public slots: | |
| 33 | + QScriptValue alert(const QString& message); | |
| 34 | + QScriptValue confirm(const QString& message); | |
| 35 | + QScriptValue prompt(const QString& message, const QString& defaultText=""); | |
| 36 | + | |
| 37 | +private slots: | |
| 38 | + QScriptValue showAlert(const QString& message); | |
| 39 | + QScriptValue showConfirm(const QString& message); | |
| 40 | + QScriptValue showPrompt(const QString& message, const QString& defaultText); | |
| 41 | +}; | |
| 42 | + | |
| 43 | +#endif // hifi_WindowScriptingInterface_h | |