Files
pilotclient/src/blackgui/components/cockpittranspondermodeledscomponent.h
Roland Winklmeier f4c2939253 Fix BlackGui header includes
* Include only what is used
* Use forward declaration when possible
* Sorted includes

refs #598
2016-05-20 01:31:11 +02:00

74 lines
2.3 KiB
C++

/* Copyright (C) 2013
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKMISC_COCKPITTRANSPONDERMODELEDSCOMPONENT_H
#define BLACKMISC_COCKPITTRANSPONDERMODELEDSCOMPONENT_H
#include "blackgui/blackguiexport.h"
#include "blackgui/led.h"
#include "blackmisc/aviation/transponder.h"
#include "blackmisc/identifiable.h"
#include "blackmisc/identifier.h"
#include "blackmisc/simulation/simulatedaircraft.h"
#include <QFrame>
#include <QObject>
#include <QScopedPointer>
class QWidget;
namespace BlackGui
{
namespace Components
{
//! LEDs representing transponder mode state
class BLACKGUI_EXPORT CCockpitTransponderModeLedsComponent :
public QFrame,
public BlackMisc::CIdentifiable
{
Q_OBJECT
public:
//! Constructor
explicit CCockpitTransponderModeLedsComponent(QWidget *parent = nullptr);
private slots:
//! \copydoc IContextOwnAircraft::changedAircraftCockpit
void ps_onAircraftCockpitChanged(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator);
//! LED clicked
void ps_onLedClicked();
private:
const int LedWidth = 14; //!< LED width
//! Init either in horizontal or vertical layout
void init(bool horizontal);
//! Set the mode
void setMode(BlackMisc::Aviation::CTransponder::TransponderMode mode);
//! Own Transponder
BlackMisc::Aviation::CTransponder getOwnTransponder() const;
//! Own Aircraft
BlackMisc::Simulation::CSimulatedAircraft getOwnAircraft() const;
QScopedPointer<BlackGui::CLedWidget> m_ledStandby;
QScopedPointer<BlackGui::CLedWidget> m_ledModes;
QScopedPointer<BlackGui::CLedWidget> m_ledIdent;
};
} // namespace
} // namespace
#endif // guard