File indexing completed on 2024-05-12 16:42:18
0001 /* 0002 SPDX-FileCopyrightText: 2014-2017 Thomas Baumgart <tbaumgart@kde.org> 0003 SPDX-FileCopyrightText: 2017 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef LEDGERSCHEDULE_H 0008 #define LEDGERSCHEDULE_H 0009 0010 // ---------------------------------------------------------------------------- 0011 // QT Includes 0012 0013 // ---------------------------------------------------------------------------- 0014 // KDE Includes 0015 0016 // ---------------------------------------------------------------------------- 0017 // Project Includes 0018 0019 #include "ledgertransaction.h" 0020 0021 class MyMoneySchedule; 0022 class MyMoneyTransaction; 0023 0024 class LedgerSchedulePrivate; 0025 class LedgerSchedule : public LedgerTransaction 0026 { 0027 public: 0028 explicit LedgerSchedule(const MyMoneySchedule& s, const MyMoneyTransaction& t, const MyMoneySplit& sp); 0029 LedgerSchedule(const LedgerSchedule & other); 0030 LedgerSchedule(LedgerSchedule && other); 0031 LedgerSchedule & operator=(LedgerSchedule other); 0032 friend void swap(LedgerSchedule& first, LedgerSchedule& second); 0033 ~LedgerSchedule() override; 0034 0035 /// @copydoc LedgerItem::transactionSplitId() 0036 QString transactionSplitId() const override; 0037 0038 QString scheduleId() const; 0039 0040 /// @copydoc LedgerItem::isImported() 0041 bool isImported() const override; 0042 0043 private: 0044 LedgerSchedule(); 0045 Q_DECLARE_PRIVATE(LedgerSchedule) 0046 }; 0047 0048 inline void swap(LedgerSchedule& first, LedgerSchedule& second) // krazy:exclude=inline 0049 { 0050 using std::swap; 0051 swap(first.d_ptr, second.d_ptr); 0052 } 0053 0054 inline LedgerSchedule::LedgerSchedule(LedgerSchedule && other) : LedgerSchedule() // krazy:exclude=inline 0055 { 0056 swap(*this, other); 0057 } 0058 0059 inline LedgerSchedule & LedgerSchedule::operator=(LedgerSchedule other) // krazy:exclude=inline 0060 { 0061 swap(*this, other); 0062 return *this; 0063 } 0064 0065 #endif // LEDGERSCHEDULE_H 0066