initial commit
[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
14 import eu.svjatoslav.meviz.htmlindexer.metadata.fileTypes.AbstractFile;
15
16 /**
17  * In order to have possibility of several different layouts per directory.
18  * Universal interface is defined.
19  * 
20  * Layout implementation is responsible for actual HTML generation.
21  */
22
23 public interface Layout {
24
25         /**
26          * Enlist directory.
27          */
28         public void enlistDirectory(AbstractFile directory);
29
30         /**
31          * Enlist simple file.
32          */
33         public void enlistFile(AbstractFile file);
34
35         /**
36          * Enlist image file.
37          */
38         public void enlistImage(AbstractFile picture);
39
40         /**
41          * Enlist video in OGV format.
42          * 
43          * @throws UnsupportedEncodingException
44          */
45         public void enlistOgv(AbstractFile file)
46                         throws UnsupportedEncodingException;
47
48         /**
49          * Return layout specific suffix that will be appended between
50          * index(suffix).html of generated file. This way multiple layouts can
51          * coexist in the same directory, each residing in its own HTML file.
52          */
53         public String getFileNameSuffix();
54
55         /**
56          * After necessary files have been enlisted for particular directory, use
57          * this method to retrieve generated HTML result.
58          */
59         public String getHtml();
60
61         /**
62          * Initialize layout for particular directory.
63          */
64         public void init(String galleryTitle, String[] path,
65                         final AbstractIndexer indexer);
66 }