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 java.io.UnsupportedEncodingException;
13 import java.util.List;
15 import eu.svjatoslav.meviz.htmlindexer.metadata.DirectoryMetadata;
16 import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile;
17 import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.Picture;
20 * In order to have possibility of several different layouts per directory.
21 * Universal interface is defined.
23 * Layout implementation is responsible for actual HTML generation.
26 public interface Layout {
31 public void enlistDirectory(AbstractFile directory,
32 DirectoryMetadata parentDirectoryMetadata);
37 public void enlistFile(AbstractFile file,
38 DirectoryMetadata parentDirectoryMetadata);
43 public void enlistImage(Picture picture,
44 DirectoryMetadata parentDirectoryMetadata);
47 * Enlist video in OGV format.
49 * @throws UnsupportedEncodingException
51 public void enlistOgv(AbstractFile file,
52 DirectoryMetadata parentDirectoryMetadata)
53 throws UnsupportedEncodingException;
56 * Return layout specific suffix that will be appended between
57 * index(suffix).html of generated file. This way multiple layouts can
58 * coexist in the same directory, each residing in its own HTML file.
60 public String getFileNameSuffix();
63 * After necessary files have been enlisted for particular directory, use
64 * this method to retrieve generated HTML result.
66 public String getHtml(final boolean showTitle,
67 final boolean doHtmlHeaderAndFooter);
70 * Initialize layout for particular directory.
72 public void init(String galleryTitle, List<String> path,
73 final AbstractIndexer indexer, IndexingContext context);