File indexing completed on 2024-12-22 04:13:03

0001 /*
0002  *  SPDX-FileCopyrightText: 2018 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KISTOOLCHANGESTRACKER_H
0008 #define KISTOOLCHANGESTRACKER_H
0009 
0010 #include "kritaui_export.h"
0011 #include <QScopedPointer>
0012 #include "KisToolChangesTrackerData.h"
0013 
0014 class KRITAUI_EXPORT KisToolChangesTracker :public QObject
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     KisToolChangesTracker();
0020     ~KisToolChangesTracker();
0021 
0022     void commitConfig(KisToolChangesTrackerDataSP state);
0023     void requestUndo();
0024     void requestRedo();
0025     KisToolChangesTrackerDataSP lastState() const;
0026     void reset();
0027 
0028     bool isEmpty() const;
0029 
0030     bool canUndo() const;
0031     bool canRedo() const;
0032 
0033 Q_SIGNALS:
0034     void sigConfigChanged(KisToolChangesTrackerDataSP state);
0035 
0036 private:
0037     struct Private;
0038     const QScopedPointer<Private> m_d;
0039 };
0040 
0041 #endif // KISTOOLCHANGESTRACKER_H