diff options
author | Dominik Holland <dominik.holland@pelagicore.com> | 2015-10-20 05:09:25 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@theqtcompany.com> | 2015-12-03 16:26:52 +0000 |
commit | 716bdcc7a9c5c83bdeaf55b33ddd6acefce1a56b (patch) | |
tree | 893e681c4b1d478aaf2e54738b9ed213805fffb1 /src/bench/host.h | |
parent | 4fa1d4f76d44afdf40707fb86f0aeeed1fb1c2ba (diff) |
Import source code from https://github.com/Pelagicore/qmllive
Change-Id: I6888c1c39c5e98c61511f74659b45ddcbb368956
Reviewed-by: Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
Diffstat (limited to 'src/bench/host.h')
-rw-r--r-- | src/bench/host.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/src/bench/host.h b/src/bench/host.h new file mode 100644 index 0000000..9db349e --- /dev/null +++ b/src/bench/host.h @@ -0,0 +1,131 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Pelagicore AG +** Contact: http://www.qt.io/ or http://www.pelagicore.com/ +** +** This file is part of the QmlLive tool. +** +** $QT_BEGIN_LICENSE:GPL3-PELAGICORE$ +** Commercial License Usage +** Licensees holding valid commercial Pelagicore Application Manager +** licenses may use this file in accordance with the commercial license +** agreement provided with the Software or, alternatively, in accordance +** with the terms contained in a written agreement between you and +** Pelagicore. For licensing terms and conditions, contact us at: +** http://www.pelagicore.com. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3 requirements will be +** met: http://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +#pragma once + +#include <QObject> +#include <QUuid> +#include <QMetaType> + +class QSettings; +class Host : public QObject +{ + Q_OBJECT +public: + enum Type { + AutoDiscovery, + Manual + }; + + //If you add properties here, you maybe also have to change the hostform.ui and the hostform.h (HostChanges) + + Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) + Q_PROPERTY(QString address READ address WRITE setAddress NOTIFY addressChanged) + Q_PROPERTY(int port READ port WRITE setPort NOTIFY portChanged) + Q_PROPERTY(QString currentFile READ currentFile WRITE setCurrentFile NOTIFY currentFileChanged) + Q_PROPERTY(int xOffset READ xOffset WRITE setXOffset NOTIFY xOffsetChanged) + Q_PROPERTY(int yOffset READ yOffset WRITE setYOffset NOTIFY yOffsetChanged) + Q_PROPERTY(int rotation READ rotation WRITE setRotation NOTIFY rotationChanged) + Q_PROPERTY(bool online READ online WRITE setOnline NOTIFY onlineChanged) + Q_PROPERTY(bool followTreeSelection READ followTreeSelection WRITE setFollowTreeSelection NOTIFY followTreeSelectionChanged) + Q_PROPERTY(QUuid autoDiscoveryId READ autoDiscoveryId WRITE setAutoDiscoveryId NOTIFY autoDiscoveryIdChanged) + Q_PROPERTY(QString productVersion READ productVersion WRITE setProductVersion) + Q_PROPERTY(QString systemName READ systemName WRITE setSystemName) + + explicit Host(Type type = Manual, QObject *parent = 0); + Host(const Host& host, QObject *parent = 0); + + QString name() const; + QString address() const; + int port() const; + QString currentFile() const; + int xOffset() const; + int yOffset() const; + int rotation() const; + Type type() const; + + bool online() const; + bool followTreeSelection() const; + QUuid autoDiscoveryId() const; + QString productVersion() const; + QString systemName() const; + + + void saveToSettings(QSettings *s); + void restoreFromSettings(QSettings *s); + +signals: + + void nameChanged(QString arg); + void addressChanged(QString arg); + void portChanged(int arg); + void currentFileChanged(QString arg); + void xOffsetChanged(int arg); + void yOffsetChanged(int arg); + void rotationChanged(int arg); + void onlineChanged(bool arg); + void followTreeSelectionChanged(bool arg); + void autoDiscoveryIdChanged(QUuid arg); + + +public slots: + + void setName(QString arg); + void setAddress(QString arg); + void setPort(int arg); + void setCurrentFile(QString arg); + void setXOffset(int arg); + void setYOffset(int arg); + void setRotation(int arg); + void setOnline(bool arg); + void setFollowTreeSelection(bool arg); + void setAutoDiscoveryId(QUuid arg); + void setProductVersion(QString arg); + void setSystemName(QString arg); + +private: + + QString m_name; + QString m_address; + int m_port; + QString m_currentFile; + int m_xOffset; + int m_yOffset; + int m_rotation; + Type m_type; + bool m_online; + bool m_followTreeSelection; + QUuid m_autoDiscoveryId; + QString m_productVersion; + QString m_systemName; +}; + +Q_DECLARE_METATYPE( Host* ) + |