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.format;
21
22 /**
23 * Interface for cell formats
24 */
25 public interface CellFormat
26 {
27 /**
28 * Gets the format used by this format
29 *
30 * @return the format
31 */
32 public Format getFormat();
33
34 /**
35 * Gets the font information used by this format
36 *
37 * @return the font
38 */
39 public Font getFont();
40
41 /**
42 * Gets whether or not the contents of this cell are wrapped
43 *
44 * @return TRUE if this cell's contents are wrapped, FALSE otherwise
45 */
46 public boolean getWrap();
47
48 /**
49 * Gets the horizontal cell alignment
50 *
51 * @return the alignment
52 */
53 public Alignment getAlignment();
54
55 /**
56 * Gets the vertical cell alignment
57 *
58 * @return the alignment
59 */
60 public VerticalAlignment getVerticalAlignment();
61
62 /**
63 * Gets the orientation
64 *
65 * @return the orientation
66 */
67 public Orientation getOrientation();
68
69 /**
70 * Gets the line style for the given cell border
71 * If a border type of ALL or NONE is specified, then a line style of
72 * NONE is returned
73 *
74 * @param border the cell border we are interested in
75 * @return the line style of the specified border
76 */
77 public BorderLineStyle getBorder(Border border);
78
79 /**
80 * Gets the line style for the given cell border
81 * If a border type of ALL or NONE is specified, then a line style of
82 * NONE is returned
83 *
84 * @param border the cell border we are interested in
85 * @return the line style of the specified border
86 */
87 public BorderLineStyle getBorderLine(Border border);
88
89 /**
90 * Gets the colour for the given cell border
91 * If a border type of ALL or NONE is specified, then a line style of
92 * NONE is returned
93 * If the specified cell does not have an associated line style, then
94 * the colour the line would be is still returned
95 *
96 * @param border the cell border we are interested in
97 * @return the line style of the specified border
98 */
99 public Colour getBorderColour(Border border);
100
101 /**
102 * Determines if this cell format has any borders at all. Used to
103 * set the new borders when merging a group of cells
104 *
105 * @return TRUE if this cell has any borders, FALSE otherwise
106 */
107 public boolean hasBorders();
108
109 /**
110 * Gets the background colour used by this cell
111 *
112 * @return the foreground colour
113 */
114 public Colour getBackgroundColour();
115
116 /**
117 * Gets the pattern used by this cell format
118 *
119 * @return the background pattern
120 */
121 public Pattern getPattern();
122
123 /**
124 * Gets the indentation of the cell text
125 *
126 * @return the indentation
127 */
128 public int getIndentation();
129
130 /**
131 * Gets the shrink to fit flag
132 *
133 * @return TRUE if this format is shrink to fit, FALSE otherise
134 */
135 public boolean isShrinkToFit();
136
137 /**
138 * Accessor for whether a particular cell is locked
139 *
140 * @return TRUE if this cell is locked, FALSE otherwise
141 */
142 public boolean isLocked();
143 }