context classes, runtime classes, and related infrastructure

refs #81
This commit is contained in:
Klaus Basan
2014-01-02 00:52:56 +00:00
committed by Mathew Sutcliffe
parent 34774bd005
commit 1f2a88e502
20 changed files with 2641 additions and 49 deletions

View 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