diff options
Diffstat (limited to 'src/cgeo/geocaching/mapinterfaces')
12 files changed, 290 insertions, 0 deletions
diff --git a/src/cgeo/geocaching/mapinterfaces/ActivityImpl.java b/src/cgeo/geocaching/mapinterfaces/ActivityImpl.java new file mode 100644 index 0000000..1895744 --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/ActivityImpl.java @@ -0,0 +1,33 @@ +package cgeo.geocaching.mapinterfaces; + +import android.app.Activity; +import android.content.res.Resources; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; + +/** + * Defines the common functions of the provider-specific + * MapActivity implementations. + * @author rsudev + * + */ +public interface ActivityImpl { + + Resources getResources(); + + Activity getActivity(); + + void superOnCreate(Bundle savedInstanceState); + + void superOnResume(); + + void superOnDestroy(); + + boolean superOnCreateOptionsMenu(Menu menu); + + boolean superOnPrepareOptionsMenu(Menu menu); + + boolean superOnOptionsItemSelected(MenuItem item); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/CacheOverlayItemImpl.java b/src/cgeo/geocaching/mapinterfaces/CacheOverlayItemImpl.java new file mode 100644 index 0000000..bdb8511 --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/CacheOverlayItemImpl.java @@ -0,0 +1,17 @@ +package cgeo.geocaching.mapinterfaces; + +import cgeo.geocaching.cgCoord; + +/** + * Covers the common functions of the provider-specific + * CacheOverlayItem implementations + * @author rsudev + * + */ +public interface CacheOverlayItemImpl extends OverlayItemImpl { + + public cgCoord getCoord(); + + public String getType(); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/GeoPointImpl.java b/src/cgeo/geocaching/mapinterfaces/GeoPointImpl.java new file mode 100644 index 0000000..c6e80d4 --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/GeoPointImpl.java @@ -0,0 +1,15 @@ +package cgeo.geocaching.mapinterfaces; + +/** + * Defines the common functions of the provider-specific + * GeoPoint implementations + * @author rsudev + * + */ +public interface GeoPointImpl { + + int getLatitudeE6(); + + int getLongitudeE6(); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/ItemizedOverlayImpl.java b/src/cgeo/geocaching/mapinterfaces/ItemizedOverlayImpl.java new file mode 100644 index 0000000..73eed1f --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/ItemizedOverlayImpl.java @@ -0,0 +1,33 @@ +package cgeo.geocaching.mapinterfaces; + +import cgeo.geocaching.mapcommon.ItemizedOverlayBase; +import android.graphics.Canvas; +import android.graphics.Point; +import android.graphics.drawable.Drawable; + +/** + * Defines the common functions to access the provider-specific + * ItemizedOverlay implementation + * @author rsudev + * + */ +public interface ItemizedOverlayImpl { + + ItemizedOverlayBase getBase(); + + void superPopulate(); + + void superSetLastFocusedItemIndex(int i); + + Drawable superBoundCenter(Drawable markerIn); + + Drawable superBoundCenterBottom(Drawable marker); + + boolean superOnTap(int index); + + void superDraw(Canvas canvas, MapViewImpl mapView, boolean shadow); + + void superDrawOverlayBitmap(Canvas canvas, Point drawPosition, MapProjectionImpl projection, + byte drawZoomLevel); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/MapControllerImpl.java b/src/cgeo/geocaching/mapinterfaces/MapControllerImpl.java new file mode 100644 index 0000000..dbdb955 --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/MapControllerImpl.java @@ -0,0 +1,19 @@ +package cgeo.geocaching.mapinterfaces; + +/** + * Defines the common functions of the provider-specific + * MapController implementations + * @author rsudev + * + */ +public interface MapControllerImpl { + + void setZoom(int mapzoom); + + void setCenter(GeoPointImpl geoPoint); + + void animateTo(GeoPointImpl geoPoint); + + void zoomToSpan(int latSpanE6, int lonSpanE6); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/MapFactory.java b/src/cgeo/geocaching/mapinterfaces/MapFactory.java new file mode 100644 index 0000000..fe09626 --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/MapFactory.java @@ -0,0 +1,30 @@ +package cgeo.geocaching.mapinterfaces; + +import android.content.Context; +import cgeo.geocaching.cgCoord; +import cgeo.geocaching.cgUser; + +/** + * Defines functions of a factory class to get implementation specific objects + * (GeoPoints, OverlayItems, ...) + * @author rsudev + * + */ +public interface MapFactory { + + public Class getMapClass(); + + public int getMapViewId(); + + public int getMapLayoutId(); + + public GeoPointImpl getGeoPointBase(int latE6, int lonE6); + + public OverlayImpl getOverlayBaseWrapper(OverlayBase ovlIn); + + CacheOverlayItemImpl getCacheOverlayItem(cgCoord coordinate, String type); + + public UserOverlayItemImpl getUserOverlayItemBase(Context context, + cgUser userOne); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/MapProjectionImpl.java b/src/cgeo/geocaching/mapinterfaces/MapProjectionImpl.java new file mode 100644 index 0000000..10d36ee --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/MapProjectionImpl.java @@ -0,0 +1,17 @@ +package cgeo.geocaching.mapinterfaces; + +import android.graphics.Point; + +/** + * Defines common functions of the provider-specific + * MapProjection implementations + * @author rsudev + * + */ +public interface MapProjectionImpl { + + Object getImpl(); + + void toPixels(GeoPointImpl leftGeo, Point left); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/MapViewImpl.java b/src/cgeo/geocaching/mapinterfaces/MapViewImpl.java new file mode 100644 index 0000000..651b39f --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/MapViewImpl.java @@ -0,0 +1,64 @@ +package cgeo.geocaching.mapinterfaces; + +import cgeo.geocaching.cgSettings; +import cgeo.geocaching.mapcommon.cgMapOverlay; +import cgeo.geocaching.mapcommon.cgUsersOverlay; +import android.content.Context; +import android.graphics.drawable.Drawable; + +/** + * Defines common functions of the provider-specific + * MapView implementations + * @author rsudev + * + */ +public interface MapViewImpl { + + void invalidate(); + + void setSatellite(boolean b); + + void setBuiltInZoomControls(boolean b); + + void displayZoomControls(boolean b); + + void preLoad(); + + void clearOverlays(); + + void addOverlay(OverlayImpl ovl); + + MapControllerImpl getMapController(); + + void destroyDrawingCache(); + + boolean isSatellite(); + + GeoPointImpl getMapViewCenter(); + + int getLatitudeSpan(); + + int getLongitudeSpan(); + + int getMapZoomLevel(); + + int getWidth(); + + int getHeight(); + + MapProjectionImpl getMapProjection(); + + Context getContext(); + + cgMapOverlay createAddMapOverlay(cgSettings settings, Context context, + Drawable drawable, boolean fromDetailIntent); + + cgUsersOverlay createAddUsersOverlay(Context context, Drawable markerIn); + + boolean needsScaleOverlay(); + + void setBuiltinScale(boolean b); + + void setMapSource(cgSettings settings); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/OverlayBase.java b/src/cgeo/geocaching/mapinterfaces/OverlayBase.java new file mode 100644 index 0000000..59afb49 --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/OverlayBase.java @@ -0,0 +1,19 @@ +package cgeo.geocaching.mapinterfaces; + +import android.graphics.Canvas; +import android.graphics.Point; + +/** + * Defines the base functions of the provider-independent + * Overlay implementations + * @author rsudev + * + */ +public interface OverlayBase { + + void draw(Canvas canvas, MapViewImpl mapView, boolean shadow); + + void drawOverlayBitmap(Canvas canvas, Point drawPosition, + MapProjectionImpl projection, byte drawZoomLevel); + +} diff --git a/src/cgeo/geocaching/mapinterfaces/OverlayImpl.java b/src/cgeo/geocaching/mapinterfaces/OverlayImpl.java new file mode 100644 index 0000000..6680b6a --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/OverlayImpl.java @@ -0,0 +1,11 @@ +package cgeo.geocaching.mapinterfaces; + +/** + * Marker interface of the provider-specific + * Overlay implementations + * @author rsudev + * + */ +public interface OverlayImpl { + +} diff --git a/src/cgeo/geocaching/mapinterfaces/OverlayItemImpl.java b/src/cgeo/geocaching/mapinterfaces/OverlayItemImpl.java new file mode 100644 index 0000000..0f0297e --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/OverlayItemImpl.java @@ -0,0 +1,18 @@ +package cgeo.geocaching.mapinterfaces; + +import android.graphics.drawable.Drawable; + +/** + * Common functions of the provider-specific + * OverlayItem implementations + * @author rsudev + * + */ +public interface OverlayItemImpl { + + public String getTitle(); + + public Drawable getMarker(int index); + + public void setMarker(Drawable markerIn); +} diff --git a/src/cgeo/geocaching/mapinterfaces/UserOverlayItemImpl.java b/src/cgeo/geocaching/mapinterfaces/UserOverlayItemImpl.java new file mode 100644 index 0000000..6b1532d --- /dev/null +++ b/src/cgeo/geocaching/mapinterfaces/UserOverlayItemImpl.java @@ -0,0 +1,14 @@ +package cgeo.geocaching.mapinterfaces; + +import cgeo.geocaching.cgUser; + +/** + * Common functions of the provider-specific + * UserOverlayItem implementations + * @author rsudev + * + */ +public interface UserOverlayItemImpl extends OverlayItemImpl { + + public cgUser getUser(); +} |
