mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
more API methods
This commit is contained in:
parent
6175f96a8f
commit
ce1bd674ec
3 changed files with 24 additions and 8 deletions
1
TODO.1.5
1
TODO.1.5
|
@ -5,7 +5,6 @@ litres: author photos
|
||||||
|
|
||||||
1.5.*:
|
1.5.*:
|
||||||
|
|
||||||
* Advanced settings plugin does not run
|
|
||||||
* Autogeneration for ApiMethods & ApiImplementations
|
* Autogeneration for ApiMethods & ApiImplementations
|
||||||
* Footnotes on the same page
|
* Footnotes on the same page
|
||||||
* Chinese books (mail from Eric)
|
* Chinese books (mail from Eric)
|
||||||
|
|
|
@ -447,12 +447,11 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isZoneMapCustom(String name) throws ApiException {
|
public boolean isZoneMapCustom(String name) throws ApiException {
|
||||||
// TODO: implement
|
return TapZoneMap.zoneMap(name).isCustom();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteZoneMap(String name) throws ApiException {
|
public void deleteZoneMap(String name) throws ApiException {
|
||||||
// TODO: implement
|
TapZoneMap.deleteZoneMap(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTapZoneAction(String name, int h, int v, boolean singleTap) {
|
public String getTapZoneAction(String name, int h, int v, boolean singleTap) {
|
||||||
|
|
|
@ -27,13 +27,15 @@ import org.geometerplus.zlibrary.core.filesystem.ZLFile;
|
||||||
import org.geometerplus.zlibrary.core.options.*;
|
import org.geometerplus.zlibrary.core.options.*;
|
||||||
|
|
||||||
public class TapZoneMap {
|
public class TapZoneMap {
|
||||||
|
private static final List<String> ourPredefinedMaps = new LinkedList<String>();
|
||||||
private static final ZLStringListOption ourMapsOption;
|
private static final ZLStringListOption ourMapsOption;
|
||||||
static {
|
static {
|
||||||
final List<String> lst = new LinkedList<String>();
|
|
||||||
// TODO: list files from default/tapzones
|
// TODO: list files from default/tapzones
|
||||||
lst.add("left_to_right");
|
ourPredefinedMaps.add("right_to_left");
|
||||||
lst.add("up");
|
ourPredefinedMaps.add("left_to_right");
|
||||||
ourMapsOption = new ZLStringListOption("TapZones", "List", lst, "\000");
|
ourPredefinedMaps.add("down");
|
||||||
|
ourPredefinedMaps.add("up");
|
||||||
|
ourMapsOption = new ZLStringListOption("TapZones", "List", ourPredefinedMaps, "\000");
|
||||||
}
|
}
|
||||||
private static final Map<String,TapZoneMap> ourMaps = new HashMap<String,TapZoneMap>();
|
private static final Map<String,TapZoneMap> ourMaps = new HashMap<String,TapZoneMap>();
|
||||||
|
|
||||||
|
@ -64,6 +66,18 @@ public class TapZoneMap {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void deleteZoneMap(String name) {
|
||||||
|
if (ourPredefinedMaps.contains(name)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ourMaps.remove(name);
|
||||||
|
|
||||||
|
final List<String> lst = new LinkedList<String>(ourMapsOption.getValue());
|
||||||
|
lst.remove(name);
|
||||||
|
ourMapsOption.setValue(lst);
|
||||||
|
}
|
||||||
|
|
||||||
public static enum Tap {
|
public static enum Tap {
|
||||||
singleTap,
|
singleTap,
|
||||||
singleNotDoubleTap,
|
singleNotDoubleTap,
|
||||||
|
@ -88,6 +102,10 @@ public class TapZoneMap {
|
||||||
new Reader().readQuietly(mapFile);
|
new Reader().readQuietly(mapFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCustom() {
|
||||||
|
return !ourPredefinedMaps.contains(Name);
|
||||||
|
}
|
||||||
|
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
return myHeight.getValue();
|
return myHeight.getValue();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue