21 #ifndef GRAPHNEEDSSAVINGOBSERVER_H
22 #define GRAPHNEEDSSAVINGOBSERVER_H
24 #include <tulip/Observable.h>
25 #include <tulip/ObservableGraph.h>
26 #include <tulip/ObservableProperty.h>
27 #include <tulip/Observable.h>
28 #include <tulip/Graph.h>
30 #include <QtGui/qtabwidget.h>
31 #include <tulip/PropertyInterface.h>
39 GraphNeedsSavingObserver(
tlp::Graph* graph) :_needsSaving(false), _graph(graph) {
45 virtual void treatEvents(
const std::vector<tlp::Event>&) {
57 bool needsSaving()
const {
79 std::deque<tlp::Graph*> toObserve;
80 toObserve.push_back(_graph);
82 while(!toObserve.empty()) {
85 toObserve.pop_front();
96 toObserve.push_back(subgraphs);
104 void removeObservers() {
105 std::deque<tlp::Graph*> toUnobserve;
106 toUnobserve.push_back(_graph);
108 while(!toUnobserve.empty()) {
110 toUnobserve.pop_front();
123 toUnobserve.push_back(subgraphs);
132 #endif //GRAPHNEEDSSAVINGOBSERVER_H