git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add more warnings source to 1.6) and fix warnings
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
fanfix
/
reader
/
Reader.java
diff --git
a/src/be/nikiroo/fanfix/reader/Reader.java
b/src/be/nikiroo/fanfix/reader/Reader.java
index d7285785b6513dc76badadb96ad8ce49a620e9be..d540d39f9094edb4e9d1e08a16cedfe9b65a5298 100644
(file)
--- a/
src/be/nikiroo/fanfix/reader/Reader.java
+++ b/
src/be/nikiroo/fanfix/reader/Reader.java
@@
-3,11
+3,17
@@
package be.nikiroo.fanfix.reader;
import java.io.IOException;
import java.net.URL;
import java.io.IOException;
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.data.Story;
import be.nikiroo.fanfix.library.BasicLibrary;
-import be.nikiroo.fanfix.library.LocalLibrary;
import be.nikiroo.utils.Progress;
import be.nikiroo.utils.Progress;
+/**
+ * A {@link Reader} is a class that will handle {@link Story} reading and
+ * browsing.
+ *
+ * @author niki
+ */
public interface Reader {
/**
* A type of {@link BasicReader}.
public interface Reader {
/**
* A type of {@link BasicReader}.
@@
-43,48
+49,69
@@
public interface Reader {
return null;
}
return null;
}
- }
;
+ }
/**
/**
- * Return the current {@link Story}.
+ * Return the current target {@link MetaData}.
+ *
+ * @return the meta
+ */
+ public MetaData getMeta();
+
+ /**
+ * Return the current {@link Story} as described by the current
+ * {@link MetaData}.
+ *
+ * @param pg
+ * the optional progress
*
* @return the {@link Story}
*/
*
* @return the {@link Story}
*/
- public Story getStory();
+ public Story getStory(
Progress pg
);
/**
/**
- * The {@link
Local
Library} to load the stories from (by default, takes the
- * default {@link
Local
Library}).
+ * The {@link
Basic
Library} to load the stories from (by default, takes the
+ * default {@link
Basic
Library}).
*
*
- * @return the {@link
Local
Library}
+ * @return the {@link
Basic
Library}
*/
public BasicLibrary getLibrary();
/**
*/
public BasicLibrary getLibrary();
/**
- * Change the {@link
Local
Library} that will be managed by this
+ * Change the {@link
Basic
Library} that will be managed by this
* {@link BasicReader}.
*
* @param lib
* {@link BasicReader}.
*
* @param lib
- * the new {@link
Local
Library}
+ * the new {@link
Basic
Library}
*/
*/
- public void setLibrary(
Local
Library lib);
+ public void setLibrary(
Basic
Library lib);
/**
/**
- *
Create a new {@link BasicReader} for a {@link Story} in
the
- * {@link
LocalLibrary
}.
+ *
Set a {@link Story} from the current {@link BasicLibrary} into
the
+ * {@link
Reader
}.
*
* @param luid
* the {@link Story} ID
*
* @param luid
* the {@link Story} ID
- * @param pg
- * the optional progress reporter
*
* @throws IOException
* in case of I/O error
*/
*
* @throws IOException
* in case of I/O error
*/
- public void setStory(String luid, Progress pg) throws IOException;
+ public void setMeta(String luid) throws IOException;
+
+ /**
+ * Set a {@link Story} from the current {@link BasicLibrary} into the
+ * {@link Reader}.
+ *
+ * @param meta
+ * the meta
+ *
+ * @throws IOException
+ * in case of I/O error
+ */
+ public void setMeta(MetaData meta) throws IOException;
/**
/**
- *
Create a new {@link BasicReader} for an external {@link Story
}.
+ *
Set an external {@link Story} into this {@link Reader
}.
*
* @param source
* the {@link Story} {@link URL}
*
* @param source
* the {@link Story} {@link URL}
@@
-94,7
+121,7
@@
public interface Reader {
* @throws IOException
* in case of I/O error
*/
* @throws IOException
* in case of I/O error
*/
- public void set
Story
(URL source, Progress pg) throws IOException;
+ public void set
Meta
(URL source, Progress pg) throws IOException;
/**
* Start the {@link Story} Reading.
/**
* Start the {@link Story} Reading.
@@
-106,16
+133,21
@@
public interface Reader {
public void read() throws IOException;
/**
public void read() throws IOException;
/**
- * Read the selected chapter (starting at 1).
+ * The selected chapter to start reading at (starting at 1, 0 = description,
+ * -1 = none).
*
*
- * @param chapter
- * the chapter
+ * @return the chapter, or -1 for "no chapter"
+ */
+ public int getChapter();
+
+ /**
+ * The selected chapter to start reading at (starting at 1, 0 = description,
+ * -1 = none).
*
*
- * @throws IOException
- * in case of I/O error or if the {@link Story} was not
- * previously set
+ * @param chapter
+ * the chapter, or -1 for "no chapter"
*/
*/
- public void
read(int chapter) throws IOException
;
+ public void
setChapter(int chapter)
;
/**
* Start the reader in browse mode for the given source (or pass NULL for
/**
* Start the reader in browse mode for the given source (or pass NULL for
@@
-126,5
+158,4
@@
public interface Reader {
* all
*/
public void browse(String source);
* all
*/
public void browse(String source);
-
}
}