001// License: GPL. For details, see Readme.txt file.
002package org.openstreetmap.gui.jmapviewer.interfaces;
003
004import java.awt.Image;
005
006import org.openstreetmap.gui.jmapviewer.Coordinate;
007
008public interface Attributed {
009    /**
010     * @return True if the tile source requires attribution in text or image form.
011     */
012    boolean requiresAttribution();
013
014    /**
015     * @param zoom The optional zoom level for the view.
016     * @param botRight The bottom right of the bounding box for attribution.
017     * @param topLeft The top left of the bounding box for attribution.
018     * @return Attribution text for the image source.
019     */
020    String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight);
021
022    /**
023     * @return The URL to open when the user clicks the attribution text.
024     */
025    String getAttributionLinkURL();
026
027    /**
028     * @return The URL for the attribution image. Null if no image should be displayed.
029     */
030    Image getAttributionImage();
031
032    /**
033     * @return The URL to open when the user clicks the attribution image.
034     * When return value is null, the image is still displayed (provided getAttributionImage()
035     * returns a value other than null), but the image does not link to a website.
036     */
037    String getAttributionImageURL();
038
039    /**
040     * @return The attribution "Terms of Use" text.
041     * In case it returns null, but getTermsOfUseURL() is not null, a default
042     * terms of use text is used.
043     */
044    String getTermsOfUseText();
045
046    /**
047     * @return The URL to open when the user clicks the attribution "Terms of Use" text.
048     */
049    String getTermsOfUseURL();
050}