25#include <unordered_set>
159 const std::unordered_set<GUIGlID>&
getSelected()
const;
198 std::set<GUIGlID>
loadIDs(std::istream& strm, std::string& msgOut,
GUIGlObjectType type =
GLO_MAX, std::ostream* dynamicNotFound =
nullptr,
int maxErrors = 16);
211 void save(
const std::string& filename)
const;
256 void save(
const std::string& filename);
261 const std::unordered_set<GUIGlID>&
getSelected()
const;
283 static void save(
const std::string& filename,
const std::unordered_set<GUIGlID>& ids);
A container for ids of selected objects of a certain type.
void clear()
Clears the list of selected objects.
void select(GUIGlID id)
Adds the object with the given id to the list of selected objects.
const std::unordered_set< GUIGlID > & getSelected() const
Returns the list of selected ids.
~SingleTypeSelections()
Destructor.
void deselect(GUIGlID id)
Deselects the object with the given id from the list of selected objects.
SingleTypeSelections()
Constructor.
std::unordered_set< GUIGlID > mySelected
The list of selected ids.
void save(const std::string &filename)
Saves the list of selected objects to a file named as given.
bool isSelected(GUIGlID id)
Returns the information whether the object with the given id is qithin the selection.
virtual ~UpdateTarget()
virtual destructor
virtual void selectionUpdated()=0
called when selection is updated
Storage for "selected" objects.
void save(GUIGlObjectType type, const std::string &filename)
Saves a selection list.
std::map< GUIGlObjectType, SingleTypeSelections > mySelections
map with the selections
void notifyChanged()
inform the update target of earlier changes
~GUISelectedStorage()
Destructor.
void clear()
Clears the list of selected objects.
std::set< GUIGlID > loadIDs(std::istream &strm, std::string &msgOut, GUIGlObjectType type=GLO_MAX, std::ostream *dynamicNotFound=nullptr, int maxErrors=16)
Loads a selection list (optionally with restricted type) and returns the ids of all active objects.
void toggleSelection(GUIGlID id)
Toggles selection of an object.
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
UpdateTarget * myUpdateTarget
The dialog to be updated.
void add2Update(UpdateTarget *updateTarget)
Adds a dialog to be updated.
void remove2Update()
Removes the dialog to be updated.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
GUISelectedStorage()
Constructor.
std::unordered_set< GUIGlID > myAllSelected
List of selected objects.
void deselect(GUIGlID id)
Deselects the object with the given id.
const std::unordered_set< GUIGlID > & getSelected() const
Returns the set of ids of all selected objects.
std::string load(const std::string &filename, GUIGlObjectType type=GLO_MAX, std::ostream *dynamicNotFound=nullptr)
Loads a selection list (optionally with restricted type)
Static storage of an output device and its base (abstract) implementation.