Files
pay/src/AccountConfig.h
T

66 lines
1.9 KiB
C++
Raw Permalink Normal View History

2023-05-15 14:50:17 +02:00
/*
* This file is part of the Flowee project
* Copyright (C) 2023 Tom Zander <tom@flowee.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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2023-05-31 10:42:05 +02:00
#ifndef FLOWEE_ACCOUNT_CONFIG_H
#define FLOWEE_ACCOUNT_CONFIG_H
2023-05-15 14:50:17 +02:00
2023-05-16 15:32:33 +02:00
#include <QMap>
#include <QString>
2023-05-15 14:50:17 +02:00
#include <cstdint>
2023-05-16 15:32:33 +02:00
class Wallet;
2023-05-15 14:50:17 +02:00
/**
* A set of user-level config fields for a wallet.
* This is owned by the FloweePay application singleton.
*/
2023-05-31 10:42:05 +02:00
class AccountConfig
2023-05-15 14:50:17 +02:00
{
public:
/// creates an invalid wallet config
2023-05-31 10:42:05 +02:00
AccountConfig() = default;
explicit AccountConfig(uint16_t walletId);
explicit AccountConfig(Wallet *wallet);
AccountConfig(const AccountConfig &other);
2023-05-15 14:50:17 +02:00
2023-05-31 10:42:05 +02:00
AccountConfig &operator=(const AccountConfig &other);
2023-05-15 14:50:17 +02:00
bool isValid() const;
2023-05-31 10:32:44 +02:00
/**
* Returns true if the account balance should be counted in the portfolio total balance.
* Notice that an archived wallet will never be counted in the total portfolio balance.
*/
2023-05-15 14:50:17 +02:00
bool countBalance() const;
void setCountBalance(bool newCountBalance);
2023-05-16 15:32:33 +02:00
bool allowInstaPay() const;
void setAllowInstaPay(bool on);
const QMap<QString, int>& fiatInstaPayLimits() const;
int fiatInstaPayLimit(const QString &currencyCode) const;
void setFiatInstaPayLimit(const QString &currencyCode, int limitInCent);
2023-05-15 14:50:17 +02:00
2023-05-16 19:55:52 +02:00
bool isPrivate() const;
void setIsPrivate(bool newIsPrivate);
2023-05-15 14:50:17 +02:00
private:
int m_walletId = -1;
};
#endif