X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fmeviz%2Fhtmlindexer%2FLayout.java;h=5083b39381fb2c75ddd8ccb661e25553d378a4ae;hb=567410640f4e0428caf9de9fc83df4c73f0e5067;hp=5110b3e898364918f09a68f73151e362e0a76a77;hpb=5e584219e79d72ef09c461dca4b2ab9ebffaede6;p=meviz.git diff --git a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java index 5110b3e..5083b39 100755 --- a/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java +++ b/src/main/java/eu/svjatoslav/meviz/htmlindexer/Layout.java @@ -1,68 +1,72 @@ /* * Meviz - Various tools collection to work with multimedia. - * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu - * + * Copyright (C) 2012 -- 2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - */ + * modify it under the terms of version 3 of the GNU Lesser General Public License + * or later as published by the Free Software Foundation. +*/ package eu.svjatoslav.meviz.htmlindexer; -import java.io.UnsupportedEncodingException; -import java.util.List; - +import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata; import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile; +import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.Picture; +import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.Video; + +import java.util.List; /** * In order to have possibility of several different layouts per directory. * Universal interface is defined. - * + *
* Layout implementation is responsible for actual HTML generation.
*/
public interface Layout {
- /**
- * Enlist directory.
- */
- public void enlistDirectory(AbstractFile directory);
+ /**
+ * Enlist directory.
+ */
+ void enlistDirectory(AbstractFile directory,
+ DirectoryMetadata parentDirectoryMetadata);
+
+ /**
+ * Enlist simple file.
+ */
+ void enlistFile(AbstractFile file,
+ DirectoryMetadata parentDirectoryMetadata);
- /**
- * Enlist simple file.
- */
- public void enlistFile(AbstractFile file);
+ /**
+ * Enlist image file.
+ */
+ void enlistImage(Picture picture,
+ DirectoryMetadata parentDirectoryMetadata);
- /**
- * Enlist image file.
- */
- public void enlistImage(AbstractFile picture);
+ /**
+ * Enlist video file.
+ */
+ void enlistVideo(Video file);
- /**
- * Enlist video in OGV format.
- *
- * @throws UnsupportedEncodingException
- */
- public void enlistOgv(AbstractFile file)
- throws UnsupportedEncodingException;
+ /**
+ * Return layout specific suffix that will be appended between
+ * index(suffix).html of generated file. This way multiple layouts can
+ * coexist in the same directory, each residing in its own HTML file.
+ */
+ String getFileNameSuffix();
- /**
- * Return layout specific suffix that will be appended between
- * index(suffix).html of generated file. This way multiple layouts can
- * coexist in the same directory, each residing in its own HTML file.
- */
- public String getFileNameSuffix();
+ /**
+ * After necessary files have been enlisted for particular directory, use
+ * this method to retrieve generated HTML result.
+ */
+ String getHtml(final boolean showTitle,
+ final boolean doHtmlHeaderAndFooter, DirectoryMetadata metadata)
+ ;
- /**
- * After necessary files have been enlisted for particular directory, use
- * this method to retrieve generated HTML result.
- */
- public String getHtml(final boolean showTitle,
- final boolean doHtmlHeaderAndFooter);
+ /**
+ * Initialize layout for particular directory.
+ */
+ void init(String galleryTitle, List