1 /* 2 * This file is part of KMyMoney, A Personal Finance Manager by KDE 3 * Copyright (C) 2014 Christian Dávid <christian-david@web.de> 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef NATIONALACCOUNTID_H 20 #define NATIONALACCOUNTID_H 21 22 #include "kmm_mymoney_export.h" 23 24 #include "mymoney/payeeidentifier/payeeidentifierdata.h" 25 26 namespace payeeIdentifiers 27 { 28 29 class KMM_MYMONEY_EXPORT nationalAccount : public payeeIdentifierData 30 { 31 public: 32 PAYEEIDENTIFIER_IID(nationalAccount, "org.kmymoney.payeeIdentifier.national"); 33 34 nationalAccount(); 35 nationalAccount(const nationalAccount& other); 36 37 bool isValid() const final override; 38 bool operator==(const payeeIdentifierData& other) const final override; 39 bool operator==(const nationalAccount& other) const; 40 clone()41 nationalAccount* clone() const final override { 42 return new nationalAccount(*this); 43 } 44 nationalAccount* createFromXml(const QDomElement& element) const final override; 45 void writeXML(QDomDocument& document, QDomElement& parent) const final override; 46 setBankCode(const QString & bankCode)47 void setBankCode(const QString& bankCode) { 48 m_bankCode = bankCode; 49 } bankCode()50 QString bankCode() const { 51 return m_bankCode; 52 } 53 54 /** @todo implement */ bankName()55 QString bankName() const { 56 return QString(); 57 } 58 setAccountNumber(const QString & accountNumber)59 void setAccountNumber(const QString& accountNumber) { 60 m_accountNumber = accountNumber; 61 } accountNumber()62 QString accountNumber() const { 63 return m_accountNumber; 64 } 65 country()66 QString country() const { 67 return m_country; 68 } setCountry(const QString & countryCode)69 void setCountry(const QString& countryCode) { 70 m_country = countryCode.toUpper(); 71 } 72 ownerName()73 QString ownerName() const { 74 return m_ownerName; 75 } setOwnerName(const QString & ownerName)76 void setOwnerName(const QString& ownerName) { 77 m_ownerName = ownerName; 78 } 79 80 private: 81 QString m_ownerName; 82 QString m_country; 83 QString m_bankCode; 84 QString m_accountNumber; 85 }; 86 87 } // namespace payeeIdentifiers 88 89 #endif // NATIONALACCOUNTID_H 90