Tulip  5.1.0
Large graphs analysis and drawing
tlp::GraphNeedsSavingObserver Class Reference

#include <GraphNeedsSavingObserver.h>

+ Inheritance diagram for tlp::GraphNeedsSavingObserver:
+ Collaboration diagram for tlp::GraphNeedsSavingObserver:


void savingNeeded ()

Public Member Functions

 GraphNeedsSavingObserver (Graph *graph, QMainWindow *mainWindow=NULL)
void forceToSave ()
bool needsSaving () const
void saved ()

Protected Member Functions

virtual void treatEvents (const std::vector< Event > &)

Detailed Description

The GraphNeedsSavingObserver class will observe a graph and tells if it has been modified.

See also
  • The constructor. Observe the graph given in parameter for modification
  • needsSaving. Returns true is the graph has been modified
  • saved. The graph has been saved, and the status of the class must be reset. needsSaving will return false if called after saved().
  • savingNeeded. Signal send when the status of the graph evolves.

Definition at line 44 of file GraphNeedsSavingObserver.h.

Constructor & Destructor Documentation

tlp::GraphNeedsSavingObserver::GraphNeedsSavingObserver ( Graph graph,
QMainWindow *  mainWindow = NULL 

GraphNeedsSavingObserver Class constructor.

graphThe graph which needs to be observed for modifications
mainWindowThe Qt QMainWindow object behin the perspective

Member Function Documentation

void tlp::GraphNeedsSavingObserver::forceToSave ( )

forceToSave Even if there is no modification on the graph, this method can be used to force to save the graph.

bool tlp::GraphNeedsSavingObserver::needsSaving ( ) const

needsSaving Indicates if the graph has been modified, and thus needs to be saved.

true if the graph needs to be saved, false otherwise.
void tlp::GraphNeedsSavingObserver::saved ( )

saved If the graph has been saved, one has to call this method to reset the status of the graph (it does not need to be saved). to indicate that the graph does not need to be saved until a new modification.

void tlp::GraphNeedsSavingObserver::savingNeeded ( )

savingNeeded This signal is sent when the graph needs to be saved (it has been modified).

virtual void tlp::GraphNeedsSavingObserver::treatEvents ( const std::vector< Event > &  )

treatEvents This function is called when events are sent to Observers, and Observers only.

See also
Observable::treatEvents(const std::vector<Event>&)
eventsThe events that happened since the last unHoldObservers().

Reimplemented from tlp::Observable.