mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
new methods in API: book info for an arbitrary book
This commit is contained in:
parent
9a3ae79474
commit
938c631afb
5 changed files with 132 additions and 13 deletions
|
@ -67,17 +67,41 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
|||
);
|
||||
return ApiObject.Void.Instance;
|
||||
case GET_BOOK_LANGUAGE:
|
||||
return ApiObject.envelope(getBookLanguage());
|
||||
if (parameters.length == 0) {
|
||||
return ApiObject.envelope(getBookLanguage());
|
||||
} else {
|
||||
return ApiObject.envelope(getBookLanguage(((ApiObject.Long)parameters[0]).Value));
|
||||
}
|
||||
case GET_BOOK_TITLE:
|
||||
return ApiObject.envelope(getBookTitle());
|
||||
if (parameters.length == 0) {
|
||||
return ApiObject.envelope(getBookTitle());
|
||||
} else {
|
||||
return ApiObject.envelope(getBookTitle(((ApiObject.Long)parameters[0]).Value));
|
||||
}
|
||||
case GET_BOOK_FILE_PATH:
|
||||
return ApiObject.envelope(getBookFilePath());
|
||||
if (parameters.length == 0) {
|
||||
return ApiObject.envelope(getBookFilePath());
|
||||
} else {
|
||||
return ApiObject.envelope(getBookFilePath(((ApiObject.Long)parameters[0]).Value));
|
||||
}
|
||||
case GET_BOOK_HASH:
|
||||
return ApiObject.envelope(getBookHash());
|
||||
case GET_BOOK_ID:
|
||||
return ApiObject.envelope(getBookId());
|
||||
if (parameters.length == 0) {
|
||||
return ApiObject.envelope(getBookHash());
|
||||
} else {
|
||||
return ApiObject.envelope(getBookHash(((ApiObject.Long)parameters[0]).Value));
|
||||
}
|
||||
case GET_BOOK_UNIQUE_ID:
|
||||
if (parameters.length == 0) {
|
||||
return ApiObject.envelope(getBookUniqueId());
|
||||
} else {
|
||||
return ApiObject.envelope(getBookUniqueId(((ApiObject.Long)parameters[0]).Value));
|
||||
}
|
||||
case GET_BOOK_LAST_TURNING_TIME:
|
||||
return ApiObject.envelope(getBookLastTurningTime());
|
||||
if (parameters.length == 0) {
|
||||
return ApiObject.envelope(getBookLastTurningTime());
|
||||
} else {
|
||||
return ApiObject.envelope(getBookLastTurningTime(((ApiObject.Long)parameters[0]).Value));
|
||||
}
|
||||
case GET_PARAGRAPHS_NUMBER:
|
||||
return ApiObject.envelope(getParagraphsNumber());
|
||||
case GET_ELEMENTS_NUMBER:
|
||||
|
@ -192,7 +216,7 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
|||
return myReader.Model.Book.getContentHashCode();
|
||||
}
|
||||
|
||||
public String getBookId() {
|
||||
public String getBookUniqueId() {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
@ -202,6 +226,41 @@ public class ApiServerImplementation extends ApiInterface.Stub implements Api, A
|
|||
return null;
|
||||
}
|
||||
|
||||
public String getBookLanguage(long id) {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getBookTitle(long id) {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<String> getBookTags(long id) {
|
||||
// TODO: implement
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
public String getBookFilePath(long id) {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getBookHash(long id) {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getBookUniqueId(long id) {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
public Date getBookLastTurningTime(long id) {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
// page information
|
||||
public TextPosition getPageStart() {
|
||||
return getTextPosition(myReader.getTextView().getStartCursor());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue