Newer
Older
/****************************************************************************
**
** This file is part of the CellFrameDashboardService application.
**
** The class implements the main application object CalvinDashboardService.
** It involves the implementation of the interaction of all the components
** of the service components. For example, identification of commands,
** control of the authorization mechanism, management of an GUI client, etc.
**
****************************************************************************/
#ifndef DAPSERVICECONTROLLER_H
#define DAPSERVICECONTROLLER_H
#include <QObject>
#include <QCoreApplication>

andrey.daragan
committed
#include <QAction>
#include <QMenu>
#include <QLocalServer>
typedef class DapRpcLocalServer DapUiService;
#include "handlers/DapAbstractCommand.h"
#include "handlers/DapQuitApplicationCommand.h"
#include "handlers/DapActivateClientCommand.h"
#include "handlers/DapUpdateLogsCommand.h"
#include "handlers/DapAddWalletCommand.h"
#include "handlers/DapGetListNetworksCommand.h"
#include "handlers/DapGetNetworkStatusCommand.h"
#include "handlers/DapNetworkGoToCommand.h"
#include "handlers/DapGetWalletAddressesCommand.h"
#include "handlers/DapExportLogCommand.h"
#include "handlers/DapGetWalletTokenInfoCommand.h"
#include "handlers/DapCreateTransactionCommand.h"
#include "handlers/DapMempoolProcessCommand.h"
#include "handlers/DapGetWalletHistoryCommand.h"
#include "handlers/DapRunCmdCommand.h"
#include "handlers/DapGetHistoryExecutedCmdCommand.h"
#include "handlers/DapSaveHistoryExecutedCmdCommand.h"
#include "handlers/DapCertificateManagerCommands.h"

andrey.daragan
committed
#include "DapSystemTrayIcon.h"
#include "DapToolTipWidget.h"
* Service class which provide handle operations with dashboard.
* Class is server which works clients. Protocol to communacate with client is RPC.
* Work with serves start from public methos start().
*/
{
Q_OBJECT

andrey.daragan
committed
DapUiService * m_pServer {nullptr};

andrey.daragan
committed
/// System tray widget in tray.

andrey.daragan
committed
DapSystemTrayIcon * m_pSystemTrayIcon {nullptr};

andrey.daragan
committed
/// ToolTip pop-up widget.

andrey.daragan
committed
DapToolTipWidget * m_pToolTipWidget {nullptr};

andrey.daragan
committed
/// The context menu of the widget in the system tray.

andrey.daragan
committed
QMenu * menuSystemTrayIcon {nullptr};
public:
/// Standard constructor.
/// @param parent Parent.
explicit DapServiceController(QObject * parent = nullptr);

andrey.daragan
committed
/// Destructor.

andrey.daragan
committed
~DapServiceController();
/// Start service: creating server and socket.
/// @return Returns true if the service starts successfully, otherwise false.
bool start();
signals:
/// The signal is emitted in case of successful connection of a new client.
void onNewClientConnected();
private slots:
/// Register command.
void registerCommand();

andrey.daragan
committed
/// Initialize system tray.

andrey.daragan
committed
void initSystemTrayIcon();