1 /*********************************************************************
2 *
3 * Copyright (C) 2002 Andrew Khan
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ***************************************************************************/
19
20 package jxl;
21
22 import java.io.File;
23 import java.net.URL;
24
25 /**
26 * Hyperlink information. Only URLs or file links are supported
27 *
28 * Hyperlinks may apply to a range of cells; in such cases the methods
29 * getRow and getColumn return the cell at the top left of the range
30 * the hyperlink refers to. Hyperlinks have no specific cell format
31 * information applied to them, so the getCellFormat method will return null
32 */
33 public interface Hyperlink
34 {
35 /**
36 * Returns the row number of this cell
37 *
38 * @return the row number of this cell
39 */
40 public int getRow();
41
42 /**
43 * Returns the column number of this cell
44 *
45 * @return the column number of this cell
46 */
47 public int getColumn();
48
49 /**
50 * Gets the range of cells which activate this hyperlink
51 * The get sheet index methods will all return -1, because the
52 * cells will all be present on the same sheet
53 *
54 * @return the range of cells which activate the hyperlink
55 */
56 public Range getRange();
57
58 /**
59 * Determines whether this is a hyperlink to a file
60 *
61 * @return TRUE if this is a hyperlink to a file, FALSE otherwise
62 */
63 public boolean isFile();
64
65 /**
66 * Determines whether this is a hyperlink to a web resource
67 *
68 * @return TRUE if this is a URL
69 */
70 public boolean isURL();
71
72 /**
73 * Determines whether this is a hyperlink to a location in this workbook
74 *
75 * @return TRUE if this is a link to an internal location
76 */
77 public boolean isLocation();
78
79 /**
80 * Returns the row number of the bottom right cell
81 *
82 * @return the row number of this cell
83 */
84 public int getLastRow();
85
86 /**
87 * Returns the column number of the bottom right cell
88 *
89 * @return the column number of this cell
90 */
91 public int getLastColumn();
92
93 /**
94 * Gets the URL referenced by this Hyperlink
95 *
96 * @return the URL, or NULL if this hyperlink is not a URL
97 */
98 public URL getURL();
99
100 /**
101 * Returns the local file eferenced by this Hyperlink
102 *
103 * @return the file, or NULL if this hyperlink is not a file
104 */
105 public File getFile();
106 }
107