File indexing completed on 2024-03-24 05:56:00
0001 /* 0002 This file is part of the Okteta Core library, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <kossebau@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef OKTETA_CHANGEHISTORY_HPP 0010 #define OKTETA_CHANGEHISTORY_HPP 0011 0012 // lib 0013 #include "bytearraychange.hpp" 0014 // Qt 0015 #include <QVector> 0016 #include <QtPlugin> 0017 0018 class QByteArray; 0019 0020 namespace Okteta { 0021 0022 // TODO: split readonly part into own interface 0023 class ChangeHistory 0024 { 0025 public: 0026 virtual ~ChangeHistory(); 0027 0028 public: // get 0029 virtual QVector<ByteArrayChange> changes(int firstVersionIndex, int lastVersionIndex) const = 0; 0030 virtual QByteArray initialData() const = 0; 0031 0032 public: // set 0033 virtual void doChanges(const QVector<Okteta::ByteArrayChange>& changes, 0034 int oldVersionIndex, int newVersionIndex) = 0; 0035 0036 public: // signal 0037 virtual void changesDone(const QVector<Okteta::ByteArrayChange>& changes, 0038 int oldVersionIndex, int newVersionIndex) = 0; 0039 }; 0040 0041 inline ChangeHistory::~ChangeHistory() = default; 0042 0043 } 0044 0045 Q_DECLARE_INTERFACE(Okteta::ChangeHistory, "org.kde.okteta.changehistory/1.0") 0046 0047 #endif