Files
pilotclient/src/xbus/plugin.h
2014-07-18 23:32:57 +01:00

62 lines
1.3 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 BLACKSIM_XBUS_PLUGIN_H
#define BLACKSIM_XBUS_PLUGIN_H
//! \file
/*!
* \namespace XBus
* Plugin loaded by X-Plane which publishes a DBus service
*/
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "menus.h"
#pragma push_macro("interface")
#undef interface
#include "blackcore/dbus_server.h"
#pragma pop_macro("interface")
#include <QVector>
namespace XBus
{
class CService;
class CTraffic;
/*!
* Main plugin class
*/
class CPlugin : public QObject
{
Q_OBJECT
public:
//! Constructor
CPlugin();
//! Called by XPluginReceiveMessage when the model is changed
void onAircraftModelChanged();
//! Called by XPluginReceiveMessage when the aircraft is positioned at an airport
void onAircraftRepositioned();
private:
BlackCore::CDBusServer *m_server = nullptr;
CService *m_service = nullptr;
CTraffic *m_traffic = nullptr;
CMenu m_menu;
QVector<CMenuItem> m_startServerMenuItems;
void startServer(const QString &address);
};
}
#endif // guard