/*************************************************************************** miniCashConnect Copyright © 2022 christoph holzheuer c.holzheuer@sourceworx.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. ***************************************************************************/ #ifndef MCCNETWORKWIDGET_H #define MCCNETWORKWIDGET_H #include #include #include #include #include namespace Ui { class MCNetworkWidget; } class LIBMINICASH_EXPORT MCNetworkWidget : public QLabel { Q_OBJECT public: explicit MCNetworkWidget( QWidget* parent = nullptr ); virtual ~MCNetworkWidget(); miniCash::CState connectionState(); void setConnectionState( miniCash::CState state ); signals: void showNetworkDialog(); protected: struct MCNetworkState { MCNetworkState() { } MCNetworkState( const QString alabel, QIcon aicon ) : label{ alabel }, icon{ aicon } { } QString label; QIcon icon; }; Ui::MCNetworkWidget* _ui{}; miniCash::CState _senderState = miniCash::Disabled; MCNetworkState _networkStates[miniCash::CStateSize]; }; #endif /// MCCNETWORKWIDGET_H