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

#include <GraphNeedsSavingObserver.h>

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

Signals

void savingNeeded ()
 

Public Member Functions

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

Protected Member Functions

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

Detailed Description

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

See also
Observable
  • 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 45 of file GraphNeedsSavingObserver.h.

Constructor & Destructor Documentation

◆ GraphNeedsSavingObserver()

tlp::GraphNeedsSavingObserver::GraphNeedsSavingObserver ( Graph graph,
QMainWindow *  mainWindow = nullptr 
)

GraphNeedsSavingObserver Class constructor.

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

Member Function Documentation

◆ forceToSave()

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.

◆ needsSaving()

bool tlp::GraphNeedsSavingObserver::needsSaving ( ) const

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

Returns
true if the graph needs to be saved, false otherwise.

◆ saved()

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.

◆ savingNeeded

void tlp::GraphNeedsSavingObserver::savingNeeded ( )
signal

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

◆ treatEvents()

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

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

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

Reimplemented from tlp::Observable.