blob: f5f70b0af9b4f43407210b01e2d58014b744b9b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
package cgeo.geocaching.connector;
import cgeo.geocaching.Geocache;
import cgeo.geocaching.ICache;
import cgeo.geocaching.LogCacheActivity;
import cgeo.geocaching.enumerations.LogType;
import cgeo.geocaching.geopoint.Geopoint;
import org.eclipse.jdt.annotation.NonNull;
import java.util.List;
public interface IConnector {
/**
* get name for display (currently only used in links)
*
* @return
*/
public String getName();
/**
* return true, if this connector is responsible for the given cache
*
* @param geocode
* @return
*/
public boolean canHandle(final @NonNull String geocode);
/**
* get browser URL for the given cache
*
* @param cache
* @return
*/
public String getCacheUrl(final Geocache cache);
/**
* get long browser URL for the given cache
*
* @param cache
* @return
*/
public String getLongCacheUrl(final Geocache cache);
/**
* enable/disable watchlist controls in cache details
*
* @return
*/
public boolean supportsWatchList();
/**
* Add the cache to the watchlist
*
* @param cache
* @return True - success/False - failure
*/
public boolean addToWatchlist(Geocache cache);
/**
* Remove the cache from the watchlist
*
* @param cache
* @return True - success/False - failure
*/
public boolean removeFromWatchlist(Geocache cache);
/**
* enable/disable favorite points controls in cache details
*
* @return
*/
public boolean supportsFavoritePoints();
/**
* enable/disable logging controls in cache details
*
* @return
*/
public boolean supportsLogging();
/**
* enable/disable attaching image to log
*
* @return
*/
public boolean supportsLogImages();
/**
* Get an ILoggingManager to guide the logging process.
*
* @return
*/
public ILoggingManager getLoggingManager(final LogCacheActivity activity, final Geocache cache);
/**
* get host name of the connector server for dynamic loading of data
*
* @return
*/
public String getHost();
/**
* get cache data license text
*
* @param cache
* @return
*/
public String getLicenseText(final Geocache cache);
/**
* enable/disable user actions in cache details
*
* @return
*/
public boolean supportsUserActions();
/**
* return true if this is a ZIP file containing a GPX file
*
* @param fileName
* @return
*/
public boolean isZippedGPXFile(final String fileName);
/**
* return true if coordinates of a cache are reliable. only implemented by GC connector
*
* @param cacheHasReliableLatLon
* flag of the cache
* @return
*/
public boolean isReliableLatLon(boolean cacheHasReliableLatLon);
/**
* extract a geocode from the given URL, if this connector can handle that URL somehow
*
* @param url
* @return
*/
public String getGeocodeFromUrl(final String url);
/**
* enable/disable uploading personal note
*
* @return true, when uploading is possible
*/
public boolean supportsPersonalNote();
/**
* Uploading personal note to website
*
* @param cache
* @return success
*/
public boolean uploadPersonalNote(Geocache cache);
/**
* enable/disable uploading modified coordinates to website
*
* @return true, when uploading is possible
*/
public boolean supportsOwnCoordinates();
/**
* Resetting of modified coordinates on website to details
*
* @param cache
* @return success
*/
public boolean deleteModifiedCoordinates(Geocache cache);
/**
* Uploading modified coordinates to website
*
* @param cache
* @param wpt
* @return success
*/
public boolean uploadModifiedCoordinates(Geocache cache, Geopoint wpt);
/**
* Return true if this connector is activated for online
* interaction (download details, do searches, ...)
*
* @return
*/
public boolean isActivated();
/**
* Check if the current user is the owner of the given cache.
*
* @param cache a cache that this connector must be able to handle
* @return <code>true</code> if the current user is the cache owner, <code>false</code> otherwise
*/
public boolean isOwner(final ICache cache);
/**
* Check if the cache information is complete enough to be
* able to log online.
*
* @param geocache
* @return
*/
public boolean canLog(Geocache geocache);
/**
* Return the marker id of the caches for this connector. This creates the different backgrounds for cache markers
* on the map.
*
* @param disabled
* Whether to return the enabled or disabled marker type
*/
public int getCacheMapMarkerId(boolean disabled);
/**
* Get the list of <b>potentially</b> possible log types for a cache. Those may still be filter further during the
* actual logging activity.
*
* @param geocache
* @return
*/
public List<LogType> getPossibleLogTypes(Geocache geocache);
/**
* Get the gpx id for a waypoint when exporting. For some connectors there is an inherent name logic,
* for others its just the 'prefix'
*
* @param prefix
* @return
*/
public String getWaypointGpxId(String prefix, String geocode);
/**
* Get the 'prefix' (key) for a waypoint from the 'name' in the gpx file
*
* @param name
* @return
*/
public String getWaypointPrefix(String name);
/**
* Get the maximum value for Terrain
*
* @return
*/
public int getMaxTerrain();
}
|