2 * Meviz - Various tools collection to work with multimedia.
3 * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public License
7 * as published by the Free Software Foundation.
10 package eu.svjatoslav.meviz.htmlindexer;
12 import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata;
13 import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile;
14 import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.Picture;
16 import java.io.IOException;
17 import java.io.UnsupportedEncodingException;
18 import java.util.List;
21 * In order to have possibility of several different layouts per directory.
22 * Universal interface is defined.
24 * Layout implementation is responsible for actual HTML generation.
27 public interface Layout {
32 void enlistDirectory(AbstractFile directory,
33 DirectoryMetadata parentDirectoryMetadata);
38 void enlistFile(AbstractFile file,
39 DirectoryMetadata parentDirectoryMetadata);
44 void enlistImage(Picture picture,
45 DirectoryMetadata parentDirectoryMetadata);
48 * Enlist video in OGV format.
50 * @throws UnsupportedEncodingException
52 void enlistOgv(AbstractFile file,
53 DirectoryMetadata parentDirectoryMetadata)
54 throws UnsupportedEncodingException;
57 * Return layout specific suffix that will be appended between
58 * index(suffix).html of generated file. This way multiple layouts can
59 * coexist in the same directory, each residing in its own HTML file.
61 String getFileNameSuffix();
64 * After necessary files have been enlisted for particular directory, use
65 * this method to retrieve generated HTML result.
69 String getHtml(final boolean showTitle,
70 final boolean doHtmlHeaderAndFooter, DirectoryMetadata metadata)
74 * Initialize layout for particular directory.
76 void init(String galleryTitle, List<String> path,
77 final AbstractIndexer indexer, IndexingContext context);
79 void enlistWebm(AbstractFile file, DirectoryMetadata directory);