File indexing completed on 2024-06-09 05:01:52

0001 /*
0002     SPDX-FileCopyrightText: 2014 Christian Dávid <christian-david@web.de>
0003     SPDX-FileCopyrightText: 2022 Thomas Baumgart <tbaumgart@kde.org>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef NATIONALACCOUNTID_H
0008 #define NATIONALACCOUNTID_H
0009 
0010 #include "kmm_mymoney_export.h"
0011 
0012 #include "mymoney/payeeidentifier/payeeidentifierdata.h"
0013 
0014 namespace payeeIdentifiers
0015 {
0016 
0017 class KMM_MYMONEY_EXPORT nationalAccount : public payeeIdentifierData
0018 {
0019 public:
0020     PAYEEIDENTIFIER_IID(nationalAccount, "org.kmymoney.payeeIdentifier.national");
0021 
0022     nationalAccount();
0023     nationalAccount(const nationalAccount& other);
0024 
0025     bool isValid() const final override;
0026     bool operator==(const payeeIdentifierData& other) const final override;
0027     bool operator==(const nationalAccount& other) const;
0028 
0029     nationalAccount* clone() const final override {
0030         return new nationalAccount(*this);
0031     }
0032     nationalAccount* createFromXml(QXmlStreamReader* reader) const final override;
0033     void writeXML(QXmlStreamWriter* writer) const final override;
0034 
0035     void setBankCode(const QString& bankCode) {
0036         m_bankCode = bankCode;
0037     }
0038     QString bankCode() const {
0039         return m_bankCode;
0040     }
0041 
0042     /** @todo implement */
0043     QString bankName() const {
0044         return QString();
0045     }
0046 
0047     void setAccountNumber(const QString& accountNumber) {
0048         m_accountNumber = accountNumber;
0049     }
0050     QString accountNumber() const {
0051         return m_accountNumber;
0052     }
0053 
0054     QString country() const {
0055         return m_country;
0056     }
0057     void setCountry(const QString& countryCode) {
0058         m_country = countryCode.toUpper();
0059     }
0060 
0061     QString ownerName() const {
0062         return m_ownerName;
0063     }
0064     void setOwnerName(const QString& ownerName) {
0065         m_ownerName = ownerName;
0066     }
0067 
0068 private:
0069     QString m_ownerName;
0070     QString m_country;
0071     QString m_bankCode;
0072     QString m_accountNumber;
0073 };
0074 
0075 } // namespace payeeIdentifiers
0076 
0077 #endif // NATIONALACCOUNTID_H