source: josm/trunk/src/org/openstreetmap/josm/gui/layer/UploadToServer.java@ 13453

Last change on this file since 13453 was 13453, checked in by Don-vip, 6 years ago

fix #8039, fix #10456: final fixes for the read-only/locked layers:

  • rename "read-only" to "locked" (in XML and Java classes/interfaces)
  • add a new download policy (true/never) to allow private layers forbidding only to download data, but allowing everything else

This leads to:

  • normal layers: download allowed, modifications allowed, upload allowed
  • private layers: download allowed or not (download=true/never), modifications allowed, upload allowed or not (upload=true/discouraged/never)
  • locked layers: nothing allowed, the data cannot be modified in any way
  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.layer;
3
4import org.openstreetmap.josm.gui.io.AbstractIOTask;
5import org.openstreetmap.josm.gui.io.AbstractUploadDialog;
6import org.openstreetmap.josm.gui.progress.ProgressMonitor;
7
8/**
9 * Interface for layers that can upload data.
10 * @see DownloadFromServer
11 * @since 9751
12 */
13public interface UploadToServer {
14
15 /**
16 * Determines if the layer is able to upload data and implements the
17 * {@code UploadToServer} interface. A layer that implements the
18 * {@code UploadToServer} interface must return {@code true}.
19 *
20 * @return {@code true} if the layer is able to upload data; {@code false}, otherwise
21 */
22 boolean isUploadable();
23
24 /**
25 * Determines if the data managed by this layer needs to be uploaded to
26 * the server because it contains modified data.
27 *
28 * @return {@code true} if the data managed by this layer needs to be
29 * uploaded to the server because it contains modified data;
30 * {@code false}, otherwise
31 */
32 boolean requiresUploadToServer();
33
34 /**
35 * Determines if upload of data managed by this layer is discouraged.
36 * This feature allows to use "private" data layers.
37 *
38 * @return {@code true} if upload is discouraged for this layer; {@code false}, otherwise
39 */
40 boolean isUploadDiscouraged();
41
42 /**
43 * Determines if upload of data managed by this layer is currently in progress.
44 *
45 * @return {@code true} if upload is in progress
46 * @since 13434
47 */
48 boolean isUploadInProgress();
49
50 /**
51 * Initializes the layer after a successful upload to the server.
52 */
53 void onPostUploadToServer();
54
55 /**
56 * Creates a new {@code AbstractIOTask} for uploading data.
57 * @param monitor The progress monitor
58 * @return a new {@code AbstractIOTask} for uploading data, or {@code null} if not applicable
59 */
60 AbstractIOTask createUploadTask(ProgressMonitor monitor);
61
62 /**
63 * Returns the upload dialog for this layer.
64 * @return the upload dialog for this layer, or {@code null} if not applicable
65 */
66 AbstractUploadDialog getUploadDialog();
67}
Note: See TracBrowser for help on using the repository browser.