status-react/modules/react-native-status/desktop/rctstatus.h

92 lines
3.5 KiB
C
Raw Normal View History

/**
* Copyright (c) 2017-present, Status Research and Development GmbH.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#ifndef RCTSTATUS_H
#define RCTSTATUS_H
#include "moduleinterface.h"
#include <QLoggingCategory>
#include <QVariantMap>
Q_DECLARE_LOGGING_CATEGORY(RCTSTATUS)
class RCTStatusPrivate;
class RCTStatus : public QObject, public ModuleInterface {
Q_OBJECT
Q_INTERFACES(ModuleInterface)
Q_DECLARE_PRIVATE(RCTStatus)
public:
Q_INVOKABLE RCTStatus(QObject* parent = 0);
~RCTStatus();
void setBridge(Bridge* bridge) override;
QString moduleName() override;
QList<ModuleMethod*> methodsToExport() override;
QVariantMap constantsToExport() override;
Q_INVOKABLE void initKeystore();
Q_INVOKABLE void createAccount(QString password, double callbackId);
Q_INVOKABLE void sendDataNotification(QString dataPayloadJSON, QString tokensJSON, double callbackId);
2019-04-30 11:49:45 +00:00
Q_INVOKABLE void sendLogs(QString dbJSON, QString jsLogs, double callbackId);
Q_INVOKABLE void addPeer(QString enode, double callbackId);
2019-08-01 20:11:59 +00:00
Q_INVOKABLE void prepareDirAndUpdateConfig(QString configString, double callbackId);
Q_INVOKABLE void login(QString accountData, QString password);
Q_INVOKABLE void saveAccountAndLogin(QString accountData, QString password, QString config, QString subAccountsData);
Q_INVOKABLE void logout();
Q_INVOKABLE void openAccounts(double callbackId);
Q_INVOKABLE void multiAccountStoreAccount(QString json, double callbackId);
Q_INVOKABLE void multiAccountLoadAccount(QString json, double callbackId);
Q_INVOKABLE void multiAccountReset(double callbackId);
Q_INVOKABLE void multiAccountDeriveAddresses(QString json, double callbackId);
Q_INVOKABLE void verify(QString address, QString password, double callbackId);
Q_INVOKABLE void sendTransaction(QString txArgsJSON, QString password, double callbackId);
Q_INVOKABLE void signMessage(QString rpcParams, double callbackId);
Q_INVOKABLE void signGroupMembership(QString content, double callbackId);
Q_INVOKABLE void extractGroupMembershipSignatures(QString signatures, double callbackId);
Q_INVOKABLE void updateMailservers(QString enodes, double callbackId);
Q_INVOKABLE void getNodesFromContract(QString url, QString address, double callbackId);
Q_INVOKABLE void chaosModeUpdate(bool on, double callbackId);
Q_INVOKABLE void setAdjustResize();
Q_INVOKABLE void setAdjustPan();
Q_INVOKABLE void setSoftInputMode(int i);
Q_INVOKABLE void clearCookies();
Q_INVOKABLE void clearStorageAPIs();
Q_INVOKABLE void callRPC(QString payload, double callbackId);
Q_INVOKABLE void callPrivateRPC(QString payload, double callbackId);
Q_INVOKABLE void closeApplication();
Q_INVOKABLE void getDeviceUUID(double callbackId);
Q_INVOKABLE static bool JSCEnabled();
2018-08-16 19:51:48 +00:00
Q_INVOKABLE static void statusGoEventCallback(const char* event);
2018-08-16 19:51:48 +00:00
void emitStatusGoEvent(QString event);
Q_SIGNALS:
2018-08-16 19:51:48 +00:00
void statusGoEvent(QString event);
private Q_SLOTS:
2018-08-16 19:51:48 +00:00
void onStatusGoEvent(QString event);
private:
void logStatusGoResult(const char* methodName, const char* result);
2019-08-01 20:11:59 +00:00
QString prepareDirAndUpdateConfig(QString configString);
QScopedPointer<RCTStatusPrivate> d_ptr;
QString d_gethLogFilePath;
};
#endif // RCTSTATUS_H