X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Freader%2FReader.java;h=bd13e5cb8c032e6866b72c30693d625eae0815e1;hb=dad7b76cdfbc1c61739fe5e38519db5d3ca23666;hp=f98f12c53f0c21b811341bc79703799bbc646080;hpb=16a81ef7656c5c692fb831927e75edde25dd77a0;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/reader/Reader.java b/src/be/nikiroo/fanfix/reader/Reader.java index f98f12c..bd13e5c 100644 --- a/src/be/nikiroo/fanfix/reader/Reader.java +++ b/src/be/nikiroo/fanfix/reader/Reader.java @@ -6,6 +6,7 @@ import java.net.URL; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.library.BasicLibrary; +import be.nikiroo.fanfix.supported.SupportType; import be.nikiroo.utils.Progress; /** @@ -27,6 +28,8 @@ public interface Reader { GUI, /** A text (UTF-8) reader with menu and text windows */ TUI, + /** A GUI reader implemented with the Android framework */ + ANDROID, ; @@ -45,6 +48,8 @@ public interface Reader { return pkg + "tui.TuiReader"; case GUI: return pkg + "ui.GuiReader"; + case ANDROID: + return pkg + "android.AndroidReader"; } return null; @@ -126,11 +131,15 @@ public interface Reader { /** * Start the {@link Story} Reading. * + * @param sync + * execute the process synchronously (wait until it is terminated + * before returning) + * * @throws IOException * in case of I/O error or if the {@link Story} was not * previously set */ - public void read() throws IOException; + public void read(boolean sync) throws IOException; /** * The selected chapter to start reading at (starting at 1, 0 = description, @@ -152,6 +161,8 @@ public interface Reader { /** * Start the reader in browse mode for the given source (or pass NULL for * all sources). + *
+ * Note that this must be a synchronous action. * * @param source * the type of {@link Story} to take into account, or NULL for @@ -160,16 +171,78 @@ public interface Reader { public void browse(String source); /** - * Open the {@link Story} with an external reader (the program will be + * Search for the given terms and find stories that correspond if possible. + * + * @param searchOn + * the website to search on + * @param keywords + * the words to search for (cannot be NULL) + * @param page + * the page of results to show (0 = request the maximum number of + * pages, pages start at 1) + * @param item + * the item to select (0 = do not select a specific item but show + * all the page, items start at 1) + * @param sync + * execute the process synchronously (wait until it is terminated + * before returning) + * + * @throws IOException + * in case of I/O error + */ + public void search(SupportType searchOn, String keywords, int page, + int item, boolean sync) throws IOException; + + /** + * Search based upon a hierarchy of tags, or search for (sub)tags. + *
+ * We use the tags DisplayName. + *
+ * If no tag is given, the main tags will be shown. + *
+ * If a non-leaf tag is given, the subtags will be shown. + *
+ * If a leaf tag is given (or a full hierarchy ending with a leaf tag), + * stories will be shown. + *
+ * You can select the story you want with the item number. + * + * @param searchOn + * the website to search on + * @param page + * the page of results to show (0 = request the maximum number of + * pages, pages start at 1) + * @param item + * the item to select (0 = do not select a specific item but show + * all the page, items start at 1) + * @param sync + * execute the process synchronously (wait until it is terminated + * before returning) + * @param tags + * the tags indices to search for (this is a tag + * hierarchy, NOT a multiple tags choice) + * + * @throws IOException + * in case of I/O error + */ + public void searchTag(SupportType searchOn, int page, int item, + boolean sync, Integer... tags) throws IOException; + + /** + * Open the {@link Story} with an external reader (the program should be * passed the main file associated with this {@link Story}). * * @param lib * the {@link BasicLibrary} to select the {@link Story} from * @param luid * the {@link Story} LUID + * @param sync + * execute the process synchronously (wait until it is terminated + * before returning) * * @throws IOException * in case of I/O error */ - public void openExternal(BasicLibrary lib, String luid) throws IOException; + public void openExternal(BasicLibrary lib, String luid, boolean sync) + throws IOException; }