mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
committed by
Mathew Sutcliffe
parent
34774bd005
commit
1f2a88e502
83
src/blackcore/context_settings.h
Normal file
83
src/blackcore/context_settings.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / authors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef BLACKCORE_CONTEXTSETTINGS_H
|
||||
#define BLACKCORE_CONTEXTSETTINGS_H
|
||||
|
||||
#include "blackcore/dbus_server.h"
|
||||
#include "blackcore/context_settings_interface.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/statusmessages.h"
|
||||
#include <QObject>
|
||||
|
||||
#define BLACKCORE_CONTEXTSETTINGS_INTERFACENAME "blackcore.contextsettings"
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
class CCoreRuntime;
|
||||
|
||||
/*!
|
||||
* \brief Network context
|
||||
*/
|
||||
class CContextSettings : public IContextSettings
|
||||
{
|
||||
// Register by same name, make signals sender independent
|
||||
// http://dbus.freedesktop.org/doc/dbus-faq.html#idp48032144
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTSETTINGS_INTERFACENAME)
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* Context
|
||||
* \param parent
|
||||
*/
|
||||
CContextSettings(CCoreRuntime *parent);
|
||||
|
||||
/*!
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~CContextSettings() {}
|
||||
|
||||
/*!
|
||||
* \brief Register myself in DBus
|
||||
* \param server
|
||||
*/
|
||||
void registerWithDBus(CDBusServer *server)
|
||||
{
|
||||
server->addObject(IContextSettings::ServicePath(), this);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Runtime
|
||||
* \return
|
||||
*/
|
||||
const CCoreRuntime *getRuntime() const
|
||||
{
|
||||
return reinterpret_cast<CCoreRuntime *>(this->parent());
|
||||
}
|
||||
|
||||
public slots:
|
||||
/*!
|
||||
* \brief Network settings
|
||||
* \return
|
||||
*/
|
||||
virtual BlackMisc::Settings::CSettingsNetwork getNetworkSettings() const;
|
||||
|
||||
/*!
|
||||
* \brief Validate
|
||||
* \param path
|
||||
* \param value
|
||||
* \return
|
||||
*/
|
||||
virtual BlackMisc::CStatusMessages value(const QString &path, const QString &command, const QVariant &value);
|
||||
|
||||
private:
|
||||
BlackMisc::Settings::CSettingsNetwork m_settingsNetwork;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user