ingo@340: package de.intevation.flys.themes;
ingo@340: 
ingo@340: import org.w3c.dom.Document;
ingo@340: import org.w3c.dom.Node;
ingo@340: 
ingo@340: 
ingo@340: /**
ingo@340:  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
ingo@340:  */
ingo@340: public interface Theme {
ingo@340: 
ingo@340:     /**
ingo@340:      * Method to initialize the theme.
ingo@340:      *
ingo@340:      * @param config The configuration node.
ingo@340:      */
ingo@340:     void init(Node config);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Returns the name of the theme.
ingo@340:      *
ingo@340:      * @return the name of the theme.
ingo@340:      */
ingo@340:     String getName();
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Returns the description of the theme.
ingo@340:      *
ingo@340:      * @return the description of the theme.
ingo@340:      */
ingo@340:     String getDescription();
ingo@340: 
ingo@340: 
ingo@1668:     String getFacet();
ingo@1668: 
ingo@1668:     void setFacet(String facet);
ingo@1668: 
ingo@1668:     int getIndex();
ingo@1668: 
ingo@1668:     void setIndex(int index);
ingo@1668: 
ingo@1668: 
ingo@340:     /**
ingo@340:      * Adds a new attribute.
ingo@340:      *
ingo@340:      * @param name The name of the attribute.
ingo@340:      * @param value The value of the attribute.
ingo@340:      */
ingo@340:     void addAttribute(String name, String value);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Returns the value of a specific attribute.
ingo@340:      *
ingo@340:      * @param name the name of the attribute.
ingo@340:      *
ingo@340:      * @return the value of the attribute <i>name</i>.
ingo@340:      */
ingo@340:     String getAttribute(String name);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Adds a new field to the theme.
ingo@340:      *
ingo@340:      * @param name The name of the field.
ingo@340:      * @param field The field.
ingo@340:      */
ingo@340:     void addField(String name, ThemeField field);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Sets the value of an field.
ingo@340:      *
ingo@340:      * @param name The name of the field.
ingo@340:      * @param value The new value of the field.
ingo@340:      */
ingo@340:     void setFieldValue(String name, Object value);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Returns the field specified by name.
ingo@340:      *
ingo@340:      * @param name The name of the desired field.
ingo@340:      *
ingo@340:      * @return an field.
ingo@340:      */
ingo@340:     ThemeField getField(String name);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Returns the typename of a field.
ingo@340:      *
ingo@340:      * @param name the name of the field.
ingo@340:      *
ingo@340:      * @return the typename of a field.
ingo@340:      */
ingo@340:     String getFieldType(String name);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Returns the value of a field.
ingo@340:      *
ingo@340:      * @param name The name of the field.
ingo@340:      *
ingo@340:      * @return the value of a field.
ingo@340:      */
ingo@340:     Object getFieldValue(String name);
ingo@340: 
ingo@340: 
ingo@340:     /**
ingo@340:      * Dumps the theme to XML.
ingo@340:      *
ingo@340:      * @return a document.
ingo@340:      */
ingo@340:     Document toXML();
ingo@340: }
ingo@340: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :