File indexing completed on 2024-04-28 16:30:14

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 SKGSUBOPERATIONOBJECT_H
0007 #define SKGSUBOPERATIONOBJECT_H
0008 /** @file
0009  * This file defines classes SKGSubOperationObject.
0010  *
0011  * @author Stephane MANKOWSKI / Guillaume DE BURE
0012  */
0013 
0014 #include "skgbankmodeler_export.h"
0015 #include "skgobjectbase.h"
0016 class SKGOperationObject;
0017 class SKGCategoryObject;
0018 class SKGTrackerObject;
0019 
0020 /**
0021  * This class manages suboperation object
0022  */
0023 class SKGBANKMODELER_EXPORT SKGSubOperationObject final : public SKGObjectBase
0024 {
0025 public:
0026     /**
0027      * Default constructor
0028      */
0029     explicit SKGSubOperationObject();
0030 
0031     /**
0032      * Constructor
0033      * @param iDocument the document containing the object
0034      * @param iID the identifier in @p iTable of the object
0035      */
0036     explicit SKGSubOperationObject(SKGDocument* iDocument, int iID = 0);
0037 
0038     /**
0039      * Copy constructor
0040      * @param iObject the object to copy
0041      */
0042     SKGSubOperationObject(const SKGSubOperationObject& iObject);
0043 
0044     /**
0045      * Copy constructor
0046      * @param iObject the object to copy
0047      */
0048     explicit SKGSubOperationObject(const SKGObjectBase& iObject);
0049 
0050     /**
0051      * Operator affectation
0052      * @param iObject the object to copy
0053      */
0054     SKGSubOperationObject& operator= (const SKGObjectBase& iObject);
0055 
0056     /**
0057      * Operator affectation
0058      * @param iObject the object to copy
0059      */
0060     SKGSubOperationObject& operator= (const SKGSubOperationObject& iObject);
0061 
0062     /**
0063      * Destructor
0064      */
0065     virtual ~SKGSubOperationObject();
0066 
0067     /**
0068      * Set date of this subtransaction
0069      * @param iDate the date
0070      * @return an object managing the error
0071      *   @see SKGError
0072      */
0073     // cppcheck-suppress passedByValue
0074     SKGError setDate(QDate iDate);
0075 
0076     /**
0077      * Get date of this subtransaction
0078      * @return the date
0079      */
0080     QDate getDate() const;
0081 
0082     /**
0083      * Set the order of suboperation
0084      * @param iOrder the order
0085      * @return an object managing the error
0086      *   @see SKGError
0087      */
0088     SKGError setOrder(int iOrder);
0089 
0090     /**
0091      * Get order of this subtransaction
0092      * @return the order
0093      */
0094     int getOrder() const;
0095 
0096     /**
0097      * Set the comment of suboperation
0098      * @param iComment the comment
0099      * @return an object managing the error
0100      *   @see SKGError
0101      */
0102     SKGError setComment(const QString& iComment);
0103 
0104     /**
0105      * Get the comment of this subtransaction
0106      * @return the comment
0107      */
0108     QString getComment() const;
0109 
0110     /**
0111      * Get the parent operation
0112      * @param oOperation the parent operation
0113      * @return an object managing the error.
0114      *   @see SKGError
0115      */
0116     SKGError getParentOperation(SKGOperationObject& oOperation) const;
0117 
0118     /**
0119      * Set the parent operation
0120      * @param iOperation the parent operation
0121      * @return an object managing the error.
0122      *   @see SKGError
0123      */
0124     SKGError setParentOperation(const SKGOperationObject& iOperation);
0125 
0126     /**
0127      * Set the category
0128      * @param iCategory the category
0129      * @return an object managing the error
0130      *   @see SKGError
0131      */
0132     SKGError setCategory(const SKGCategoryObject& iCategory);
0133 
0134     /**
0135      * Get the category
0136      * @param oCategory the category
0137      * @return an object managing the error
0138      *   @see SKGError
0139      */
0140     SKGError getCategory(SKGCategoryObject& oCategory) const;
0141 
0142     /**
0143      * Set the tracker
0144      * @param iTracker the tracker
0145      * @param iForce force the change of the tracker even if closed
0146      * @return an object managing the error
0147      *   @see SKGError
0148      */
0149     SKGError setTracker(const SKGTrackerObject& iTracker, bool iForce = false);
0150 
0151     /**
0152      * Get the tracker
0153      * @param oTracker the tracker
0154      * @return an object managing the error
0155      *   @see SKGError
0156      */
0157     SKGError getTracker(SKGTrackerObject& oTracker) const;
0158 
0159     /**
0160      * Set the quantity of the subtransaction
0161      * @param iValue the value
0162      * @return an object managing the error
0163      *   @see SKGError
0164      */
0165     SKGError setQuantity(double iValue);
0166 
0167     /**
0168      * Get the quantity of the subtransaction
0169      * @return the value
0170      */
0171     double getQuantity() const;
0172 
0173     /**
0174      * Set the formula
0175      * @param iFormula the formula
0176      * @return an object managing the error
0177      *   @see SKGError
0178      */
0179     SKGError setFormula(const QString& iFormula);
0180 
0181     /**
0182      * Get the formula
0183      * @return the formula
0184      */
0185     QString getFormula() const;
0186 };
0187 
0188 /**
0189  * Declare the class
0190  */
0191 Q_DECLARE_TYPEINFO(SKGSubOperationObject, Q_MOVABLE_TYPE);
0192 #endif