preparations to add HTML snippets into generated HTML
[meviz.git] / src / main / java / eu / svjatoslav / meviz / htmlindexer / Layout.java
1 /*
2  * Meviz - Various tools collection to work with multimedia.
3  * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4  *
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.
8  */
9
10 package eu.svjatoslav.meviz.htmlindexer;
11
12 import java.io.UnsupportedEncodingException;
13 import java.util.List;
14
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;
18
19 /**
20  * In order to have possibility of several different layouts per directory.
21  * Universal interface is defined.
22  *
23  * Layout implementation is responsible for actual HTML generation.
24  */
25
26 public interface Layout {
27
28         /**
29          * Enlist directory.
30          */
31         public void enlistDirectory(AbstractFile directory,
32                         DirectoryMetadata parentDirectoryMetadata);
33
34         /**
35          * Enlist simple file.
36          */
37         public void enlistFile(AbstractFile file,
38                         DirectoryMetadata parentDirectoryMetadata);
39
40         /**
41          * Enlist image file.
42          */
43         public void enlistImage(Picture picture,
44                         DirectoryMetadata parentDirectoryMetadata);
45
46         /**
47          * Enlist video in OGV format.
48          *
49          * @throws UnsupportedEncodingException
50          */
51         public void enlistOgv(AbstractFile file,
52                         DirectoryMetadata parentDirectoryMetadata)
53                         throws UnsupportedEncodingException;
54
55         /**
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.
59          */
60         public String getFileNameSuffix();
61
62         /**
63          * After necessary files have been enlisted for particular directory, use
64          * this method to retrieve generated HTML result.
65          */
66         public String getHtml(final boolean showTitle,
67                         final boolean doHtmlHeaderAndFooter);
68
69         /**
70          * Initialize layout for particular directory.
71          */
72         public void init(String galleryTitle, List<String> path,
73                         final AbstractIndexer indexer, IndexingContext context);
74 }