1 #ifndef GUI_HASUNSAVEDCHANGES_H_INCLUDED
2 #define GUI_HASUNSAVEDCHANGES_H_INCLUDED
42 typedef std::vector<HasUnsavedChanges*> ChildrenType;
51 ChildrenType::iterator
begin();
54 ChildrenType::const_iterator
begin()
const;
57 ChildrenType::iterator
end();
60 ChildrenType::const_iterator
end()
const;
83 void AddChild(ChildrenType::value_type&& v);
103 ChildrenType m_children;
130 #endif // end_of_inclde_guard
virtual void InternalForceClose()
Implementation should only close THIS widget, not its children.
virtual bool InternalIsClean() const =0
The result should be true only if THIS widget is in clean state.
virtual bool InternalSave()
Implementation should only save THIS widget.
virtual void InternalForceClose()=0
Implementation should only close THIS widget, not its children.
bool Save()
Try to save this widget's (and its children's) changes.
ChildrenType::iterator end()
Get iterator to one position after last child.
Dummy UnsavedChanges class.
ChildrenType::iterator begin()
Get iterator to first child.
virtual bool IsOpened() const =0
void ForceClose()
Force this object and its children to go back to unopened state so it can be safely deleted...
const std::string & GetTitle()
Get title of this object.
virtual bool IsOpened() const
void AddChild(ChildrenType::value_type &&v)
Add child.
Abstract class that represents the ability be in closed or opened state, and, if the latter...
void SetChildren(ChildrenType &&c)
Set children.
virtual bool InternalIsClean() const
The result should be true only if THIS widget is in clean state.
bool SaveAndClose()
Try to save this object (and its children) and, if successful, close them all.
virtual ~HasUnsavedChanges()
Virtual destructor.
Namespace for generic graphical shell for simulators.
virtual void InternalPreForceClose()
Additional things to do before closing children of this widget.
HasUnsavedChanges(std::string &&title)
virtual bool InternalSave()=0
Implementation should only save THIS widget.