2016-02-23 15:59:26 +00:00
|
|
|
#ifndef WALLETMANAGER_H
|
|
|
|
#define WALLETMANAGER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2016-02-24 10:25:20 +00:00
|
|
|
class Wallet;
|
2016-06-07 13:26:25 +00:00
|
|
|
namespace Bitmonero {
|
|
|
|
class WalletManager;
|
|
|
|
}
|
2016-02-24 10:25:20 +00:00
|
|
|
|
2016-02-23 15:59:26 +00:00
|
|
|
class WalletManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-02-24 10:25:20 +00:00
|
|
|
static WalletManager * instance();
|
2016-02-29 14:39:39 +00:00
|
|
|
// wizard: createWallet path;
|
2016-02-24 10:25:20 +00:00
|
|
|
Q_INVOKABLE Wallet * createWallet(const QString &path, const QString &password,
|
2016-06-07 13:26:25 +00:00
|
|
|
const QString &language, bool testnet = false);
|
2016-02-29 14:39:39 +00:00
|
|
|
// just for future use
|
2016-06-07 13:26:25 +00:00
|
|
|
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &password, bool testnet = false);
|
2016-02-29 14:39:39 +00:00
|
|
|
|
|
|
|
// wizard: recoveryWallet path; hint: internally it recorvers wallet and set password = ""
|
|
|
|
Q_INVOKABLE Wallet * recoveryWallet(const QString &path, const QString &memo,
|
2016-06-07 13:26:25 +00:00
|
|
|
bool testnet = false);
|
2016-02-23 15:59:26 +00:00
|
|
|
|
2016-02-29 14:39:39 +00:00
|
|
|
//! utils: close wallet to free memory
|
|
|
|
Q_INVOKABLE void closeWallet(Wallet * wallet);
|
|
|
|
|
2016-06-07 13:26:25 +00:00
|
|
|
//! checks is given filename is a wallet;
|
|
|
|
Q_INVOKABLE bool walletExists(const QString &path) const;
|
2016-02-29 14:39:39 +00:00
|
|
|
|
2016-06-07 13:26:25 +00:00
|
|
|
//! returns list with wallet's filenames, if found by given path
|
|
|
|
Q_INVOKABLE QStringList findWallets(const QString &path);
|
2016-02-29 14:39:39 +00:00
|
|
|
|
|
|
|
//! returns error description in human language
|
|
|
|
Q_INVOKABLE QString errorString() const;
|
2016-06-07 13:26:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
// wizard: both "create" and "recovery" paths.
|
|
|
|
// TODO: probably move it to "Wallet" interface
|
|
|
|
Q_INVOKABLE bool moveWallet(const QString &src, const QString &dst);
|
|
|
|
//! returns libwallet language name for given locale
|
|
|
|
Q_INVOKABLE QString walletLanguage(const QString &locale);
|
|
|
|
|
2016-02-23 15:59:26 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2016-02-24 10:25:20 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-07 13:26:25 +00:00
|
|
|
|
2016-02-24 10:25:20 +00:00
|
|
|
explicit WalletManager(QObject *parent = 0);
|
|
|
|
static WalletManager * m_instance;
|
2016-06-07 13:26:25 +00:00
|
|
|
Bitmonero::WalletManager * m_pimpl;
|
|
|
|
|
2016-02-23 15:59:26 +00:00
|
|
|
};
|
|
|
|
|
2016-02-24 10:25:20 +00:00
|
|
|
#endif // WALLETMANAGER_H
|