001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.osm;
003
004import java.util.Collection;
005
006/**
007 * Global OSM dataset registry.
008 * @since 14143
009 */
010public interface IOsmDataManager {
011
012    /**
013     * Replies the current selected OSM primitives, from a end-user point of view.
014     * It is not always technically the same collection of primitives than {@link DataSet#getSelected()}.
015     * @return The current selected OSM primitives, from a end-user point of view. Can be {@code null}.
016     */
017    Collection<OsmPrimitive> getInProgressSelection();
018
019    /**
020     * Replies the current selected primitives, from a end-user point of view.
021     * It is not always technically the same collection of primitives than {@link OsmData#getSelected()}.
022     * @return The current selected primitives, from a end-user point of view. Can be {@code null}.
023     */
024    Collection<? extends IPrimitive> getInProgressISelection();
025
026    /**
027     * Gets the active edit data set (not read-only).
028     * @return That data set, <code>null</code>.
029     * @see #getActiveDataSet
030     */
031    DataSet getEditDataSet();
032
033    /**
034     * Gets the active data set (can be read-only).
035     * @return That data set, <code>null</code>.
036     * @see #getEditDataSet
037     */
038    DataSet getActiveDataSet();
039
040    /**
041     * Sets the active data set (and also edit data set if not read-only).
042     * @param ds New data set, or <code>null</code>
043     */
044    void setActiveDataSet(DataSet ds);
045
046    /**
047     * Determines if the list of data sets managed by JOSM contains {@code ds}.
048     * @param ds the data set to look for
049     * @return {@code true} if the list of data sets managed by JOSM contains {@code ds}
050     */
051    boolean containsDataSet(DataSet ds);
052}