Debian Codegraph @

include/imapfilechangetracker.h

raw
1 #pragma once
2
3 #include "inode.h"
4 #include <sigc++/signal.h>
5
6 /**
7 * The file change tracker monitors the changes made to a single map with the help
8 * of the root node's undo system. It fires the given callback function whenever
9 * the change count is increased or decreased (this is happening on change, undo and redo).
10 * It also provides methods for the client code to check whether the current point
11 * in the map's undo history corresponds to a saved state or not - this allows to keep
12 * the map's modified flag up to date.
13 */
14 class IMapFileChangeTracker
15 {
16 public:
17 virtual ~IMapFileChangeTracker() {}
18
19 // The change count we're currently at. This represents a position in the map's undo history.
20 virtual std::size_t getCurrentChangeCount() const = 0;
21
22 // Marks the current change count as the one that got saved
23 virtual void setSavedChangeCount() = 0;
24
25 // Returns true if the current undo history position corresponds to the most recently saved state
26 virtual bool isAtSavedPosition() const = 0;
27
28 // Emitted as soon as the current change count is modified
29 virtual sigc::signal<void()>& signal_changed() = 0;
30 };