mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
* removed usingLocalObjects() now in CContext * removed getRuntime() now in CContext * Constructors no longer public, context can only be obtained via runtime object * runtime class is friend class
67 lines
1.9 KiB
C++
67 lines
1.9 KiB
C++
/* Copyright (C) 2013 VATSIM Community / contributors
|
|
* 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_CONTEXTSIMULATOR_H
|
|
#define BLACKCORE_CONTEXTSIMULATOR_H
|
|
|
|
#define BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME "net.vatsim.PilotClient.BlackCore.ContextSimulator"
|
|
#define BLACKCORE_CONTEXTSIMULATOR_OBJECTPATH "/Simulator"
|
|
|
|
#include "context.h"
|
|
#include "blackcore/dbus_server.h"
|
|
#include "blackcore/context_runtime.h"
|
|
#include "blackmisc/avaircraft.h"
|
|
#include <QObject>
|
|
|
|
namespace BlackCore
|
|
{
|
|
//! \brief Network context
|
|
class IContextSimulator : public CContext
|
|
{
|
|
Q_OBJECT
|
|
Q_CLASSINFO("D-Bus Interface", BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME)
|
|
|
|
public:
|
|
|
|
//! \brief Service name
|
|
static const QString &InterfaceName()
|
|
{
|
|
static QString s(BLACKCORE_CONTEXTSIMULATOR_INTERFACENAME);
|
|
return s;
|
|
}
|
|
|
|
//! \brief Service path
|
|
static const QString &ObjectPath()
|
|
{
|
|
static QString s(BLACKCORE_CONTEXTSIMULATOR_OBJECTPATH);
|
|
return s;
|
|
}
|
|
|
|
//! Destructor
|
|
virtual ~IContextSimulator() {}
|
|
|
|
signals:
|
|
//! Emitted when the simulator connection changes
|
|
void connectionChanged(bool value);
|
|
|
|
public slots:
|
|
|
|
//! Returns true when simulator is connected and available
|
|
virtual bool isConnected() const = 0;
|
|
|
|
//! Get user aircraft value object
|
|
virtual BlackMisc::Aviation::CAircraft getOwnAircraft() const = 0;
|
|
|
|
protected:
|
|
friend class CRuntime;
|
|
|
|
//! \brief Constructor
|
|
IContextSimulator(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {}
|
|
};
|
|
|
|
} // namespace BlackCore
|
|
|
|
#endif // guard
|