001/* Interface indicating support for exporting an HTML file and supporting files.
002
003 Copyright (c) 2011-2013 The Regents of the University of California.
004 All rights reserved.
005 Permission is hereby granted, without written agreement and without
006 license or royalty fees, to use, copy, modify, and distribute this
007 software and its documentation for any purpose, provided that the above
008 copyright notice and the following two paragraphs appear in all copies
009 of this software.
010
011 IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
014 THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
015 SUCH DAMAGE.
016
017 THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
021 CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
022 ENHANCEMENTS, OR MODIFICATIONS.
023
024 PT_COPYRIGHT_VERSION_2
025 COPYRIGHTENDKEY
026
027 */
028
029package ptolemy.vergil.basic;
030
031import java.awt.print.PrinterException;
032import java.io.IOException;
033import java.io.Writer;
034
035import ptolemy.kernel.util.IllegalActionException;
036
037///////////////////////////////////////////////////////////////////
038//// HTMLExportable
039/**
040 * Interface for parameters and attribute
041 * indicating support for exporting an HTML file and supporting files.
042 *
043 * @author Edward A. Lee
044 * @version $Id$
045 * @since Ptolemy II 10.0
046 * @Pt.ProposedRating Red (cxh)
047 * @Pt.AcceptedRating Red (cxh)
048 */
049public interface HTMLExportable {
050
051    /** Export to HTML as given by the parameters.
052     *  Implementers should write an "index.html" file plus any
053     *  required supporting files in the directory given in the parameters.
054     *  The caller is responsible for checking with the user whether
055     *  any contents of the specified directory can be overwritten.
056     *  @param parameters The parameters for the export.
057     *  @param writer The writer to use the write the HTML. If this is null,
058     *   then the implementer should create an index.html file in the
059     *   directory given by the directoryToExportTo field of the parameters.
060     *  @exception IOException If unable to write any files.
061     *  @exception PrinterException If unable to write associated files.
062     *  @exception IllegalActionException If something goes wrong.
063     */
064    public void writeHTML(ExportParameters parameters, Writer writer)
065            throws PrinterException, IOException, IllegalActionException;
066}