File indexing completed on 2024-04-28 16:30:08
0001 /*************************************************************************** 0002 * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr 0003 * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 ***************************************************************************/ 0006 #ifndef SKGBANKOBJECT_H 0007 #define SKGBANKOBJECT_H 0008 /** @file 0009 * This file defines classes SKGBankObject. 0010 * 0011 * @author Stephane MANKOWSKI / Guillaume DE BURE 0012 */ 0013 0014 #include "skgbankmodeler_export.h" 0015 #include "skgnamedobject.h" 0016 0017 class SKGAccountObject; 0018 /** 0019 * This class manages bank object 0020 */ 0021 class SKGBANKMODELER_EXPORT SKGBankObject final : public SKGNamedObject 0022 { 0023 public: 0024 /** 0025 * Default constructor 0026 */ 0027 explicit SKGBankObject(); 0028 0029 /** 0030 * Constructor 0031 * @param iDocument the document containing the object 0032 * @param iID the identifier in @p iTable of the object 0033 */ 0034 explicit SKGBankObject(SKGDocument* iDocument, int iID = 0); 0035 0036 /** 0037 * Copy constructor 0038 * @param iObject the object to copy 0039 */ 0040 SKGBankObject(const SKGBankObject& iObject); 0041 0042 /** 0043 * Copy constructor 0044 * @param iObject the object to copy 0045 */ 0046 explicit SKGBankObject(const SKGNamedObject& iObject); 0047 0048 /** 0049 * Copy constructor 0050 * @param iObject the object to copy 0051 */ 0052 explicit SKGBankObject(const SKGObjectBase& iObject); 0053 0054 /** 0055 * Operator affectation 0056 * @param iObject the object to copy 0057 */ 0058 SKGBankObject& operator= (const SKGObjectBase& iObject); 0059 0060 /** 0061 * Operator affectation 0062 * @param iObject the object to copy 0063 */ 0064 SKGBankObject& operator= (const SKGBankObject& iObject); 0065 0066 /** 0067 * Destructor 0068 */ 0069 virtual ~SKGBankObject(); 0070 0071 /** 0072 * Add an account 0073 * @param oAccount the created account 0074 * @return an object managing the error. 0075 * @see SKGError 0076 */ 0077 SKGError addAccount(SKGAccountObject& oAccount); 0078 0079 /** 0080 * Get accounts 0081 * @param oAccountList the list of accounts in this bank 0082 * @return an object managing the error 0083 * @see SKGError 0084 */ 0085 SKGError getAccounts(SKGListSKGObjectBase& oAccountList) const; 0086 0087 /** 0088 * Set the number of the bank 0089 * @param iNumber the number 0090 * @return an object managing the error 0091 * @see SKGError 0092 */ 0093 SKGError setNumber(const QString& iNumber); 0094 0095 /** 0096 * Get the number of the bank 0097 * @return the number 0098 */ 0099 QString getNumber() const; 0100 0101 /** 0102 * Set the icon of the bank 0103 * @param iIcon the icon 0104 * @return an object managing the error 0105 * @see SKGError 0106 */ 0107 SKGError setIcon(const QString& iIcon); 0108 0109 /** 0110 * Get the icon of the bank 0111 * @return the number 0112 */ 0113 QString getIcon() const; 0114 0115 /** 0116 * Get the current amount 0117 * @return the current amount 0118 */ 0119 double getCurrentAmount() const; 0120 }; 0121 /** 0122 * Declare the class 0123 */ 0124 Q_DECLARE_TYPEINFO(SKGBankObject, Q_MOVABLE_TYPE); 0125 0126 #endif