Skip to content
Snippets Groups Projects
DapServiceController.h 2.99 KiB
Newer Older
/****************************************************************************
**
Dmitriy A. Gerasimov's avatar
Dmitriy A. Gerasimov committed
** 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.
**
****************************************************************************/

andrey.daragan's avatar
andrey.daragan committed
#ifndef DAPSERVICECONTROLLER_H
#define DAPSERVICECONTROLLER_H
andrey.daragan's avatar
andrey.daragan committed
#include "DapRpcLocalServer.h"
andrey.daragan's avatar
andrey.daragan committed
#include <QLocalServer>
typedef class DapRpcLocalServer DapUiService;

andrey.daragan's avatar
andrey.daragan committed

andrey.daragan's avatar
andrey.daragan committed
#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"
andrey.daragan's avatar
andrey.daragan committed
#include "handlers/DapGetWalletsInfoCommand.h"
andrey.daragan's avatar
andrey.daragan committed
#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"

#include "DapSystemTrayIcon.h"
#include "DapToolTipWidget.h"

andrey.daragan's avatar
andrey.daragan committed

Alexander's avatar
Alexander committed
/**
andrey.daragan's avatar
andrey.daragan committed
 * @brief The DapServiceController class
Alexander's avatar
Alexander committed
 * 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().
 */
andrey.daragan's avatar
andrey.daragan committed
class DapServiceController : public QObject
andrey.daragan's avatar
andrey.daragan committed
    /// Service core.
    DapSystemTrayIcon   * m_pSystemTrayIcon {nullptr};
    DapToolTipWidget    * m_pToolTipWidget {nullptr};
    /// The context menu of the widget in the system tray.
andrey.daragan's avatar
andrey.daragan committed
  
andrey.daragan's avatar
andrey.daragan committed
    /// Standard constructor.
    /// @param parent Parent.
    explicit DapServiceController(QObject * parent = nullptr);
andrey.daragan's avatar
andrey.daragan committed
    /// Start service: creating server and socket.
    /// @return Returns true if the service starts successfully, otherwise false.
andrey.daragan's avatar
andrey.daragan committed
    bool start();
    
signals:
    /// The signal is emitted in case of successful connection of a new client.
    void onNewClientConnected();
andrey.daragan's avatar
andrey.daragan committed
    
private slots:
    /// Register command.
    void registerCommand();
andrey.daragan's avatar
andrey.daragan committed
#endif // DAPSERVICECONTROLLER_H