/*********************************************************************
 *
 *      Copyright (C) 2002 Andrew Khan
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ***************************************************************************/

package org.xbib.datastructures.xslx.jxl;

import java.io.File;
import java.net.URL;

/**
 * Hyperlink information.  Only URLs or file links are supported
 * <p>
 * Hyperlinks may apply to a range of cells; in such cases the methods
 * getRow and getColumn return the cell at the top left of the range
 * the hyperlink refers to.  Hyperlinks have no specific cell format
 * information applied to them, so the getCellFormat method will return null
 */
public interface Hyperlink {
    /**
     * Returns the row number of this cell
     *
     * @return the row number of this cell
     */
    int getRow();

    /**
     * Returns the column number of this cell
     *
     * @return the column number of this cell
     */
    int getColumn();

    /**
     * Gets the range of cells which activate this hyperlink
     * The get sheet index methods will all return -1, because the
     * cells will all be present on the same sheet
     *
     * @return the range of cells which activate the hyperlink
     */
    Range getRange();

    /**
     * Determines whether this is a hyperlink to a file
     *
     * @return TRUE if this is a hyperlink to a file, FALSE otherwise
     */
    boolean isFile();

    /**
     * Determines whether this is a hyperlink to a web resource
     *
     * @return TRUE if this is a URL
     */
    boolean isURL();

    /**
     * Determines whether this is a hyperlink to a location in this workbook
     *
     * @return TRUE if this is a link to an internal location
     */
    boolean isLocation();

    /**
     * Returns the row number of the bottom right cell
     *
     * @return the row number of this cell
     */
    int getLastRow();

    /**
     * Returns the column number of the bottom right cell
     *
     * @return the column number of this cell
     */
    int getLastColumn();

    /**
     * Gets the URL referenced by this Hyperlink
     *
     * @return the URL, or NULL if this hyperlink is not a URL
     */
    URL getURL();

    /**
     * Returns the local file eferenced by this Hyperlink
     *
     * @return the file, or NULL if this hyperlink is not a file
     */
    File getFile();
}

