forked from KDE/okteta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangehistory.hpp
49 lines (35 loc) · 1.21 KB
/
changehistory.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
This file is part of the Okteta Core library, made within the KDE community.
SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <[email protected]>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#ifndef OKTETA_CHANGEHISTORY_HPP
#define OKTETA_CHANGEHISTORY_HPP
// lib
#include "bytearraychange.hpp"
// Qt
#include <QVector>
#include <QtPlugin>
class QByteArray;
namespace Okteta {
// TODO: split readonly part into own interface
class ChangeHistory
{
public:
virtual ~ChangeHistory();
public: // get
[[nodiscard]]
virtual QVector<ByteArrayChange> changes(int firstVersionIndex, int lastVersionIndex) const = 0;
[[nodiscard]]
virtual QByteArray initialData() const = 0;
public: // set
virtual void doChanges(const QVector<Okteta::ByteArrayChange>& changes,
int oldVersionIndex, int newVersionIndex) = 0;
public: // signal
virtual void changesDone(const QVector<Okteta::ByteArrayChange>& changes,
int oldVersionIndex, int newVersionIndex) = 0;
};
inline ChangeHistory::~ChangeHistory() = default;
}
Q_DECLARE_INTERFACE(Okteta::ChangeHistory, "org.kde.okteta.changehistory/1.0")
#endif