To build the documentation you will need to install forrest and set
the FORREST_HOME environment variable. Forrest 0.5.1 required.
+ You will need JDK 1.5 or newer to build much of POI. If all you want
+ is the core OLE2 support, then you only need JDK 1.4
+
TO BE COMPLETED:
<property name="main.src.test" location="src/testcases"/>
<property name="main.documentation" value="src/documentation"/>
<property name="main.output.dir" location="build/classes"/>
+ <property name="main14.output.dir" location="build/classes-jdk14"/>
<property name="main.output.test.dir" location="build/test-classes"/>
<property name="main.lib" location="lib"/>
<property name="ooxml.lib" location="ooxml-lib"/>
<property name="examples.jar3.url" value="${repository}/commons-lang/jars/commons-lang-2.1.jar"/>
<property name="examples.testokfile" location="build/examples-testokfile.txt"/>
+ <!-- Common interfaces for ole2 and ooxml classes -->
+ <property name="interfaces.jdk14.src" location="src/ooxml/interfaces-jdk14"/>
+ <property name="interfaces.jdk15.src" location="src/ooxml/interfaces-jdk15"/>
+
<!-- Experimental OOXML support: -->
<property name="ooxml.src" location="src/ooxml/java"/>
<property name="ooxml.src.test" location="src/ooxml/testcases"/>
<property name="jar.name" value="poi"/>
<property name="version.id" value="3.0.2-beta1"/>
<property name="halt.on.test.failure" value="true"/>
- <property name="jdk.version.source" value="1.3"
+
+ <property name="jdk.version.source" value="1.5"
description="JDK version of source code"/>
- <property name="jdk.version.class" value="1.3"
+ <property name="jdk.version.class" value="1.5"
description="JDK version of generated class files"/>
+ <property name="jdk14.version.source" value="1.3"
+ description="JDK version of source code, when built on JDK 1.4"/>
+ <property name="jdk14.version.class" value="1.3"
+ description="JDK version of generated class files, when built on JDK 1.4"/>
+ <!-- normally use the jdk 1.5 stuff -->
<path id="main.classpath">
<pathelement location="${main.jar1.dir}"/>
<pathelement location="${main.jar2.dir}"/>
<pathelement location="${main.resource1.dir}"/>
</path>
+ <path id="main14.classpath">
+ <pathelement location="${main.jar1.dir}"/>
+ <pathelement location="${main.jar2.dir}"/>
+ <pathelement location="${main.resource1.dir}"/>
+ </path>
+
<path id="scratchpad.classpath">
<path refid="main.classpath"/>
<pathelement location="${main.output.dir}"/>
<mkdir dir="build"/>
<mkdir dir="${main.output.dir}"/>
+ <mkdir dir="${main14.output.dir}"/>
<mkdir dir="${scratchpad.output.dir}"/>
<mkdir dir="${contrib.output.dir}"/>
<mkdir dir="${examples.output.dir}"/>
</xmlbean>
</target>
- <target name="compile" depends="init, compile-main, compile-scratchpad,
- compile-contrib, compile-examples"
+ <target name="compile" depends="init, compile-main, compile-main-14,
+ compile-scratchpad, compile-contrib, compile-examples"
description="Compiles the POI main classes, scratchpad, contrib, and examples"/>
<target name="compile-main" depends="fail-unless-xslt-is-available">
<fileset dir="${main.resource1.dir}"/>
</copy>
<javac target="${jdk.version.class}" source="${jdk.version.source}"
- failonerror="true" destdir="${main.output.dir}" debug="on" fork="yes"
- srcdir="${main.src}">
+ failonerror="true" destdir="${main.output.dir}" debug="on" fork="yes">
+ <src path="${main.src}" />
+ <src path="${interfaces.jdk15.src}" />
<classpath refid="main.classpath"/>
</javac>
<javac target="${jdk.version.class}" source="${jdk.version.source}"
</javac>
</target>
+ <target name="compile-main-14" depends="fail-unless-xslt-is-available">
+ <copy todir="${main14.output.dir}">
+ <fileset dir="${main.resource1.dir}"/>
+ </copy>
+ <javac target="${jdk14.version.class}" source="${jdk14.version.source}"
+ failonerror="true" destdir="${main14.output.dir}" debug="on" fork="yes">
+ <src path="${main.src}" />
+ <src path="${interfaces.jdk14.src}" />
+ <classpath refid="main.classpath"/>
+ </javac>
+ </target>
+
<target name="compile-scratchpad" depends="init,compile-main">
<javac target="${jdk.version.class}" source="${jdk.version.source}"
failonerror="true" destdir="${scratchpad.output.dir}" debug="on"
--- /dev/null
+ Fun with Interfaces
+ -------------------
+
+Let us consider a simple case
+
+ public Interface IFoo {}
+ public Interface IBar {
+ public IFoo getFoo();
+ }
+
+ public class RealFoo implements IFoo {}
+ public class RealBar implements IBar {
+ public RealFoo getFoo() { return new RealFoo(); }
+ }
+
+Looks ok, doesn't it? If you access RealBar directly, you get back a
+RealFoo. If you access RealBar via the IBar interface, you get back a
+IFoo object instead. All looks good.
+
+Only snag - this doesn't work with any JDK older than 1.5. If you're on
+JDK 1.3 or JDK 1.4, you will get a compile time error about incompatible
+return signatures.
+
+
+At the moment, we're still committed to having the core of POI work on
+JDK 1.3 / JDK 1.4. If you want the OOXML support, then you need to move
+to JDK 1.5. This allows us a sort of work-around for the problems:
+
+JDK 1.3 / JDK 1.4:
+ You can't use the OOXML stuff anyway, so you probably don't care about
+ the new interfaces
+ So, have the existing code (hssf) compile against dummy interfaces, which
+ don't actually provide any methods
+ You can't then use the interfaces, but you probably didn't want to anyway
+ These live in src/ooxml/interfaces-jdk14
+
+JDK 1.5:
+ Compile the existing code (hssf) against full interfaces. Users can still
+ use the concrete HSSF classes if they want, or if they use the interfaces,
+ their code will work with the ooxml support too
+ Need to change any methods that take a concrete object (eg HSSFCell) to
+ take the interface (eg Cell), and cast, otherwise they're not compatible
+ with the interface contract (which specifies Cell not HSSFCell).
+ These live in src/ooxml/interfaces-jdk15
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Cell {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface CellStyle {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Color {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Comment {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface DataFormat {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Font {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Footer {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Header {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Name {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Palette {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Patriarch {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface PrintSetup {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface RichTextString {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Row {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface SharedStringSource {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Sheet {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Textbox {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Workbook {}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import java.util.Calendar;
+import java.util.Date;
+
+
+public interface Cell {
+
+ /**
+ * Numeric Cell type (0)
+ * @see #setCellType(int)
+ * @see #getCellType()
+ */
+
+ public final static int CELL_TYPE_NUMERIC = 0;
+
+ /**
+ * String Cell type (1)
+ * @see #setCellType(int)
+ * @see #getCellType()
+ */
+
+ public final static int CELL_TYPE_STRING = 1;
+
+ /**
+ * Formula Cell type (2)
+ * @see #setCellType(int)
+ * @see #getCellType()
+ */
+
+ public final static int CELL_TYPE_FORMULA = 2;
+
+ /**
+ * Blank Cell type (3)
+ * @see #setCellType(int)
+ * @see #getCellType()
+ */
+
+ public final static int CELL_TYPE_BLANK = 3;
+
+ /**
+ * Boolean Cell type (4)
+ * @see #setCellType(int)
+ * @see #getCellType()
+ */
+
+ public final static int CELL_TYPE_BOOLEAN = 4;
+
+ /**
+ * Error Cell type (5)
+ * @see #setCellType(int)
+ * @see #getCellType()
+ */
+
+ public final static int CELL_TYPE_ERROR = 5;
+
+ /**
+ * set the cell's number within the row (0 based)
+ * @param num short the cell number
+ */
+
+ void setCellNum(short num);
+
+ /**
+ * get the cell's number within the row
+ * @return short reperesenting the column number (logical!)
+ */
+
+ short getCellNum();
+
+ /**
+ * set the cells type (numeric, formula or string)
+ * @see #CELL_TYPE_NUMERIC
+ * @see #CELL_TYPE_STRING
+ * @see #CELL_TYPE_FORMULA
+ * @see #CELL_TYPE_BLANK
+ * @see #CELL_TYPE_BOOLEAN
+ * @see #CELL_TYPE_ERROR
+ */
+
+ void setCellType(int cellType);
+
+ /**
+ * get the cells type (numeric, formula or string)
+ * @see #CELL_TYPE_STRING
+ * @see #CELL_TYPE_NUMERIC
+ * @see #CELL_TYPE_FORMULA
+ * @see #CELL_TYPE_BOOLEAN
+ * @see #CELL_TYPE_ERROR
+ */
+
+ int getCellType();
+
+ /**
+ * set a numeric value for the cell
+ *
+ * @param value the numeric value to set this cell to. For formulas we'll set the
+ * precalculated value, for numerics we'll set its value. For other types we
+ * will change the cell to a numeric cell and set its value.
+ */
+ void setCellValue(double value);
+
+ /**
+ * set a date value for the cell. Excel treats dates as numeric so you will need to format the cell as
+ * a date.
+ *
+ * @param value the date value to set this cell to. For formulas we'll set the
+ * precalculated value, for numerics we'll set its value. For other types we
+ * will change the cell to a numeric cell and set its value.
+ */
+ void setCellValue(Date value);
+
+ /**
+ * set a date value for the cell. Excel treats dates as numeric so you will need to format the cell as
+ * a date.
+ *
+ * @param value the date value to set this cell to. For formulas we'll set the
+ * precalculated value, for numerics we'll set its value. For othertypes we
+ * will change the cell to a numeric cell and set its value.
+ */
+ void setCellValue(Calendar value);
+
+ /**
+ * set a string value for the cell. Please note that if you are using
+ * full 16 bit unicode you should call <code>setEncoding()</code> first.
+ *
+ * @param value value to set the cell to. For formulas we'll set the formula
+ * string, for String cells we'll set its value. For other types we will
+ * change the cell to a string cell and set its value.
+ * If value is null then we will change the cell to a Blank cell.
+ */
+
+ void setCellValue(RichTextString value);
+
+ void setCellFormula(String formula);
+
+ String getCellFormula();
+
+ /**
+ * get the value of the cell as a number. For strings we throw an exception.
+ * For blank cells we return a 0.
+ */
+
+ double getNumericCellValue();
+
+ /**
+ * get the value of the cell as a date. For strings we throw an exception.
+ * For blank cells we return a null.
+ */
+ Date getDateCellValue();
+
+ /**
+ * get the value of the cell as a string - for numeric cells we throw an exception.
+ * For blank cells we return an empty string.
+ * For formulaCells that are not string Formulas, we return empty String
+ */
+
+ RichTextString getRichStringCellValue();
+
+ /**
+ * set a boolean value for the cell
+ *
+ * @param value the boolean value to set this cell to. For formulas we'll set the
+ * precalculated value, for booleans we'll set its value. For other types we
+ * will change the cell to a boolean cell and set its value.
+ */
+
+ void setCellValue(boolean value);
+
+ /**
+ * set a error value for the cell
+ *
+ * @param value the error value to set this cell to. For formulas we'll set the
+ * precalculated value ??? IS THIS RIGHT??? , for errors we'll set
+ * its value. For other types we will change the cell to an error
+ * cell and set its value.
+ */
+
+ void setCellErrorValue(byte value);
+
+ /**
+ * get the value of the cell as a boolean. For strings, numbers, and errors, we throw an exception.
+ * For blank cells we return a false.
+ */
+
+ boolean getBooleanCellValue();
+
+ /**
+ * get the value of the cell as an error code. For strings, numbers, and booleans, we throw an exception.
+ * For blank cells we return a 0.
+ */
+
+ byte getErrorCellValue();
+
+ /**
+ * set the style for the cell. The style should be an HSSFCellStyle created/retreived from
+ * the HSSFWorkbook.
+ *
+ * @param style reference contained in the workbook
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#createCellStyle()
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getCellStyleAt(short)
+ */
+
+ void setCellStyle(CellStyle style);
+
+ /**
+ * get the style for the cell. This is a reference to a cell style contained in the workbook
+ * object.
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getCellStyleAt(short)
+ */
+
+ CellStyle getCellStyle();
+
+ /**
+ * Sets this cell as the active cell for the worksheet
+ */
+ void setAsActiveCell();
+
+ /**
+ * Returns a string representation of the cell
+ *
+ * This method returns a simple representation,
+ * anthing more complex should be in user code, with
+ * knowledge of the semantics of the sheet being processed.
+ *
+ * Formula cells return the formula string,
+ * rather than the formula result.
+ * Dates are displayed in dd-MMM-yyyy format
+ * Errors are displayed as #ERR<errIdx>
+ */
+ String toString();
+
+ /**
+ * Assign a comment to this cell
+ *
+ * @param comment comment associated with this cell
+ */
+ void setCellComment(Comment comment);
+
+ /**
+ * Returns comment associated with this cell
+ *
+ * @return comment associated with this cell
+ */
+ Comment getCellComment();
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface CellStyle {
+
+ /**
+ * general (normal) horizontal alignment
+ */
+
+ public final static short ALIGN_GENERAL = 0x0;
+
+ /**
+ * left-justified horizontal alignment
+ */
+
+ public final static short ALIGN_LEFT = 0x1;
+
+ /**
+ * center horizontal alignment
+ */
+
+ public final static short ALIGN_CENTER = 0x2;
+
+ /**
+ * right-justified horizontal alignment
+ */
+
+ public final static short ALIGN_RIGHT = 0x3;
+
+ /**
+ * fill? horizontal alignment
+ */
+
+ public final static short ALIGN_FILL = 0x4;
+
+ /**
+ * justified horizontal alignment
+ */
+
+ public final static short ALIGN_JUSTIFY = 0x5;
+
+ /**
+ * center-selection? horizontal alignment
+ */
+
+ public final static short ALIGN_CENTER_SELECTION = 0x6;
+
+ /**
+ * top-aligned vertical alignment
+ */
+
+ public final static short VERTICAL_TOP = 0x0;
+
+ /**
+ * center-aligned vertical alignment
+ */
+
+ public final static short VERTICAL_CENTER = 0x1;
+
+ /**
+ * bottom-aligned vertical alignment
+ */
+
+ public final static short VERTICAL_BOTTOM = 0x2;
+
+ /**
+ * vertically justified vertical alignment
+ */
+
+ public final static short VERTICAL_JUSTIFY = 0x3;
+
+ /**
+ * No border
+ */
+
+ public final static short BORDER_NONE = 0x0;
+
+ /**
+ * Thin border
+ */
+
+ public final static short BORDER_THIN = 0x1;
+
+ /**
+ * Medium border
+ */
+
+ public final static short BORDER_MEDIUM = 0x2;
+
+ /**
+ * dash border
+ */
+
+ public final static short BORDER_DASHED = 0x3;
+
+ /**
+ * dot border
+ */
+
+ public final static short BORDER_HAIR = 0x4;
+
+ /**
+ * Thick border
+ */
+
+ public final static short BORDER_THICK = 0x5;
+
+ /**
+ * double-line border
+ */
+
+ public final static short BORDER_DOUBLE = 0x6;
+
+ /**
+ * hair-line border
+ */
+
+ public final static short BORDER_DOTTED = 0x7;
+
+ /**
+ * Medium dashed border
+ */
+
+ public final static short BORDER_MEDIUM_DASHED = 0x8;
+
+ /**
+ * dash-dot border
+ */
+
+ public final static short BORDER_DASH_DOT = 0x9;
+
+ /**
+ * medium dash-dot border
+ */
+
+ public final static short BORDER_MEDIUM_DASH_DOT = 0xA;
+
+ /**
+ * dash-dot-dot border
+ */
+
+ public final static short BORDER_DASH_DOT_DOT = 0xB;
+
+ /**
+ * medium dash-dot-dot border
+ */
+
+ public final static short BORDER_MEDIUM_DASH_DOT_DOT = 0xC;
+
+ /**
+ * slanted dash-dot border
+ */
+
+ public final static short BORDER_SLANTED_DASH_DOT = 0xD;
+
+ /** No background */
+ public final static short NO_FILL = 0;
+
+ /** Solidly filled */
+ public final static short SOLID_FOREGROUND = 1;
+
+ /** Small fine dots */
+ public final static short FINE_DOTS = 2;
+
+ /** Wide dots */
+ public final static short ALT_BARS = 3;
+
+ /** Sparse dots */
+ public final static short SPARSE_DOTS = 4;
+
+ /** Thick horizontal bands */
+ public final static short THICK_HORZ_BANDS = 5;
+
+ /** Thick vertical bands */
+ public final static short THICK_VERT_BANDS = 6;
+
+ /** Thick backward facing diagonals */
+ public final static short THICK_BACKWARD_DIAG = 7;
+
+ /** Thick forward facing diagonals */
+ public final static short THICK_FORWARD_DIAG = 8;
+
+ /** Large spots */
+ public final static short BIG_SPOTS = 9;
+
+ /** Brick-like layout */
+ public final static short BRICKS = 10;
+
+ /** Thin horizontal bands */
+ public final static short THIN_HORZ_BANDS = 11;
+
+ /** Thin vertical bands */
+ public final static short THIN_VERT_BANDS = 12;
+
+ /** Thin backward diagonal */
+ public final static short THIN_BACKWARD_DIAG = 13;
+
+ /** Thin forward diagonal */
+ public final static short THIN_FORWARD_DIAG = 14;
+
+ /** Squares */
+ public final static short SQUARES = 15;
+
+ /** Diamonds */
+ public final static short DIAMONDS = 16;
+
+ /** Less Dots */
+ public final static short LESS_DOTS = 17;
+
+ /** Least Dots */
+ public final static short LEAST_DOTS = 18;
+
+ /**
+ * get the index within the HSSFWorkbook (sequence within the collection of ExtnededFormat objects)
+ * @return unique index number of the underlying record this style represents (probably you don't care
+ * unless you're comparing which one is which)
+ */
+
+ short getIndex();
+
+ /**
+ * set the data format (must be a valid format)
+ * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
+ */
+
+ void setDataFormat(short fmt);
+
+ /**
+ * get the index of the format
+ * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
+ */
+
+ short getDataFormat();
+
+ /**
+ * Get the contents of the format string, by looking up
+ * the DataFormat against the supplied workbook
+ * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
+ * XXX Commented out because it uses internal implementation Workbook class.
+ *
+ String getDataFormatString(Workbook workbook);
+ */
+
+ /**
+ * set the font for this style
+ * @param font a font object created or retreived from the HSSFWorkbook object
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#createFont()
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
+ */
+
+ void setFont(Font font);
+
+ /**
+ * gets the index of the font for this style
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
+ */
+ short getFontIndex();
+
+ /**
+ * gets the font for this style
+ * @param parentWorkbook The HSSFWorkbook that this style belongs to
+ * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIndex()
+ * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
+ */
+ Font getFont(Workbook parentWorkbook);
+
+ /**
+ * set the cell's using this style to be hidden
+ * @param hidden - whether the cell using this style should be hidden
+ */
+
+ void setHidden(boolean hidden);
+
+ /**
+ * get whether the cell's using this style are to be hidden
+ * @return hidden - whether the cell using this style should be hidden
+ */
+
+ boolean getHidden();
+
+ /**
+ * set the cell's using this style to be locked
+ * @param locked - whether the cell using this style should be locked
+ */
+
+ void setLocked(boolean locked);
+
+ /**
+ * get whether the cell's using this style are to be locked
+ * @return hidden - whether the cell using this style should be locked
+ */
+
+ boolean getLocked();
+
+ /**
+ * set the type of horizontal alignment for the cell
+ * @param align - the type of alignment
+ * @see #ALIGN_GENERAL
+ * @see #ALIGN_LEFT
+ * @see #ALIGN_CENTER
+ * @see #ALIGN_RIGHT
+ * @see #ALIGN_FILL
+ * @see #ALIGN_JUSTIFY
+ * @see #ALIGN_CENTER_SELECTION
+ */
+
+ void setAlignment(short align);
+
+ /**
+ * get the type of horizontal alignment for the cell
+ * @return align - the type of alignment
+ * @see #ALIGN_GENERAL
+ * @see #ALIGN_LEFT
+ * @see #ALIGN_CENTER
+ * @see #ALIGN_RIGHT
+ * @see #ALIGN_FILL
+ * @see #ALIGN_JUSTIFY
+ * @see #ALIGN_CENTER_SELECTION
+ */
+
+ short getAlignment();
+
+ /**
+ * set whether the text should be wrapped
+ * @param wrapped wrap text or not
+ */
+
+ void setWrapText(boolean wrapped);
+
+ /**
+ * get whether the text should be wrapped
+ * @return wrap text or not
+ */
+
+ boolean getWrapText();
+
+ /**
+ * set the type of vertical alignment for the cell
+ * @param align the type of alignment
+ * @see #VERTICAL_TOP
+ * @see #VERTICAL_CENTER
+ * @see #VERTICAL_BOTTOM
+ * @see #VERTICAL_JUSTIFY
+ */
+
+ void setVerticalAlignment(short align);
+
+ /**
+ * get the type of vertical alignment for the cell
+ * @return align the type of alignment
+ * @see #VERTICAL_TOP
+ * @see #VERTICAL_CENTER
+ * @see #VERTICAL_BOTTOM
+ * @see #VERTICAL_JUSTIFY
+ */
+
+ short getVerticalAlignment();
+
+ /**
+ * set the degree of rotation for the text in the cell
+ * @param rotation degrees (between -90 and 90 degrees)
+ */
+
+ void setRotation(short rotation);
+
+ /**
+ * get the degree of rotation for the text in the cell
+ * @return rotation degrees (between -90 and 90 degrees)
+ */
+
+ short getRotation();
+
+ /**
+ * set the number of spaces to indent the text in the cell
+ * @param indent - number of spaces
+ */
+
+ void setIndention(short indent);
+
+ /**
+ * get the number of spaces to indent the text in the cell
+ * @return indent - number of spaces
+ */
+
+ short getIndention();
+
+ /**
+ * set the type of border to use for the left border of the cell
+ * @param border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ void setBorderLeft(short border);
+
+ /**
+ * get the type of border to use for the left border of the cell
+ * @return border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ short getBorderLeft();
+
+ /**
+ * set the type of border to use for the right border of the cell
+ * @param border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ void setBorderRight(short border);
+
+ /**
+ * get the type of border to use for the right border of the cell
+ * @return border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ short getBorderRight();
+
+ /**
+ * set the type of border to use for the top border of the cell
+ * @param border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ void setBorderTop(short border);
+
+ /**
+ * get the type of border to use for the top border of the cell
+ * @return border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ short getBorderTop();
+
+ /**
+ * set the type of border to use for the bottom border of the cell
+ * @param border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+
+ void setBorderBottom(short border);
+
+ /**
+ * get the type of border to use for the bottom border of the cell
+ * @return border type
+ * @see #BORDER_NONE
+ * @see #BORDER_THIN
+ * @see #BORDER_MEDIUM
+ * @see #BORDER_DASHED
+ * @see #BORDER_DOTTED
+ * @see #BORDER_THICK
+ * @see #BORDER_DOUBLE
+ * @see #BORDER_HAIR
+ * @see #BORDER_MEDIUM_DASHED
+ * @see #BORDER_DASH_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT
+ * @see #BORDER_DASH_DOT_DOT
+ * @see #BORDER_MEDIUM_DASH_DOT_DOT
+ * @see #BORDER_SLANTED_DASH_DOT
+ */
+ short getBorderBottom();
+
+ /**
+ * set the color to use for the left border
+ * @param color The index of the color definition
+ */
+ void setLeftBorderColor(short color);
+
+ /**
+ * get the color to use for the left border
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ * @param color The index of the color definition
+ */
+ short getLeftBorderColor();
+
+ /**
+ * set the color to use for the right border
+ * @param color The index of the color definition
+ */
+ void setRightBorderColor(short color);
+
+ /**
+ * get the color to use for the left border
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ * @param color The index of the color definition
+ */
+ short getRightBorderColor();
+
+ /**
+ * set the color to use for the top border
+ * @param color The index of the color definition
+ */
+ void setTopBorderColor(short color);
+
+ /**
+ * get the color to use for the top border
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ * @param color The index of the color definition
+ */
+ short getTopBorderColor();
+
+ /**
+ * set the color to use for the bottom border
+ * @param color The index of the color definition
+ */
+ void setBottomBorderColor(short color);
+
+ /**
+ * get the color to use for the left border
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ * @param color The index of the color definition
+ */
+ short getBottomBorderColor();
+
+ /**
+ * setting to one fills the cell with the foreground color... No idea about
+ * other values
+ *
+ * @see #NO_FILL
+ * @see #SOLID_FOREGROUND
+ * @see #FINE_DOTS
+ * @see #ALT_BARS
+ * @see #SPARSE_DOTS
+ * @see #THICK_HORZ_BANDS
+ * @see #THICK_VERT_BANDS
+ * @see #THICK_BACKWARD_DIAG
+ * @see #THICK_FORWARD_DIAG
+ * @see #BIG_SPOTS
+ * @see #BRICKS
+ * @see #THIN_HORZ_BANDS
+ * @see #THIN_VERT_BANDS
+ * @see #THIN_BACKWARD_DIAG
+ * @see #THIN_FORWARD_DIAG
+ * @see #SQUARES
+ * @see #DIAMONDS
+ *
+ * @param fp fill pattern (set to 1 to fill w/foreground color)
+ */
+ void setFillPattern(short fp);
+
+ /**
+ * get the fill pattern (??) - set to 1 to fill with foreground color
+ * @return fill pattern
+ */
+
+ short getFillPattern();
+
+ /**
+ * set the background fill color.
+ * <p>
+ * For example:
+ * <pre>
+ * cs.setFillPattern(HSSFCellStyle.FINE_DOTS );
+ * cs.setFillBackgroundColor(new HSSFColor.RED().getIndex());
+ * </pre>
+ * optionally a Foreground and background fill can be applied:
+ * <i>Note: Ensure Foreground color is set prior to background</i>
+ * <pre>
+ * cs.setFillPattern(HSSFCellStyle.FINE_DOTS );
+ * cs.setFillForegroundColor(new HSSFColor.BLUE().getIndex());
+ * cs.setFillBackgroundColor(new HSSFColor.RED().getIndex());
+ * </pre>
+ * or, for the special case of SOLID_FILL:
+ * <pre>
+ * cs.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
+ * cs.setFillForegroundColor(new HSSFColor.RED().getIndex());
+ * </pre>
+ * It is necessary to set the fill style in order
+ * for the color to be shown in the cell.
+ *
+ * @param bg color
+ */
+
+ void setFillBackgroundColor(short bg);
+
+ /**
+ * get the background fill color
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ * @return fill color
+ */
+ short getFillBackgroundColor();
+
+ /**
+ * set the foreground fill color
+ * <i>Note: Ensure Foreground color is set prior to background color.</i>
+ * @param bg color
+ */
+ void setFillForegroundColor(short bg);
+
+ /**
+ * get the foreground fill color
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ * @return fill color
+ */
+ short getFillForegroundColor();
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Color {
+
+ /**
+ * @return index to the standard palette
+ */
+
+ short getIndex();
+
+ /**
+ * @return triplet representation like that in Excel
+ */
+
+ short[] getTriplet();
+
+ /**
+ * @return a hex string exactly like a gnumeric triplet
+ */
+
+ String getHexString();
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+
+public interface Comment {
+
+ /**
+ * Returns whether this comment is visible.
+ *
+ * @param visible <code>true</code> if the comment is visible, <code>false</code> otherwise
+ */
+ void setVisible(boolean visible);
+
+ /**
+ * Sets whether this comment is visible.
+ *
+ * @return <code>true</code> if the comment is visible, <code>false</code> otherwise
+ */
+ boolean isVisible();
+
+ /**
+ * Return the row of the cell that contains the comment
+ *
+ * @return the 0-based row of the cell that contains the comment
+ */
+ int getRow();
+
+ /**
+ * Set the row of the cell that contains the comment
+ *
+ * @param row the 0-based row of the cell that contains the comment
+ */
+ void setRow(int row);
+
+ /**
+ * Return the column of the cell that contains the comment
+ *
+ * @return the 0-based column of the cell that contains the comment
+ */
+ short getColumn();
+
+ /**
+ * Set the column of the cell that contains the comment
+ *
+ * @param col the 0-based column of the cell that contains the comment
+ */
+ void setColumn(short col);
+
+ /**
+ * Name of the original comment author
+ *
+ * @return the name of the original author of the comment
+ */
+ String getAuthor();
+
+ /**
+ * Name of the original comment author
+ *
+ * @param author the name of the original author of the comment
+ */
+ void setAuthor(String author);
+
+ /**
+ * Sets the rich text string used by this comment.
+ *
+ * @param string Sets the rich text string used by this object.
+ */
+ void setString(RichTextString string);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface DataFormat {
+
+ /**
+ * get the format index that matches the given format string.
+ * Creates a new format if one is not found. Aliases text to the proper format.
+ * @param format string matching a built in format
+ * @return index of format.
+ */
+
+ short getFormat(String format);
+
+ /**
+ * get the format string that matches the given format index
+ * @param index of a format
+ * @return string represented at index of format or null if there is not a format at that index
+ */
+
+ String getFormat(short index);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+
+public interface Font {
+
+ /**
+ * Arial font
+ */
+
+ public final static String FONT_ARIAL = "Arial";
+
+ /**
+ * Normal boldness (not bold)
+ */
+
+ public final static short BOLDWEIGHT_NORMAL = 0x190;
+
+ /**
+ * Bold boldness (bold)
+ */
+
+ public final static short BOLDWEIGHT_BOLD = 0x2bc;
+
+ /**
+ * normal type of black color.
+ */
+
+ public final static short COLOR_NORMAL = 0x7fff;
+
+ /**
+ * Dark Red color
+ */
+
+ public final static short COLOR_RED = 0xa;
+
+ /**
+ * no type offsetting (not super or subscript)
+ */
+
+ public final static short SS_NONE = 0;
+
+ /**
+ * superscript
+ */
+
+ public final static short SS_SUPER = 1;
+
+ /**
+ * subscript
+ */
+
+ public final static short SS_SUB = 2;
+
+ /**
+ * not underlined
+ */
+
+ public final static byte U_NONE = 0;
+
+ /**
+ * single (normal) underline
+ */
+
+ public final static byte U_SINGLE = 1;
+
+ /**
+ * double underlined
+ */
+
+ public final static byte U_DOUBLE = 2;
+
+ /**
+ * accounting style single underline
+ */
+
+ public final static byte U_SINGLE_ACCOUNTING = 0x21;
+
+ /**
+ * accounting style double underline
+ */
+
+ public final static byte U_DOUBLE_ACCOUNTING = 0x22;
+
+ /**
+ * ANSI character set
+ */
+ public final static byte ANSI_CHARSET = 0;
+
+ /**
+ * Default character set.
+ */
+ public final static byte DEFAULT_CHARSET = 1;
+
+ /**
+ * Symbol character set
+ */
+ public final static byte SYMBOL_CHARSET = 2;
+
+ /**
+ * set the name for the font (i.e. Arial)
+ * @param name String representing the name of the font to use
+ * @see #FONT_ARIAL
+ */
+
+ void setFontName(String name);
+
+ /**
+ * get the name for the font (i.e. Arial)
+ * @return String representing the name of the font to use
+ * @see #FONT_ARIAL
+ */
+
+ String getFontName();
+
+ /**
+ * get the index within the HSSFWorkbook (sequence within the collection of Font objects)
+ * @return unique index number of the underlying record this Font represents (probably you don't care
+ * unless you're comparing which one is which)
+ */
+
+ short getIndex();
+
+ /**
+ * set the font height in unit's of 1/20th of a point. Maybe you might want to
+ * use the setFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
+ * @param height height in 1/20ths of a point
+ * @see #setFontHeightInPoints(short)
+ */
+
+ void setFontHeight(short height);
+
+ /**
+ * set the font height
+ * @param height height in the familiar unit of measure - points
+ * @see #setFontHeight(short)
+ */
+
+ void setFontHeightInPoints(short height);
+
+ /**
+ * get the font height in unit's of 1/20th of a point. Maybe you might want to
+ * use the getFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
+ * @return short - height in 1/20ths of a point
+ * @see #getFontHeightInPoints()
+ */
+
+ short getFontHeight();
+
+ /**
+ * get the font height
+ * @return short - height in the familiar unit of measure - points
+ * @see #getFontHeight()
+ */
+
+ short getFontHeightInPoints();
+
+ /**
+ * set whether to use italics or not
+ * @param italic italics or not
+ */
+
+ void setItalic(boolean italic);
+
+ /**
+ * get whether to use italics or not
+ * @return italics or not
+ */
+
+ boolean getItalic();
+
+ /**
+ * set whether to use a strikeout horizontal line through the text or not
+ * @param strikeout or not
+ */
+
+ void setStrikeout(boolean strikeout);
+
+ /**
+ * get whether to use a strikeout horizontal line through the text or not
+ * @return strikeout or not
+ */
+
+ boolean getStrikeout();
+
+ /**
+ * set the color for the font
+ * @param color to use
+ * @see #COLOR_NORMAL Note: Use this rather than HSSFColor.AUTOMATIC for default font color
+ * @see #COLOR_RED
+ */
+
+ void setColor(short color);
+
+ /**
+ * get the color for the font
+ * @return color to use
+ * @see #COLOR_NORMAL
+ * @see #COLOR_RED
+ * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
+ */
+ short getColor();
+
+ /**
+ * set the boldness to use
+ * @param boldweight
+ * @see #BOLDWEIGHT_NORMAL
+ * @see #BOLDWEIGHT_BOLD
+ */
+
+ void setBoldweight(short boldweight);
+
+ /**
+ * get the boldness to use
+ * @return boldweight
+ * @see #BOLDWEIGHT_NORMAL
+ * @see #BOLDWEIGHT_BOLD
+ */
+
+ short getBoldweight();
+
+ /**
+ * set normal,super or subscript.
+ * @param offset type to use (none,super,sub)
+ * @see #SS_NONE
+ * @see #SS_SUPER
+ * @see #SS_SUB
+ */
+
+ void setTypeOffset(short offset);
+
+ /**
+ * get normal,super or subscript.
+ * @return offset type to use (none,super,sub)
+ * @see #SS_NONE
+ * @see #SS_SUPER
+ * @see #SS_SUB
+ */
+
+ short getTypeOffset();
+
+ /**
+ * set type of text underlining to use
+ * @param underline type
+ * @see #U_NONE
+ * @see #U_SINGLE
+ * @see #U_DOUBLE
+ * @see #U_SINGLE_ACCOUNTING
+ * @see #U_DOUBLE_ACCOUNTING
+ */
+
+ void setUnderline(byte underline);
+
+ /**
+ * get type of text underlining to use
+ * @return underlining type
+ * @see #U_NONE
+ * @see #U_SINGLE
+ * @see #U_DOUBLE
+ * @see #U_SINGLE_ACCOUNTING
+ * @see #U_DOUBLE_ACCOUNTING
+ */
+
+ byte getUnderline();
+
+ /**
+ * get character-set to use.
+ * @return character-set
+ * @see #ANSI_CHARSET
+ * @see #DEFAULT_CHARSET
+ * @see #SYMBOL_CHARSET
+ */
+ byte getCharSet();
+
+ /**
+ * set character-set to use.
+ * @see #ANSI_CHARSET
+ * @see #DEFAULT_CHARSET
+ * @see #SYMBOL_CHARSET
+ */
+ void setCharSet(byte charset);
+
+ String toString();
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Footer {
+
+ /**
+ * Get the left side of the footer.
+ * @return The string representing the left side.
+ */
+ String getLeft();
+
+ /**
+ * Sets the left string.
+ * @param newLeft The string to set as the left side.
+ */
+ void setLeft(String newLeft);
+
+ /**
+ * Get the center of the footer.
+ * @return The string representing the center.
+ */
+ String getCenter();
+
+ /**
+ * Sets the center string.
+ * @param newCenter The string to set as the center.
+ */
+ void setCenter(String newCenter);
+
+ /**
+ * Get the right side of the footer.
+ * @return The string representing the right side.
+ */
+ String getRight();
+
+ /**
+ * Sets the right string.
+ * @param newRight The string to set as the right side.
+ */
+ void setRight(String newRight);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Header {
+
+ /**
+ * Get the left side of the header.
+ *
+ * @return The string representing the left side.
+ */
+ String getLeft();
+
+ /**
+ * Sets the left string.
+ *
+ * @param newLeft The string to set as the left side.
+ */
+ void setLeft(String newLeft);
+
+ /**
+ * Get the center of the header.
+ *
+ * @return The string representing the center.
+ */
+ String getCenter();
+
+ /**
+ * Sets the center string.
+ *
+ * @param newCenter The string to set as the center.
+ */
+ void setCenter(String newCenter);
+
+ /**
+ * Get the right side of the header.
+ *
+ * @return The string representing the right side.
+ */
+ String getRight();
+
+ /**
+ * Sets the right string.
+ *
+ * @param newRight The string to set as the right side.
+ */
+ void setRight(String newRight);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Name {
+
+ /** Get the sheets name which this named range is referenced to
+ * @return sheet name, which this named range refered to
+ */
+
+ String getSheetName();
+
+ /**
+ * gets the name of the named range
+ * @return named range name
+ */
+
+ String getNameName();
+
+ /**
+ * sets the name of the named range
+ * @param nameName named range name to set
+ */
+
+ void setNameName(String nameName);
+
+ /**
+ * gets the reference of the named range
+ * @return reference of the named range
+ */
+
+ String getReference();
+
+ /**
+ * sets the reference of this named range
+ * @param ref the reference to set
+ */
+
+ void setReference(String ref);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Palette {
+
+ /**
+ * Retrieves the color at a given index
+ *
+ * @param index the palette index, between 0x8 to 0x40 inclusive
+ * @return the color, or null if the index is not populated
+ */
+ Color getColor(short index);
+
+ /**
+ * Finds the first occurance of a given color
+ *
+ * @param red the RGB red component, between 0 and 255 inclusive
+ * @param green the RGB green component, between 0 and 255 inclusive
+ * @param blue the RGB blue component, between 0 and 255 inclusive
+ * @return the color, or null if the color does not exist in this palette
+ */
+ Color findColor(byte red, byte green, byte blue);
+
+ /**
+ * Finds the closest matching color in the custom palette. The
+ * method for finding the distance between the colors is fairly
+ * primative.
+ *
+ * @param red The red component of the color to match.
+ * @param green The green component of the color to match.
+ * @param blue The blue component of the color to match.
+ * @return The closest color or null if there are no custom
+ * colors currently defined.
+ */
+ Color findSimilarColor(byte red, byte green, byte blue);
+
+ /**
+ * Sets the color at the given offset
+ *
+ * @param index the palette index, between 0x8 to 0x40 inclusive
+ * @param red the RGB red component, between 0 and 255 inclusive
+ * @param green the RGB green component, between 0 and 255 inclusive
+ * @param blue the RGB blue component, between 0 and 255 inclusive
+ */
+ void setColorAtIndex(short index, byte red, byte green, byte blue);
+
+ /**
+ * Adds a new color into an empty color slot.
+ * @param red The red component
+ * @param green The green component
+ * @param blue The blue component
+ *
+ * @return The new custom color.
+ *
+ * @throws RuntimeException if there are more more free color indexes.
+ */
+ Color addColor(byte red, byte green, byte blue);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import java.util.List;
+
+import org.apache.poi.hssf.usermodel.HSSFAnchor;
+import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
+import org.apache.poi.hssf.usermodel.HSSFComment;
+import org.apache.poi.hssf.usermodel.HSSFPicture;
+import org.apache.poi.hssf.usermodel.HSSFPolygon;
+import org.apache.poi.hssf.usermodel.HSSFShapeGroup;
+import org.apache.poi.hssf.usermodel.HSSFSimpleShape;
+import org.apache.poi.hssf.usermodel.HSSFTextbox;
+
+public interface Patriarch {
+
+ /**
+ * Creates a new group record stored under this patriarch.
+ *
+ * @param anchor the client anchor describes how this group is attached
+ * to the sheet.
+ * @return the newly created group.
+ */
+ HSSFShapeGroup createGroup(HSSFClientAnchor anchor);
+
+ /**
+ * Creates a simple shape. This includes such shapes as lines, rectangles,
+ * and ovals.
+ *
+ * @param anchor the client anchor describes how this group is attached
+ * to the sheet.
+ * @return the newly created shape.
+ */
+ HSSFSimpleShape createSimpleShape(HSSFClientAnchor anchor);
+
+ /**
+ * Creates a picture.
+ *
+ * @param anchor the client anchor describes how this group is attached
+ * to the sheet.
+ * @return the newly created shape.
+ */
+ HSSFPicture createPicture(HSSFClientAnchor anchor, int pictureIndex);
+
+ /**
+ * Creates a polygon
+ *
+ * @param anchor the client anchor describes how this group is attached
+ * to the sheet.
+ * @return the newly created shape.
+ */
+ HSSFPolygon createPolygon(HSSFClientAnchor anchor);
+
+ /**
+ * Constructs a textbox under the patriarch.
+ *
+ * @param anchor the client anchor describes how this group is attached
+ * to the sheet.
+ * @return the newly created textbox.
+ */
+ HSSFTextbox createTextbox(HSSFClientAnchor anchor);
+
+ /**
+ * Constructs a cell comment.
+ *
+ * @param anchor the client anchor describes how this comment is attached
+ * to the sheet.
+ * @return the newly created comment.
+ */
+ HSSFComment createComment(HSSFAnchor anchor);
+
+ /**
+ * Returns a list of all shapes contained by the patriarch.
+ */
+ List getChildren();
+
+ /**
+ * Total count of all children and their children's children.
+ */
+ int countOfAllChildren();
+
+ /**
+ * Sets the coordinate space of this group. All children are contrained
+ * to these coordinates.
+ */
+ void setCoordinates(int x1, int y1, int x2, int y2);
+
+ /**
+ * The top left x coordinate of this group.
+ */
+ int getX1();
+
+ /**
+ * The top left y coordinate of this group.
+ */
+ int getY1();
+
+ /**
+ * The bottom right x coordinate of this group.
+ */
+ int getX2();
+
+ /**
+ * The bottom right y coordinate of this group.
+ */
+ int getY2();
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface PrintSetup {
+
+ public static final short LETTER_PAPERSIZE = 1;
+
+ public static final short LEGAL_PAPERSIZE = 5;
+
+ public static final short EXECUTIVE_PAPERSIZE = 7;
+
+ public static final short A4_PAPERSIZE = 9;
+
+ public static final short A5_PAPERSIZE = 11;
+
+ public static final short ENVELOPE_10_PAPERSIZE = 20;
+
+ public static final short ENVELOPE_DL_PAPERSIZE = 27;
+
+ public static final short ENVELOPE_CS_PAPERSIZE = 28;
+
+ public static final short ENVELOPE_MONARCH_PAPERSIZE = 37;
+
+ /**
+ * Set the paper size.
+ * @param size the paper size.
+ */
+ void setPaperSize(short size);
+
+ /**
+ * Set the scale.
+ * @param scale the scale to use
+ */
+ void setScale(short scale);
+
+ /**
+ * Set the page numbering start.
+ * @param start the page numbering start
+ */
+ void setPageStart(short start);
+
+ /**
+ * Set the number of pages wide to fit the sheet in
+ * @param width the number of pages
+ */
+ void setFitWidth(short width);
+
+ /**
+ * Set the number of pages high to fit the sheet in
+ * @param height the number of pages
+ */
+ void setFitHeight(short height);
+
+ /**
+ * Sets the options flags. Not advisable to do it directly.
+ * @param options The bit flags for the options
+ */
+ void setOptions(short options);
+
+ /**
+ * Set whether to go left to right or top down in ordering
+ * @param ltor left to right
+ */
+ void setLeftToRight(boolean ltor);
+
+ /**
+ * Set whether to print in landscape
+ * @param ls landscape
+ */
+ void setLandscape(boolean ls);
+
+ /**
+ * Valid settings. I'm not for sure.
+ * @param valid Valid
+ */
+ void setValidSettings(boolean valid);
+
+ /**
+ * Set whether it is black and white
+ * @param mono Black and white
+ */
+ void setNoColor(boolean mono);
+
+ /**
+ * Set whether it is in draft mode
+ * @param d draft
+ */
+ void setDraft(boolean d);
+
+ /**
+ * Print the include notes
+ * @param printnotes print the notes
+ */
+ void setNotes(boolean printnotes);
+
+ /**
+ * Set no orientation. ?
+ * @param orientation Orientation.
+ */
+ void setNoOrientation(boolean orientation);
+
+ /**
+ * Set whether to use page start
+ * @param page Use page start
+ */
+ void setUsePage(boolean page);
+
+ /**
+ * Sets the horizontal resolution.
+ * @param resolution horizontal resolution
+ */
+ void setHResolution(short resolution);
+
+ /**
+ * Sets the vertical resolution.
+ * @param resolution vertical resolution
+ */
+ void setVResolution(short resolution);
+
+ /**
+ * Sets the header margin.
+ * @param headermargin header margin
+ */
+ void setHeaderMargin(double headermargin);
+
+ /**
+ * Sets the footer margin.
+ * @param footermargin footer margin
+ */
+ void setFooterMargin(double footermargin);
+
+ /**
+ * Sets the number of copies.
+ * @param copies number of copies
+ */
+ void setCopies(short copies);
+
+ /**
+ * Returns the paper size.
+ * @return paper size
+ */
+ short getPaperSize();
+
+ /**
+ * Returns the scale.
+ * @return scale
+ */
+ short getScale();
+
+ /**
+ * Returns the page start.
+ * @return page start
+ */
+ short getPageStart();
+
+ /**
+ * Returns the number of pages wide to fit sheet in.
+ * @return number of pages wide to fit sheet in
+ */
+ short getFitWidth();
+
+ /**
+ * Returns the number of pages high to fit the sheet in.
+ * @return number of pages high to fit the sheet in
+ */
+ short getFitHeight();
+
+ /**
+ * Returns the bit flags for the options.
+ * @return bit flags for the options
+ */
+ short getOptions();
+
+ /**
+ * Returns the left to right print order.
+ * @return left to right print order
+ */
+ boolean getLeftToRight();
+
+ /**
+ * Returns the landscape mode.
+ * @return landscape mode
+ */
+ boolean getLandscape();
+
+ /**
+ * Returns the valid settings.
+ * @return valid settings
+ */
+ boolean getValidSettings();
+
+ /**
+ * Returns the black and white setting.
+ * @return black and white setting
+ */
+ boolean getNoColor();
+
+ /**
+ * Returns the draft mode.
+ * @return draft mode
+ */
+ boolean getDraft();
+
+ /**
+ * Returns the print notes.
+ * @return print notes
+ */
+ boolean getNotes();
+
+ /**
+ * Returns the no orientation.
+ * @return no orientation
+ */
+ boolean getNoOrientation();
+
+ /**
+ * Returns the use page numbers.
+ * @return use page numbers
+ */
+ boolean getUsePage();
+
+ /**
+ * Returns the horizontal resolution.
+ * @return horizontal resolution
+ */
+ short getHResolution();
+
+ /**
+ * Returns the vertical resolution.
+ * @return vertical resolution
+ */
+ short getVResolution();
+
+ /**
+ * Returns the header margin.
+ * @return header margin
+ */
+ double getHeaderMargin();
+
+ /**
+ * Returns the footer margin.
+ * @return footer margin
+ */
+ double getFooterMargin();
+
+ /**
+ * Returns the number of copies.
+ * @return number of copies
+ */
+ short getCopies();
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+
+public interface RichTextString {
+
+ /** Place holder for indicating that NO_FONT has been applied here */
+ public static final short NO_FONT = 0;
+
+ /**
+ * Applies a font to the specified characters of a string.
+ *
+ * @param startIndex The start index to apply the font to (inclusive)
+ * @param endIndex The end index to apply the font to (exclusive)
+ * @param fontIndex The font to use.
+ */
+ void applyFont(int startIndex, int endIndex, short fontIndex);
+
+ /**
+ * Applies a font to the specified characters of a string.
+ *
+ * @param startIndex The start index to apply the font to (inclusive)
+ * @param endIndex The end index to apply to font to (exclusive)
+ * @param font The index of the font to use.
+ */
+ void applyFont(int startIndex, int endIndex, Font font);
+
+ /**
+ * Sets the font of the entire string.
+ * @param font The font to use.
+ */
+ void applyFont(Font font);
+
+ /**
+ * Removes any formatting that may have been applied to the string.
+ */
+ void clearFormatting();
+
+ /**
+ * Returns the plain string representation.
+ */
+ String getString();
+
+ /**
+ * @return the number of characters in the font.
+ */
+ int length();
+
+ /**
+ * Returns the font in use at a particular index.
+ *
+ * @param index The index.
+ * @return The font that's currently being applied at that
+ * index or null if no font is being applied or the
+ * index is out of range.
+ */
+ short getFontAtIndex(int index);
+
+ /**
+ * @return The number of formatting runs used. There will always be at
+ * least one of font NO_FONT.
+ *
+ * @see #NO_FONT
+ */
+ int numFormattingRuns();
+
+ /**
+ * The index within the string to which the specified formatting run applies.
+ * @param index the index of the formatting run
+ * @return the index within the string.
+ */
+ int getIndexOfFormattingRun(int index);
+
+ /**
+ * Gets the font used in a particular formatting run.
+ *
+ * @param index the index of the formatting run
+ * @return the font number used.
+ */
+ short getFontOfFormattingRun(int index);
+
+ /**
+ * Compares one rich text string to another.
+ */
+ int compareTo(Object o);
+
+ boolean equals(Object o);
+
+ /**
+ * @return the plain text representation of this string.
+ */
+ String toString();
+
+ /**
+ * Applies the specified font to the entire string.
+ *
+ * @param fontIndex the font to apply.
+ */
+ void applyFont(short fontIndex);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import java.util.Iterator;
+
+public interface Row {
+
+ // used for collections
+ public final static int INITIAL_CAPACITY = 5;
+
+ /**
+ * Use this to create new cells within the row and return it.
+ * <p>
+ * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
+ * either through calling <code>setCellValue</code> or <code>setCellType</code>.
+ *
+ * @param column - the column number this cell represents
+ *
+ * @return HSSFCell a high level representation of the created cell.
+ */
+
+ Cell createCell(short column);
+
+ /**
+ * Use this to create new cells within the row and return it.
+ * <p>
+ * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
+ * either through calling setCellValue or setCellType.
+ *
+ * @param column - the column number this cell represents
+ *
+ * @return HSSFCell a high level representation of the created cell.
+ */
+
+ Cell createCell(short column, int type);
+
+ /**
+ * remove the HSSFCell from this row.
+ * @param cell to remove
+ */
+ void removeCell(Cell cell);
+
+ /**
+ * set the row number of this row.
+ * @param rowNum the row number (0-based)
+ * @throws IndexOutOfBoundsException if the row number is not within the range 0-65535.
+ */
+
+ void setRowNum(int rowNum);
+
+ /**
+ * get row number this row represents
+ * @return the row number (0 based)
+ */
+
+ int getRowNum();
+
+ /**
+ * get the hssfcell representing a given column (logical cell) 0-based. If you
+ * ask for a cell that is not defined....you get a null.
+ *
+ * @param cellnum 0 based column number
+ * @return HSSFCell representing that column or null if undefined.
+ */
+
+ Cell getCell(short cellnum);
+
+ /**
+ * get the number of the first cell contained in this row.
+ * @return short representing the first logical cell in the row, or -1 if the row does not contain any cells.
+ */
+
+ short getFirstCellNum();
+
+ /**
+ * gets the number of the last cell contained in this row <b>PLUS ONE</b>.
+ * @return short representing the last logical cell in the row <b>PLUS ONE</b>, or -1 if the row does not contain any cells.
+ */
+
+ short getLastCellNum();
+
+ /**
+ * gets the number of defined cells (NOT number of cells in the actual row!).
+ * That is to say if only columns 0,4,5 have values then there would be 3.
+ * @return int representing the number of defined cells in the row.
+ */
+
+ int getPhysicalNumberOfCells();
+
+ /**
+ * set the row's height or set to ff (-1) for undefined/default-height. Set the height in "twips" or
+ * 1/20th of a point.
+ * @param height rowheight or 0xff for undefined (use sheet default)
+ */
+
+ void setHeight(short height);
+
+ /**
+ * set whether or not to display this row with 0 height
+ * @param zHeight height is zero or not.
+ */
+ void setZeroHeight(boolean zHeight);
+
+ /**
+ * get whether or not to display this row with 0 height
+ * @return - zHeight height is zero or not.
+ */
+ boolean getZeroHeight();
+
+ /**
+ * set the row's height in points.
+ * @param height row height in points
+ */
+
+ void setHeightInPoints(float height);
+
+ /**
+ * get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)
+ * @return rowheight or 0xff for undefined (use sheet default)
+ */
+
+ short getHeight();
+
+ /**
+ * get the row's height or ff (-1) for undefined/default-height in points (20*getHeight())
+ * @return rowheight or 0xff for undefined (use sheet default)
+ */
+
+ float getHeightInPoints();
+
+ /**
+ * @return cell iterator of the physically defined cells. Note element 4 may
+ * actually be row cell depending on how many are defined!
+ */
+
+ Iterator cellIterator();
+
+ int compareTo(Object obj);
+
+ boolean equals(Object obj);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+/**
+ * Allows the getting and saving of shared strings
+ */
+public interface SharedStringSource {
+
+ /**
+ * Return the string at position <code>idx</idx> (0-based) in this source.
+ *
+ * @param idx String position.
+ * @return The string, or null if not found.
+ */
+ public String getSharedStringAt(int idx);
+
+ /**
+ * Store a string in this source.
+ *
+ * @param s The string to store.
+ * @return The 0-based position of the newly added string.
+ */
+ public int putSharedString(String s);
+}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import java.util.Iterator;
+
+import org.apache.poi.hssf.util.PaneInformation;
+import org.apache.poi.hssf.util.Region;
+
+public interface Sheet {
+
+ /* Constants for margins */
+ public static final short LeftMargin = Sheet.LeftMargin;
+
+ public static final short RightMargin = Sheet.RightMargin;
+
+ public static final short TopMargin = Sheet.TopMargin;
+
+ public static final short BottomMargin = Sheet.BottomMargin;
+
+ public static final byte PANE_LOWER_RIGHT = (byte) 0;
+
+ public static final byte PANE_UPPER_RIGHT = (byte) 1;
+
+ public static final byte PANE_LOWER_LEFT = (byte) 2;
+
+ public static final byte PANE_UPPER_LEFT = (byte) 3;
+
+ /**
+ * Used for compile-time optimization. This is the initial size for the collection of
+ * rows. It is currently set to 20. If you generate larger sheets you may benefit
+ * by setting this to a higher number and recompiling a custom edition of HSSFSheet.
+ */
+
+ public final static int INITIAL_CAPACITY = 20;
+
+ /**
+ * Create a new row within the sheet and return the high level representation
+ *
+ * @param rownum row number
+ * @return High level HSSFRow object representing a row in the sheet
+ * @see org.apache.poi.hssf.usermodel.HSSFRow
+ * @see #removeRow(HSSFRow)
+ */
+ Row createRow(int rownum);
+
+ /**
+ * Remove a row from this sheet. All cells contained in the row are removed as well
+ *
+ * @param row representing a row to remove.
+ */
+
+ void removeRow(Row row);
+
+ /**
+ * Returns the logical row (not physical) 0-based. If you ask for a row that is not
+ * defined you get a null. This is to say row 4 represents the fifth row on a sheet.
+ * @param rownum row to get
+ * @return HSSFRow representing the rownumber or null if its not defined on the sheet
+ */
+
+ Row getRow(int rownum);
+
+ /**
+ * Returns the number of phsyically defined rows (NOT the number of rows in the sheet)
+ */
+
+ int getPhysicalNumberOfRows();
+
+ /**
+ * gets the first row on the sheet
+ * @return the number of the first logical row on the sheet
+ */
+
+ int getFirstRowNum();
+
+ /**
+ * gets the last row on the sheet
+ * @return last row contained n this sheet.
+ */
+
+ int getLastRowNum();
+
+ /**
+ * Get the visibility state for a given column.
+ * @param column - the column to get (0-based)
+ * @param hidden - the visiblity state of the column
+ */
+
+ void setColumnHidden(short column, boolean hidden);
+
+ /**
+ * Get the hidden state for a given column.
+ * @param column - the column to set (0-based)
+ * @return hidden - the visiblity state of the column
+ */
+
+ boolean isColumnHidden(short column);
+
+ /**
+ * set the width (in units of 1/256th of a character width)
+ * @param column - the column to set (0-based)
+ * @param width - the width in units of 1/256th of a character width
+ */
+
+ void setColumnWidth(short column, short width);
+
+ /**
+ * get the width (in units of 1/256th of a character width )
+ * @param column - the column to set (0-based)
+ * @return width - the width in units of 1/256th of a character width
+ */
+
+ short getColumnWidth(short column);
+
+ /**
+ * get the default column width for the sheet (if the columns do not define their own width) in
+ * characters
+ * @return default column width
+ */
+
+ short getDefaultColumnWidth();
+
+ /**
+ * get the default row height for the sheet (if the rows do not define their own height) in
+ * twips (1/20 of a point)
+ * @return default row height
+ */
+
+ short getDefaultRowHeight();
+
+ /**
+ * get the default row height for the sheet (if the rows do not define their own height) in
+ * points.
+ * @return default row height in points
+ */
+
+ float getDefaultRowHeightInPoints();
+
+ /**
+ * set the default column width for the sheet (if the columns do not define their own width) in
+ * characters
+ * @param width default column width
+ */
+
+ void setDefaultColumnWidth(short width);
+
+ /**
+ * set the default row height for the sheet (if the rows do not define their own height) in
+ * twips (1/20 of a point)
+ * @param height default row height
+ */
+
+ void setDefaultRowHeight(short height);
+
+ /**
+ * set the default row height for the sheet (if the rows do not define their own height) in
+ * points
+ * @param height default row height
+ */
+
+ void setDefaultRowHeightInPoints(float height);
+
+ /**
+ * get whether gridlines are printed.
+ * @return true if printed
+ */
+
+ boolean isGridsPrinted();
+
+ /**
+ * set whether gridlines printed.
+ * @param value false if not printed.
+ */
+
+ void setGridsPrinted(boolean value);
+
+ /**
+ * adds a merged region of cells (hence those cells form one)
+ * @param region (rowfrom/colfrom-rowto/colto) to merge
+ * @return index of this region
+ */
+
+ int addMergedRegion(Region region);
+
+ /**
+ * determines whether the output is vertically centered on the page.
+ * @param value true to vertically center, false otherwise.
+ */
+
+ void setVerticallyCenter(boolean value);
+
+ /**
+ * Determine whether printed output for this sheet will be vertically centered.
+ */
+
+ boolean getVerticallyCenter(boolean value);
+
+ /**
+ * determines whether the output is horizontally centered on the page.
+ * @param value true to horizontally center, false otherwise.
+ */
+
+ void setHorizontallyCenter(boolean value);
+
+ /**
+ * Determine whether printed output for this sheet will be horizontally centered.
+ */
+
+ boolean getHorizontallyCenter();
+
+ /**
+ * removes a merged region of cells (hence letting them free)
+ * @param index of the region to unmerge
+ */
+
+ void removeMergedRegion(int index);
+
+ /**
+ * returns the number of merged regions
+ * @return number of merged regions
+ */
+
+ int getNumMergedRegions();
+
+ /**
+ * gets the region at a particular index
+ * @param index of the region to fetch
+ * @return the merged region (simple eh?)
+ */
+
+ Region getMergedRegionAt(int index);
+
+ /**
+ * @return an iterator of the PHYSICAL rows. Meaning the 3rd element may not
+ * be the third row if say for instance the second row is undefined.
+ */
+
+ Iterator rowIterator();
+
+ /**
+ * whether alternate expression evaluation is on
+ * @param b alternative expression evaluation or not
+ */
+
+ void setAlternativeExpression(boolean b);
+
+ /**
+ * whether alternative formula entry is on
+ * @param b alternative formulas or not
+ */
+
+ void setAlternativeFormula(boolean b);
+
+ /**
+ * show automatic page breaks or not
+ * @param b whether to show auto page breaks
+ */
+
+ void setAutobreaks(boolean b);
+
+ /**
+ * set whether sheet is a dialog sheet or not
+ * @param b isDialog or not
+ */
+
+ void setDialog(boolean b);
+
+ /**
+ * set whether to display the guts or not
+ *
+ * @param b guts or no guts (or glory)
+ */
+
+ void setDisplayGuts(boolean b);
+
+ /**
+ * fit to page option is on
+ * @param b fit or not
+ */
+
+ void setFitToPage(boolean b);
+
+ /**
+ * set if row summaries appear below detail in the outline
+ * @param b below or not
+ */
+
+ void setRowSumsBelow(boolean b);
+
+ /**
+ * set if col summaries appear right of the detail in the outline
+ * @param b right or not
+ */
+
+ void setRowSumsRight(boolean b);
+
+ /**
+ * whether alternate expression evaluation is on
+ * @return alternative expression evaluation or not
+ */
+
+ boolean getAlternateExpression();
+
+ /**
+ * whether alternative formula entry is on
+ * @return alternative formulas or not
+ */
+
+ boolean getAlternateFormula();
+
+ /**
+ * show automatic page breaks or not
+ * @return whether to show auto page breaks
+ */
+
+ boolean getAutobreaks();
+
+ /**
+ * get whether sheet is a dialog sheet or not
+ * @return isDialog or not
+ */
+
+ boolean getDialog();
+
+ /**
+ * get whether to display the guts or not
+ *
+ * @return guts or no guts (or glory)
+ */
+
+ boolean getDisplayGuts();
+
+ /**
+ * fit to page option is on
+ * @return fit or not
+ */
+
+ boolean getFitToPage();
+
+ /**
+ * get if row summaries appear below detail in the outline
+ * @return below or not
+ */
+
+ boolean getRowSumsBelow();
+
+ /**
+ * get if col summaries appear right of the detail in the outline
+ * @return right or not
+ */
+
+ boolean getRowSumsRight();
+
+ /**
+ * Returns whether gridlines are printed.
+ * @return Gridlines are printed
+ */
+ boolean isPrintGridlines();
+
+ /**
+ * Turns on or off the printing of gridlines.
+ * @param newPrintGridlines boolean to turn on or off the printing of
+ * gridlines
+ */
+ void setPrintGridlines(boolean newPrintGridlines);
+
+ /**
+ * Gets the print setup object.
+ * @return The user model for the print setup object.
+ */
+ PrintSetup getPrintSetup();
+
+ /**
+ * Gets the user model for the document header.
+ * @return The Document header.
+ */
+ Header getHeader();
+
+ /**
+ * Gets the user model for the document footer.
+ * @return The Document footer.
+ */
+ Footer getFooter();
+
+ /**
+ * Sets whether sheet is selected.
+ * @param sel Whether to select the sheet or deselect the sheet.
+ */
+ void setSelected(boolean sel);
+
+ /**
+ * Gets the size of the margin in inches.
+ * @param margin which margin to get
+ * @return the size of the margin
+ */
+ double getMargin(short margin);
+
+ /**
+ * Sets the size of the margin in inches.
+ * @param margin which margin to get
+ * @param size the size of the margin
+ */
+ void setMargin(short margin, double size);
+
+ /**
+ * Answer whether protection is enabled or disabled
+ * @return true => protection enabled; false => protection disabled
+ */
+ boolean getProtect();
+
+ /**
+ * @return hashed password
+ */
+ short getPassword();
+
+ /**
+ * Answer whether object protection is enabled or disabled
+ * @return true => protection enabled; false => protection disabled
+ */
+ boolean getObjectProtect();
+
+ /**
+ * Answer whether scenario protection is enabled or disabled
+ * @return true => protection enabled; false => protection disabled
+ */
+ boolean getScenarioProtect();
+
+ /**
+ * Sets the protection on enabled or disabled
+ * @param protect true => protection enabled; false => protection disabled
+ * @deprecated use protectSheet(String, boolean, boolean)
+ */
+ void setProtect(boolean protect);
+
+ /**
+ * Sets the protection enabled as well as the password
+ * @param password to set for protection
+ */
+ void protectSheet(String password);
+
+ /**
+ * Sets the zoom magnication for the sheet. The zoom is expressed as a
+ * fraction. For example to express a zoom of 75% use 3 for the numerator
+ * and 4 for the denominator.
+ *
+ * @param numerator The numerator for the zoom magnification.
+ * @param denominator The denominator for the zoom magnification.
+ */
+ void setZoom(int numerator, int denominator);
+
+ /**
+ * The top row in the visible view when the sheet is
+ * first viewed after opening it in a viewer
+ * @return short indicating the rownum (0 based) of the top row
+ */
+ short getTopRow();
+
+ /**
+ * The left col in the visible view when the sheet is
+ * first viewed after opening it in a viewer
+ * @return short indicating the rownum (0 based) of the top row
+ */
+ short getLeftCol();
+
+ /**
+ * Sets desktop window pane display area, when the
+ * file is first opened in a viewer.
+ * @param toprow the top row to show in desktop window pane
+ * @param leftcol the left column to show in desktop window pane
+ */
+ void showInPane(short toprow, short leftcol);
+
+ /**
+ * Shifts rows between startRow and endRow n number of rows.
+ * If you use a negative number, it will shift rows up.
+ * Code ensures that rows don't wrap around.
+ *
+ * Calls shiftRows(startRow, endRow, n, false, false);
+ *
+ * <p>
+ * Additionally shifts merged regions that are completely defined in these
+ * rows (ie. merged 2 cells on a row to be shifted).
+ * @param startRow the row to start shifting
+ * @param endRow the row to end shifting
+ * @param n the number of rows to shift
+ */
+ void shiftRows(int startRow, int endRow, int n);
+
+ /**
+ * Shifts rows between startRow and endRow n number of rows.
+ * If you use a negative number, it will shift rows up.
+ * Code ensures that rows don't wrap around
+ *
+ * <p>
+ * Additionally shifts merged regions that are completely defined in these
+ * rows (ie. merged 2 cells on a row to be shifted).
+ * <p>
+ * TODO Might want to add bounds checking here
+ * @param startRow the row to start shifting
+ * @param endRow the row to end shifting
+ * @param n the number of rows to shift
+ * @param copyRowHeight whether to copy the row height during the shift
+ * @param resetOriginalRowHeight whether to set the original row's height to the default
+ */
+ void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight);
+
+ /**
+ * Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
+ * @param colSplit Horizonatal position of split.
+ * @param rowSplit Vertical position of split.
+ * @param topRow Top row visible in bottom pane
+ * @param leftmostColumn Left column visible in right pane.
+ */
+ void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow);
+
+ /**
+ * Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
+ * @param colSplit Horizonatal position of split.
+ * @param rowSplit Vertical position of split.
+ */
+ void createFreezePane(int colSplit, int rowSplit);
+
+ /**
+ * Creates a split pane. Any existing freezepane or split pane is overwritten.
+ * @param xSplitPos Horizonatal position of split (in 1/20th of a point).
+ * @param ySplitPos Vertical position of split (in 1/20th of a point).
+ * @param topRow Top row visible in bottom pane
+ * @param leftmostColumn Left column visible in right pane.
+ * @param activePane Active pane. One of: PANE_LOWER_RIGHT,
+ * PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
+ * @see #PANE_LOWER_LEFT
+ * @see #PANE_LOWER_RIGHT
+ * @see #PANE_UPPER_LEFT
+ * @see #PANE_UPPER_RIGHT
+ */
+ void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane);
+
+ /**
+ * Returns the information regarding the currently configured pane (split or freeze).
+ * @return null if no pane configured, or the pane information.
+ */
+ PaneInformation getPaneInformation();
+
+ /**
+ * Sets whether the gridlines are shown in a viewer.
+ * @param show whether to show gridlines or not
+ */
+ void setDisplayGridlines(boolean show);
+
+ /**
+ * Returns if gridlines are displayed.
+ * @return whether gridlines are displayed
+ */
+ boolean isDisplayGridlines();
+
+ /**
+ * Sets whether the formulas are shown in a viewer.
+ * @param show whether to show formulas or not
+ */
+ void setDisplayFormulas(boolean show);
+
+ /**
+ * Returns if formulas are displayed.
+ * @return whether formulas are displayed
+ */
+ boolean isDisplayFormulas();
+
+ /**
+ * Sets whether the RowColHeadings are shown in a viewer.
+ * @param show whether to show RowColHeadings or not
+ */
+ void setDisplayRowColHeadings(boolean show);
+
+ /**
+ * Returns if RowColHeadings are displayed.
+ * @return whether RowColHeadings are displayed
+ */
+ boolean isDisplayRowColHeadings();
+
+ /**
+ * Sets a page break at the indicated row
+ * @param row FIXME: Document this!
+ */
+ void setRowBreak(int row);
+
+ /**
+ * Determines if there is a page break at the indicated row
+ * @param row FIXME: Document this!
+ * @return FIXME: Document this!
+ */
+ boolean isRowBroken(int row);
+
+ /**
+ * Removes the page break at the indicated row
+ * @param row
+ */
+ void removeRowBreak(int row);
+
+ /**
+ * Retrieves all the horizontal page breaks
+ * @return all the horizontal page breaks, or null if there are no row page breaks
+ */
+ int[] getRowBreaks();
+
+ /**
+ * Retrieves all the vertical page breaks
+ * @return all the vertical page breaks, or null if there are no column page breaks
+ */
+ short[] getColumnBreaks();
+
+ /**
+ * Sets a page break at the indicated column
+ * @param column
+ */
+ void setColumnBreak(short column);
+
+ /**
+ * Determines if there is a page break at the indicated column
+ * @param column FIXME: Document this!
+ * @return FIXME: Document this!
+ */
+ boolean isColumnBroken(short column);
+
+ /**
+ * Removes a page break at the indicated column
+ * @param column
+ */
+ void removeColumnBreak(short column);
+
+ /**
+ * Aggregates the drawing records and dumps the escher record hierarchy
+ * to the standard output.
+ */
+ void dumpDrawingRecords(boolean fat);
+
+ /**
+ * Creates the toplevel drawing patriarch. This will have the effect of
+ * removing any existing drawings on this sheet.
+ *
+ * @return The new patriarch.
+ */
+ Patriarch createDrawingPatriarch();
+
+ /**
+ * Expands or collapses a column group.
+ *
+ * @param columnNumber One of the columns in the group.
+ * @param collapsed true = collapse group, false = expand group.
+ */
+ void setColumnGroupCollapsed(short columnNumber, boolean collapsed);
+
+ /**
+ * Create an outline for the provided column range.
+ *
+ * @param fromColumn beginning of the column range.
+ * @param toColumn end of the column range.
+ */
+ void groupColumn(short fromColumn, short toColumn);
+
+ void ungroupColumn(short fromColumn, short toColumn);
+
+ void groupRow(int fromRow, int toRow);
+
+ void ungroupRow(int fromRow, int toRow);
+
+ void setRowGroupCollapsed(int row, boolean collapse);
+
+ /**
+ * Sets the default column style for a given column. POI will only apply this style to new cells added to the sheet.
+ *
+ * @param column the column index
+ * @param style the style to set
+ */
+ void setDefaultColumnStyle(short column, CellStyle style);
+
+ /**
+ * Adjusts the column width to fit the contents.
+ *
+ * This process can be relatively slow on large sheets, so this should
+ * normally only be called once per column, at the end of your
+ * processing.
+ *
+ * @param column the column index
+ */
+ void autoSizeColumn(short column);
+
+ /**
+ * Returns cell comment for the specified row and column
+ *
+ * @return cell comment or <code>null</code> if not found
+ */
+ Comment getCellComment(int row, int column);
+
+}
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+public interface Textbox {
+
+ public final static short OBJECT_TYPE_TEXT = 6;
+
+ /**
+ * @return the rich text string for this textbox.
+ */
+ RichTextString getString();
+
+ /**
+ * @param string Sets the rich text string used by this object.
+ */
+ void setString(RichTextString string);
+
+ /**
+ * @return Returns the left margin within the textbox.
+ */
+ int getMarginLeft();
+
+ /**
+ * Sets the left margin within the textbox.
+ */
+ void setMarginLeft(int marginLeft);
+
+ /**
+ * @return returns the right margin within the textbox.
+ */
+ int getMarginRight();
+
+ /**
+ * Sets the right margin within the textbox.
+ */
+ void setMarginRight(int marginRight);
+
+ /**
+ * @return returns the top margin within the textbox.
+ */
+ int getMarginTop();
+
+ /**
+ * Sets the top margin within the textbox.
+ */
+ void setMarginTop(int marginTop);
+
+ /**
+ * Gets the bottom margin within the textbox.
+ */
+ int getMarginBottom();
+
+ /**
+ * Sets the bottom margin within the textbox.
+ */
+ void setMarginBottom(int marginBottom);
+
+}
\ No newline at end of file
--- /dev/null
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi.ss.usermodel;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+public interface Workbook {
+
+ /**
+ * used for compile-time performance/memory optimization. This determines the
+ * initial capacity for the sheet collection. Its currently set to 3.
+ * Changing it in this release will decrease performance
+ * since you're never allowed to have more or less than three sheets!
+ */
+
+ public final static int INITIAL_CAPACITY = 3;
+
+ /** Extended windows meta file */
+ public static final int PICTURE_TYPE_EMF = 2;
+
+ /** Windows Meta File */
+ public static final int PICTURE_TYPE_WMF = 3;
+
+ /** Mac PICT format */
+ public static final int PICTURE_TYPE_PICT = 4;
+
+ /** JPEG format */
+ public static final int PICTURE_TYPE_JPEG = 5;
+
+ /** PNG format */
+ public static final int PICTURE_TYPE_PNG = 6;
+
+ /** Device independant bitmap */
+ public static final int PICTURE_TYPE_DIB = 7;
+
+ /**
+ * sets the order of appearance for a given sheet.
+ *
+ * @param sheetname the name of the sheet to reorder
+ * @param pos the position that we want to insert the sheet into (0 based)
+ */
+
+ void setSheetOrder(String sheetname, int pos);
+
+ /**
+ * sets the tab whose data is actually seen when the sheet is opened.
+ * This may be different from the "selected sheet" since excel seems to
+ * allow you to show the data of one sheet when another is seen "selected"
+ * in the tabs (at the bottom).
+ * @see org.apache.poi.hssf.usermodel.HSSFSheet#setSelected(boolean)
+ * @param index
+ */
+ void setSelectedTab(short index);
+
+ /**
+ * gets the tab whose data is actually seen when the sheet is opened.
+ * This may be different from the "selected sheet" since excel seems to
+ * allow you to show the data of one sheet when another is seen "selected"
+ * in the tabs (at the bottom).
+ * @see org.apache.poi.hssf.usermodel.HSSFSheet#setSelected(boolean)
+ */
+ short getSelectedTab();
+
+ /**
+ * sets the first tab that is displayed in the list of tabs
+ * in excel.
+ * @param index
+ */
+ void setDisplayedTab(short index);
+
+ /**
+ * sets the first tab that is displayed in the list of tabs
+ * in excel.
+ */
+ short getDisplayedTab();
+
+ /**
+ * @deprecated POI will now properly handle unicode strings without
+ * forceing an encoding
+ */
+ public final static byte ENCODING_COMPRESSED_UNICODE = 0;
+
+ /**
+ * @deprecated POI will now properly handle unicode strings without
+ * forceing an encoding
+ */
+ public final static byte ENCODING_UTF_16 = 1;
+
+ /**
+ * set the sheet name.
+ * Will throw IllegalArgumentException if the name is greater than 31 chars
+ * or contains /\?*[]
+ * @param sheet number (0 based)
+ */
+ void setSheetName(int sheet, String name);
+
+ /**
+ * set the sheet name forcing the encoding. Forcing the encoding IS A BAD IDEA!!!
+ * @deprecated 3-Jan-2006 POI now automatically detects unicode and sets the encoding
+ * appropriately. Simply use setSheetName(int sheet, String encoding)
+ * @throws IllegalArgumentException if the name is greater than 31 chars
+ * or contains /\?*[]
+ * @param sheet number (0 based)
+ */
+ void setSheetName(int sheet, String name, short encoding);
+
+ /**
+ * get the sheet name
+ * @param sheet Number
+ * @return Sheet name
+ */
+
+ String getSheetName(int sheet);
+
+ /** Returns the index of the sheet by his name
+ * @param name the sheet name
+ * @return index of the sheet (0 based)
+ */
+ int getSheetIndex(String name);
+
+ /** Returns the index of the given sheet
+ * @param sheet the sheet to look up
+ * @return index of the sheet (0 based)
+ */
+ int getSheetIndex(Sheet sheet);
+
+ /**
+ * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
+ * the high level representation. Use this to create new sheets.
+ *
+ * @return HSSFSheet representing the new sheet.
+ */
+
+ Sheet createSheet();
+
+ /**
+ * create an HSSFSheet from an existing sheet in the HSSFWorkbook.
+ *
+ * @return HSSFSheet representing the cloned sheet.
+ */
+
+ Sheet cloneSheet(int sheetNum);
+
+ /**
+ * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
+ * the high level representation. Use this to create new sheets.
+ *
+ * @param sheetname sheetname to set for the sheet.
+ * @return HSSFSheet representing the new sheet.
+ */
+
+ Sheet createSheet(String sheetname);
+
+ /**
+ * get the number of spreadsheets in the workbook (this will be three after serialization)
+ * @return number of sheets
+ */
+
+ int getNumberOfSheets();
+
+ /**
+ * Get the HSSFSheet object at the given index.
+ * @param index of the sheet number (0-based physical & logical)
+ * @return HSSFSheet at the provided index
+ */
+
+ Sheet getSheetAt(int index);
+
+ /**
+ * Get sheet with the given name
+ * @param name of the sheet
+ * @return HSSFSheet with the name provided or null if it does not exist
+ */
+
+ Sheet getSheet(String name);
+
+ /**
+ * removes sheet at the given index
+ * @param index of the sheet (0-based)
+ */
+
+ void removeSheetAt(int index);
+
+ /**
+ * determine whether the Excel GUI will backup the workbook when saving.
+ *
+ * @param backupValue true to indicate a backup will be performed.
+ */
+
+ void setBackupFlag(boolean backupValue);
+
+ /**
+ * determine whether the Excel GUI will backup the workbook when saving.
+ *
+ * @return the current setting for backups.
+ */
+
+ boolean getBackupFlag();
+
+ /**
+ * Sets the repeating rows and columns for a sheet (as found in
+ * File->PageSetup->Sheet). This is function is included in the workbook
+ * because it creates/modifies name records which are stored at the
+ * workbook level.
+ * <p>
+ * To set just repeating columns:
+ * <pre>
+ * workbook.setRepeatingRowsAndColumns(0,0,1,-1-1);
+ * </pre>
+ * To set just repeating rows:
+ * <pre>
+ * workbook.setRepeatingRowsAndColumns(0,-1,-1,0,4);
+ * </pre>
+ * To remove all repeating rows and columns for a sheet.
+ * <pre>
+ * workbook.setRepeatingRowsAndColumns(0,-1,-1,-1,-1);
+ * </pre>
+ *
+ * @param sheetIndex 0 based index to sheet.
+ * @param startColumn 0 based start of repeating columns.
+ * @param endColumn 0 based end of repeating columns.
+ * @param startRow 0 based start of repeating rows.
+ * @param endRow 0 based end of repeating rows.
+ */
+ void setRepeatingRowsAndColumns(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow);
+
+ /**
+ * create a new Font and add it to the workbook's font table
+ * @return new font object
+ */
+
+ Font createFont();
+
+ /**
+ * Finds a font that matches the one with the supplied attributes
+ */
+ Font findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline);
+
+ /**
+ * get the number of fonts in the font table
+ * @return number of fonts
+ */
+
+ short getNumberOfFonts();
+
+ /**
+ * get the font at the given index number
+ * @param idx index number
+ * @return HSSFFont at the index
+ */
+
+ Font getFontAt(short idx);
+
+ /**
+ * create a new Cell style and add it to the workbook's style table
+ * @return the new Cell Style object
+ */
+
+ CellStyle createCellStyle();
+
+ /**
+ * get the number of styles the workbook contains
+ * @return count of cell styles
+ */
+
+ short getNumCellStyles();
+
+ /**
+ * get the cell style object at the given index
+ * @param idx index within the set of styles
+ * @return HSSFCellStyle object at the index
+ */
+
+ CellStyle getCellStyleAt(short idx);
+
+ /**
+ * Method write - write out this workbook to an Outputstream. Constructs
+ * a new POI POIFSFileSystem, passes in the workbook binary representation and
+ * writes it out.
+ *
+ * @param stream - the java OutputStream you wish to write the XLS to
+ *
+ * @exception IOException if anything can't be written.
+ * @see org.apache.poi.poifs.filesystem.POIFSFileSystem
+ */
+
+ void write(OutputStream stream) throws IOException;
+
+ /**
+ * Method getBytes - get the bytes of just the HSSF portions of the XLS file.
+ * Use this to construct a POI POIFSFileSystem yourself.
+ *
+ *
+ * @return byte[] array containing the binary representation of this workbook and all contained
+ * sheets, rows, cells, etc.
+ *
+ * @see org.apache.poi.hssf.model.Workbook
+ * @see org.apache.poi.hssf.model.Sheet
+ */
+
+ byte[] getBytes();
+
+ /** @deprecated Do not call this method from your applications. Use the methods
+ * available in the HSSFRow to add string HSSFCells
+ */
+ int addSSTString(String string);
+
+ /** @deprecated Do not call this method from your applications. Use the methods
+ * available in the HSSFRow to get string HSSFCells
+ */
+ String getSSTString(int index);
+
+ /** gets the total number of named ranges in the workboko
+ * @return number of named ranges
+ */
+ int getNumberOfNames();
+
+ /** gets the Named range
+ * @param index position of the named range
+ * @return named range high level
+ */
+ Name getNameAt(int index);
+
+ /** gets the named range name
+ * @param index the named range index (0 based)
+ * @return named range name
+ */
+ String getNameName(int index);
+
+ /**
+ * Sets the printarea for the sheet provided
+ * <p>
+ * i.e. Reference = $A$1:$B$2
+ * @param sheetIndex Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
+ * @param reference Valid name Reference for the Print Area
+ */
+ void setPrintArea(int sheetIndex, String reference);
+
+ /**
+ * For the Convenience of Java Programmers maintaining pointers.
+ * @see #setPrintArea(int, String)
+ * @param sheetIndex Zero-based sheet index (0 = First Sheet)
+ * @param startColumn Column to begin printarea
+ * @param endColumn Column to end the printarea
+ * @param startRow Row to begin the printarea
+ * @param endRow Row to end the printarea
+ */
+ void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow);
+
+ /**
+ * Retrieves the reference for the printarea of the specified sheet, the sheet name is appended to the reference even if it was not specified.
+ * @param sheetIndex Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
+ * @return String Null if no print area has been defined
+ */
+ String getPrintArea(int sheetIndex);
+
+ /**
+ * Delete the printarea for the sheet specified
+ * @param sheetIndex Zero-based sheet index (0 = First Sheet)
+ */
+ void removePrintArea(int sheetIndex);
+
+ /** creates a new named range and add it to the model
+ * @return named range high level
+ */
+ Name createName();
+
+ /** gets the named range index by his name
+ * <i>Note:</i>Excel named ranges are case-insensitive and
+ * this method performs a case-insensitive search.
+ *
+ * @param name named range name
+ * @return named range index
+ */
+ int getNameIndex(String name);
+
+ /** remove the named range by his index
+ * @param index named range index (0 based)
+ */
+ void removeName(int index);
+
+ /**
+ * Returns the instance of HSSFDataFormat for this workbook.
+ * @return the HSSFDataFormat object
+ * @see org.apache.poi.hssf.record.FormatRecord
+ * @see org.apache.poi.hssf.record.Record
+ */
+ DataFormat createDataFormat();
+
+ /** remove the named range by his name
+ * @param name named range name
+ */
+ void removeName(String name);
+
+ Palette getCustomPalette();
+
+ /** Test only. Do not use */
+ void insertChartRecord();
+
+ /**
+ * Spits out a list of all the drawing records in the workbook.
+ */
+ void dumpDrawingGroupRecords(boolean fat);
+
+ /**
+ * Adds a picture to the workbook.
+ *
+ * @param pictureData The bytes of the picture
+ * @param format The format of the picture. One of <code>PICTURE_TYPE_*</code>
+ *
+ * @return the index to this picture (1 based).
+ */
+ int addPicture(byte[] pictureData, int format);
+
+ /**
+ * Gets all pictures from the Workbook.
+ *
+ * @return the list of pictures (a list of {@link HSSFPictureData} objects.)
+ */
+ List getAllPictures();
+
+ /**
+ * protect a workbook with a password (not encypted, just sets writeprotect
+ * flags and the password.
+ * @param password to set
+ */
+ void writeProtectWorkbook(String password, String username);
+
+ /**
+ * removes the write protect flag
+ */
+ void unwriteProtectWorkbook();
+
+ /**
+ * Gets all embedded OLE2 objects from the Workbook.
+ *
+ * @return the list of embedded objects (a list of {@link HSSFObjectData} objects.)
+ */
+ List getAllEmbeddedObjects();
+
+}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-import java.util.Calendar;
-import java.util.Date;
-
-
-public interface Cell {
-
- /**
- * Numeric Cell type (0)
- * @see #setCellType(int)
- * @see #getCellType()
- */
-
- public final static int CELL_TYPE_NUMERIC = 0;
-
- /**
- * String Cell type (1)
- * @see #setCellType(int)
- * @see #getCellType()
- */
-
- public final static int CELL_TYPE_STRING = 1;
-
- /**
- * Formula Cell type (2)
- * @see #setCellType(int)
- * @see #getCellType()
- */
-
- public final static int CELL_TYPE_FORMULA = 2;
-
- /**
- * Blank Cell type (3)
- * @see #setCellType(int)
- * @see #getCellType()
- */
-
- public final static int CELL_TYPE_BLANK = 3;
-
- /**
- * Boolean Cell type (4)
- * @see #setCellType(int)
- * @see #getCellType()
- */
-
- public final static int CELL_TYPE_BOOLEAN = 4;
-
- /**
- * Error Cell type (5)
- * @see #setCellType(int)
- * @see #getCellType()
- */
-
- public final static int CELL_TYPE_ERROR = 5;
-
- /**
- * set the cell's number within the row (0 based)
- * @param num short the cell number
- */
-
- void setCellNum(short num);
-
- /**
- * get the cell's number within the row
- * @return short reperesenting the column number (logical!)
- */
-
- short getCellNum();
-
- /**
- * set the cells type (numeric, formula or string)
- * @see #CELL_TYPE_NUMERIC
- * @see #CELL_TYPE_STRING
- * @see #CELL_TYPE_FORMULA
- * @see #CELL_TYPE_BLANK
- * @see #CELL_TYPE_BOOLEAN
- * @see #CELL_TYPE_ERROR
- */
-
- void setCellType(int cellType);
-
- /**
- * get the cells type (numeric, formula or string)
- * @see #CELL_TYPE_STRING
- * @see #CELL_TYPE_NUMERIC
- * @see #CELL_TYPE_FORMULA
- * @see #CELL_TYPE_BOOLEAN
- * @see #CELL_TYPE_ERROR
- */
-
- int getCellType();
-
- /**
- * set a numeric value for the cell
- *
- * @param value the numeric value to set this cell to. For formulas we'll set the
- * precalculated value, for numerics we'll set its value. For other types we
- * will change the cell to a numeric cell and set its value.
- */
- void setCellValue(double value);
-
- /**
- * set a date value for the cell. Excel treats dates as numeric so you will need to format the cell as
- * a date.
- *
- * @param value the date value to set this cell to. For formulas we'll set the
- * precalculated value, for numerics we'll set its value. For other types we
- * will change the cell to a numeric cell and set its value.
- */
- void setCellValue(Date value);
-
- /**
- * set a date value for the cell. Excel treats dates as numeric so you will need to format the cell as
- * a date.
- *
- * @param value the date value to set this cell to. For formulas we'll set the
- * precalculated value, for numerics we'll set its value. For othertypes we
- * will change the cell to a numeric cell and set its value.
- */
- void setCellValue(Calendar value);
-
- /**
- * set a string value for the cell. Please note that if you are using
- * full 16 bit unicode you should call <code>setEncoding()</code> first.
- *
- * @param value value to set the cell to. For formulas we'll set the formula
- * string, for String cells we'll set its value. For other types we will
- * change the cell to a string cell and set its value.
- * If value is null then we will change the cell to a Blank cell.
- */
-
- void setCellValue(RichTextString value);
-
- void setCellFormula(String formula);
-
- String getCellFormula();
-
- /**
- * get the value of the cell as a number. For strings we throw an exception.
- * For blank cells we return a 0.
- */
-
- double getNumericCellValue();
-
- /**
- * get the value of the cell as a date. For strings we throw an exception.
- * For blank cells we return a null.
- */
- Date getDateCellValue();
-
- /**
- * get the value of the cell as a string - for numeric cells we throw an exception.
- * For blank cells we return an empty string.
- * For formulaCells that are not string Formulas, we return empty String
- */
-
- RichTextString getRichStringCellValue();
-
- /**
- * set a boolean value for the cell
- *
- * @param value the boolean value to set this cell to. For formulas we'll set the
- * precalculated value, for booleans we'll set its value. For other types we
- * will change the cell to a boolean cell and set its value.
- */
-
- void setCellValue(boolean value);
-
- /**
- * set a error value for the cell
- *
- * @param value the error value to set this cell to. For formulas we'll set the
- * precalculated value ??? IS THIS RIGHT??? , for errors we'll set
- * its value. For other types we will change the cell to an error
- * cell and set its value.
- */
-
- void setCellErrorValue(byte value);
-
- /**
- * get the value of the cell as a boolean. For strings, numbers, and errors, we throw an exception.
- * For blank cells we return a false.
- */
-
- boolean getBooleanCellValue();
-
- /**
- * get the value of the cell as an error code. For strings, numbers, and booleans, we throw an exception.
- * For blank cells we return a 0.
- */
-
- byte getErrorCellValue();
-
- /**
- * set the style for the cell. The style should be an HSSFCellStyle created/retreived from
- * the HSSFWorkbook.
- *
- * @param style reference contained in the workbook
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#createCellStyle()
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getCellStyleAt(short)
- */
-
- void setCellStyle(CellStyle style);
-
- /**
- * get the style for the cell. This is a reference to a cell style contained in the workbook
- * object.
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getCellStyleAt(short)
- */
-
- CellStyle getCellStyle();
-
- /**
- * Sets this cell as the active cell for the worksheet
- */
- void setAsActiveCell();
-
- /**
- * Returns a string representation of the cell
- *
- * This method returns a simple representation,
- * anthing more complex should be in user code, with
- * knowledge of the semantics of the sheet being processed.
- *
- * Formula cells return the formula string,
- * rather than the formula result.
- * Dates are displayed in dd-MMM-yyyy format
- * Errors are displayed as #ERR<errIdx>
- */
- String toString();
-
- /**
- * Assign a comment to this cell
- *
- * @param comment comment associated with this cell
- */
- void setCellComment(Comment comment);
-
- /**
- * Returns comment associated with this cell
- *
- * @return comment associated with this cell
- */
- Comment getCellComment();
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface CellStyle {
-
- /**
- * general (normal) horizontal alignment
- */
-
- public final static short ALIGN_GENERAL = 0x0;
-
- /**
- * left-justified horizontal alignment
- */
-
- public final static short ALIGN_LEFT = 0x1;
-
- /**
- * center horizontal alignment
- */
-
- public final static short ALIGN_CENTER = 0x2;
-
- /**
- * right-justified horizontal alignment
- */
-
- public final static short ALIGN_RIGHT = 0x3;
-
- /**
- * fill? horizontal alignment
- */
-
- public final static short ALIGN_FILL = 0x4;
-
- /**
- * justified horizontal alignment
- */
-
- public final static short ALIGN_JUSTIFY = 0x5;
-
- /**
- * center-selection? horizontal alignment
- */
-
- public final static short ALIGN_CENTER_SELECTION = 0x6;
-
- /**
- * top-aligned vertical alignment
- */
-
- public final static short VERTICAL_TOP = 0x0;
-
- /**
- * center-aligned vertical alignment
- */
-
- public final static short VERTICAL_CENTER = 0x1;
-
- /**
- * bottom-aligned vertical alignment
- */
-
- public final static short VERTICAL_BOTTOM = 0x2;
-
- /**
- * vertically justified vertical alignment
- */
-
- public final static short VERTICAL_JUSTIFY = 0x3;
-
- /**
- * No border
- */
-
- public final static short BORDER_NONE = 0x0;
-
- /**
- * Thin border
- */
-
- public final static short BORDER_THIN = 0x1;
-
- /**
- * Medium border
- */
-
- public final static short BORDER_MEDIUM = 0x2;
-
- /**
- * dash border
- */
-
- public final static short BORDER_DASHED = 0x3;
-
- /**
- * dot border
- */
-
- public final static short BORDER_HAIR = 0x4;
-
- /**
- * Thick border
- */
-
- public final static short BORDER_THICK = 0x5;
-
- /**
- * double-line border
- */
-
- public final static short BORDER_DOUBLE = 0x6;
-
- /**
- * hair-line border
- */
-
- public final static short BORDER_DOTTED = 0x7;
-
- /**
- * Medium dashed border
- */
-
- public final static short BORDER_MEDIUM_DASHED = 0x8;
-
- /**
- * dash-dot border
- */
-
- public final static short BORDER_DASH_DOT = 0x9;
-
- /**
- * medium dash-dot border
- */
-
- public final static short BORDER_MEDIUM_DASH_DOT = 0xA;
-
- /**
- * dash-dot-dot border
- */
-
- public final static short BORDER_DASH_DOT_DOT = 0xB;
-
- /**
- * medium dash-dot-dot border
- */
-
- public final static short BORDER_MEDIUM_DASH_DOT_DOT = 0xC;
-
- /**
- * slanted dash-dot border
- */
-
- public final static short BORDER_SLANTED_DASH_DOT = 0xD;
-
- /** No background */
- public final static short NO_FILL = 0;
-
- /** Solidly filled */
- public final static short SOLID_FOREGROUND = 1;
-
- /** Small fine dots */
- public final static short FINE_DOTS = 2;
-
- /** Wide dots */
- public final static short ALT_BARS = 3;
-
- /** Sparse dots */
- public final static short SPARSE_DOTS = 4;
-
- /** Thick horizontal bands */
- public final static short THICK_HORZ_BANDS = 5;
-
- /** Thick vertical bands */
- public final static short THICK_VERT_BANDS = 6;
-
- /** Thick backward facing diagonals */
- public final static short THICK_BACKWARD_DIAG = 7;
-
- /** Thick forward facing diagonals */
- public final static short THICK_FORWARD_DIAG = 8;
-
- /** Large spots */
- public final static short BIG_SPOTS = 9;
-
- /** Brick-like layout */
- public final static short BRICKS = 10;
-
- /** Thin horizontal bands */
- public final static short THIN_HORZ_BANDS = 11;
-
- /** Thin vertical bands */
- public final static short THIN_VERT_BANDS = 12;
-
- /** Thin backward diagonal */
- public final static short THIN_BACKWARD_DIAG = 13;
-
- /** Thin forward diagonal */
- public final static short THIN_FORWARD_DIAG = 14;
-
- /** Squares */
- public final static short SQUARES = 15;
-
- /** Diamonds */
- public final static short DIAMONDS = 16;
-
- /** Less Dots */
- public final static short LESS_DOTS = 17;
-
- /** Least Dots */
- public final static short LEAST_DOTS = 18;
-
- /**
- * get the index within the HSSFWorkbook (sequence within the collection of ExtnededFormat objects)
- * @return unique index number of the underlying record this style represents (probably you don't care
- * unless you're comparing which one is which)
- */
-
- short getIndex();
-
- /**
- * set the data format (must be a valid format)
- * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
- */
-
- void setDataFormat(short fmt);
-
- /**
- * get the index of the format
- * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
- */
-
- short getDataFormat();
-
- /**
- * Get the contents of the format string, by looking up
- * the DataFormat against the supplied workbook
- * @see org.apache.poi.hssf.usermodel.HSSFDataFormat
- * XXX Commented out because it uses internal implementation Workbook class.
- *
- String getDataFormatString(Workbook workbook);
- */
-
- /**
- * set the font for this style
- * @param font a font object created or retreived from the HSSFWorkbook object
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#createFont()
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
- */
-
- void setFont(Font font);
-
- /**
- * gets the index of the font for this style
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
- */
- short getFontIndex();
-
- /**
- * gets the font for this style
- * @param parentWorkbook The HSSFWorkbook that this style belongs to
- * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIndex()
- * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
- */
- Font getFont(Workbook parentWorkbook);
-
- /**
- * set the cell's using this style to be hidden
- * @param hidden - whether the cell using this style should be hidden
- */
-
- void setHidden(boolean hidden);
-
- /**
- * get whether the cell's using this style are to be hidden
- * @return hidden - whether the cell using this style should be hidden
- */
-
- boolean getHidden();
-
- /**
- * set the cell's using this style to be locked
- * @param locked - whether the cell using this style should be locked
- */
-
- void setLocked(boolean locked);
-
- /**
- * get whether the cell's using this style are to be locked
- * @return hidden - whether the cell using this style should be locked
- */
-
- boolean getLocked();
-
- /**
- * set the type of horizontal alignment for the cell
- * @param align - the type of alignment
- * @see #ALIGN_GENERAL
- * @see #ALIGN_LEFT
- * @see #ALIGN_CENTER
- * @see #ALIGN_RIGHT
- * @see #ALIGN_FILL
- * @see #ALIGN_JUSTIFY
- * @see #ALIGN_CENTER_SELECTION
- */
-
- void setAlignment(short align);
-
- /**
- * get the type of horizontal alignment for the cell
- * @return align - the type of alignment
- * @see #ALIGN_GENERAL
- * @see #ALIGN_LEFT
- * @see #ALIGN_CENTER
- * @see #ALIGN_RIGHT
- * @see #ALIGN_FILL
- * @see #ALIGN_JUSTIFY
- * @see #ALIGN_CENTER_SELECTION
- */
-
- short getAlignment();
-
- /**
- * set whether the text should be wrapped
- * @param wrapped wrap text or not
- */
-
- void setWrapText(boolean wrapped);
-
- /**
- * get whether the text should be wrapped
- * @return wrap text or not
- */
-
- boolean getWrapText();
-
- /**
- * set the type of vertical alignment for the cell
- * @param align the type of alignment
- * @see #VERTICAL_TOP
- * @see #VERTICAL_CENTER
- * @see #VERTICAL_BOTTOM
- * @see #VERTICAL_JUSTIFY
- */
-
- void setVerticalAlignment(short align);
-
- /**
- * get the type of vertical alignment for the cell
- * @return align the type of alignment
- * @see #VERTICAL_TOP
- * @see #VERTICAL_CENTER
- * @see #VERTICAL_BOTTOM
- * @see #VERTICAL_JUSTIFY
- */
-
- short getVerticalAlignment();
-
- /**
- * set the degree of rotation for the text in the cell
- * @param rotation degrees (between -90 and 90 degrees)
- */
-
- void setRotation(short rotation);
-
- /**
- * get the degree of rotation for the text in the cell
- * @return rotation degrees (between -90 and 90 degrees)
- */
-
- short getRotation();
-
- /**
- * set the number of spaces to indent the text in the cell
- * @param indent - number of spaces
- */
-
- void setIndention(short indent);
-
- /**
- * get the number of spaces to indent the text in the cell
- * @return indent - number of spaces
- */
-
- short getIndention();
-
- /**
- * set the type of border to use for the left border of the cell
- * @param border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- void setBorderLeft(short border);
-
- /**
- * get the type of border to use for the left border of the cell
- * @return border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- short getBorderLeft();
-
- /**
- * set the type of border to use for the right border of the cell
- * @param border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- void setBorderRight(short border);
-
- /**
- * get the type of border to use for the right border of the cell
- * @return border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- short getBorderRight();
-
- /**
- * set the type of border to use for the top border of the cell
- * @param border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- void setBorderTop(short border);
-
- /**
- * get the type of border to use for the top border of the cell
- * @return border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- short getBorderTop();
-
- /**
- * set the type of border to use for the bottom border of the cell
- * @param border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
-
- void setBorderBottom(short border);
-
- /**
- * get the type of border to use for the bottom border of the cell
- * @return border type
- * @see #BORDER_NONE
- * @see #BORDER_THIN
- * @see #BORDER_MEDIUM
- * @see #BORDER_DASHED
- * @see #BORDER_DOTTED
- * @see #BORDER_THICK
- * @see #BORDER_DOUBLE
- * @see #BORDER_HAIR
- * @see #BORDER_MEDIUM_DASHED
- * @see #BORDER_DASH_DOT
- * @see #BORDER_MEDIUM_DASH_DOT
- * @see #BORDER_DASH_DOT_DOT
- * @see #BORDER_MEDIUM_DASH_DOT_DOT
- * @see #BORDER_SLANTED_DASH_DOT
- */
- short getBorderBottom();
-
- /**
- * set the color to use for the left border
- * @param color The index of the color definition
- */
- void setLeftBorderColor(short color);
-
- /**
- * get the color to use for the left border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
- */
- short getLeftBorderColor();
-
- /**
- * set the color to use for the right border
- * @param color The index of the color definition
- */
- void setRightBorderColor(short color);
-
- /**
- * get the color to use for the left border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
- */
- short getRightBorderColor();
-
- /**
- * set the color to use for the top border
- * @param color The index of the color definition
- */
- void setTopBorderColor(short color);
-
- /**
- * get the color to use for the top border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
- */
- short getTopBorderColor();
-
- /**
- * set the color to use for the bottom border
- * @param color The index of the color definition
- */
- void setBottomBorderColor(short color);
-
- /**
- * get the color to use for the left border
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @param color The index of the color definition
- */
- short getBottomBorderColor();
-
- /**
- * setting to one fills the cell with the foreground color... No idea about
- * other values
- *
- * @see #NO_FILL
- * @see #SOLID_FOREGROUND
- * @see #FINE_DOTS
- * @see #ALT_BARS
- * @see #SPARSE_DOTS
- * @see #THICK_HORZ_BANDS
- * @see #THICK_VERT_BANDS
- * @see #THICK_BACKWARD_DIAG
- * @see #THICK_FORWARD_DIAG
- * @see #BIG_SPOTS
- * @see #BRICKS
- * @see #THIN_HORZ_BANDS
- * @see #THIN_VERT_BANDS
- * @see #THIN_BACKWARD_DIAG
- * @see #THIN_FORWARD_DIAG
- * @see #SQUARES
- * @see #DIAMONDS
- *
- * @param fp fill pattern (set to 1 to fill w/foreground color)
- */
- void setFillPattern(short fp);
-
- /**
- * get the fill pattern (??) - set to 1 to fill with foreground color
- * @return fill pattern
- */
-
- short getFillPattern();
-
- /**
- * set the background fill color.
- * <p>
- * For example:
- * <pre>
- * cs.setFillPattern(HSSFCellStyle.FINE_DOTS );
- * cs.setFillBackgroundColor(new HSSFColor.RED().getIndex());
- * </pre>
- * optionally a Foreground and background fill can be applied:
- * <i>Note: Ensure Foreground color is set prior to background</i>
- * <pre>
- * cs.setFillPattern(HSSFCellStyle.FINE_DOTS );
- * cs.setFillForegroundColor(new HSSFColor.BLUE().getIndex());
- * cs.setFillBackgroundColor(new HSSFColor.RED().getIndex());
- * </pre>
- * or, for the special case of SOLID_FILL:
- * <pre>
- * cs.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND );
- * cs.setFillForegroundColor(new HSSFColor.RED().getIndex());
- * </pre>
- * It is necessary to set the fill style in order
- * for the color to be shown in the cell.
- *
- * @param bg color
- */
-
- void setFillBackgroundColor(short bg);
-
- /**
- * get the background fill color
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @return fill color
- */
- short getFillBackgroundColor();
-
- /**
- * set the foreground fill color
- * <i>Note: Ensure Foreground color is set prior to background color.</i>
- * @param bg color
- */
- void setFillForegroundColor(short bg);
-
- /**
- * get the foreground fill color
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- * @return fill color
- */
- short getFillForegroundColor();
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface Color {
-
- /**
- * @return index to the standard palette
- */
-
- short getIndex();
-
- /**
- * @return triplet representation like that in Excel
- */
-
- short[] getTriplet();
-
- /**
- * @return a hex string exactly like a gnumeric triplet
- */
-
- String getHexString();
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-
-public interface Comment {
-
- /**
- * Returns whether this comment is visible.
- *
- * @param visible <code>true</code> if the comment is visible, <code>false</code> otherwise
- */
- void setVisible(boolean visible);
-
- /**
- * Sets whether this comment is visible.
- *
- * @return <code>true</code> if the comment is visible, <code>false</code> otherwise
- */
- boolean isVisible();
-
- /**
- * Return the row of the cell that contains the comment
- *
- * @return the 0-based row of the cell that contains the comment
- */
- int getRow();
-
- /**
- * Set the row of the cell that contains the comment
- *
- * @param row the 0-based row of the cell that contains the comment
- */
- void setRow(int row);
-
- /**
- * Return the column of the cell that contains the comment
- *
- * @return the 0-based column of the cell that contains the comment
- */
- short getColumn();
-
- /**
- * Set the column of the cell that contains the comment
- *
- * @param col the 0-based column of the cell that contains the comment
- */
- void setColumn(short col);
-
- /**
- * Name of the original comment author
- *
- * @return the name of the original author of the comment
- */
- String getAuthor();
-
- /**
- * Name of the original comment author
- *
- * @param author the name of the original author of the comment
- */
- void setAuthor(String author);
-
- /**
- * Sets the rich text string used by this comment.
- *
- * @param string Sets the rich text string used by this object.
- */
- void setString(RichTextString string);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface DataFormat {
-
- /**
- * get the format index that matches the given format string.
- * Creates a new format if one is not found. Aliases text to the proper format.
- * @param format string matching a built in format
- * @return index of format.
- */
-
- short getFormat(String format);
-
- /**
- * get the format string that matches the given format index
- * @param index of a format
- * @return string represented at index of format or null if there is not a format at that index
- */
-
- String getFormat(short index);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-
-public interface Font {
-
- /**
- * Arial font
- */
-
- public final static String FONT_ARIAL = "Arial";
-
- /**
- * Normal boldness (not bold)
- */
-
- public final static short BOLDWEIGHT_NORMAL = 0x190;
-
- /**
- * Bold boldness (bold)
- */
-
- public final static short BOLDWEIGHT_BOLD = 0x2bc;
-
- /**
- * normal type of black color.
- */
-
- public final static short COLOR_NORMAL = 0x7fff;
-
- /**
- * Dark Red color
- */
-
- public final static short COLOR_RED = 0xa;
-
- /**
- * no type offsetting (not super or subscript)
- */
-
- public final static short SS_NONE = 0;
-
- /**
- * superscript
- */
-
- public final static short SS_SUPER = 1;
-
- /**
- * subscript
- */
-
- public final static short SS_SUB = 2;
-
- /**
- * not underlined
- */
-
- public final static byte U_NONE = 0;
-
- /**
- * single (normal) underline
- */
-
- public final static byte U_SINGLE = 1;
-
- /**
- * double underlined
- */
-
- public final static byte U_DOUBLE = 2;
-
- /**
- * accounting style single underline
- */
-
- public final static byte U_SINGLE_ACCOUNTING = 0x21;
-
- /**
- * accounting style double underline
- */
-
- public final static byte U_DOUBLE_ACCOUNTING = 0x22;
-
- /**
- * ANSI character set
- */
- public final static byte ANSI_CHARSET = 0;
-
- /**
- * Default character set.
- */
- public final static byte DEFAULT_CHARSET = 1;
-
- /**
- * Symbol character set
- */
- public final static byte SYMBOL_CHARSET = 2;
-
- /**
- * set the name for the font (i.e. Arial)
- * @param name String representing the name of the font to use
- * @see #FONT_ARIAL
- */
-
- void setFontName(String name);
-
- /**
- * get the name for the font (i.e. Arial)
- * @return String representing the name of the font to use
- * @see #FONT_ARIAL
- */
-
- String getFontName();
-
- /**
- * get the index within the HSSFWorkbook (sequence within the collection of Font objects)
- * @return unique index number of the underlying record this Font represents (probably you don't care
- * unless you're comparing which one is which)
- */
-
- short getIndex();
-
- /**
- * set the font height in unit's of 1/20th of a point. Maybe you might want to
- * use the setFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
- * @param height height in 1/20ths of a point
- * @see #setFontHeightInPoints(short)
- */
-
- void setFontHeight(short height);
-
- /**
- * set the font height
- * @param height height in the familiar unit of measure - points
- * @see #setFontHeight(short)
- */
-
- void setFontHeightInPoints(short height);
-
- /**
- * get the font height in unit's of 1/20th of a point. Maybe you might want to
- * use the getFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
- * @return short - height in 1/20ths of a point
- * @see #getFontHeightInPoints()
- */
-
- short getFontHeight();
-
- /**
- * get the font height
- * @return short - height in the familiar unit of measure - points
- * @see #getFontHeight()
- */
-
- short getFontHeightInPoints();
-
- /**
- * set whether to use italics or not
- * @param italic italics or not
- */
-
- void setItalic(boolean italic);
-
- /**
- * get whether to use italics or not
- * @return italics or not
- */
-
- boolean getItalic();
-
- /**
- * set whether to use a strikeout horizontal line through the text or not
- * @param strikeout or not
- */
-
- void setStrikeout(boolean strikeout);
-
- /**
- * get whether to use a strikeout horizontal line through the text or not
- * @return strikeout or not
- */
-
- boolean getStrikeout();
-
- /**
- * set the color for the font
- * @param color to use
- * @see #COLOR_NORMAL Note: Use this rather than HSSFColor.AUTOMATIC for default font color
- * @see #COLOR_RED
- */
-
- void setColor(short color);
-
- /**
- * get the color for the font
- * @return color to use
- * @see #COLOR_NORMAL
- * @see #COLOR_RED
- * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short)
- */
- short getColor();
-
- /**
- * set the boldness to use
- * @param boldweight
- * @see #BOLDWEIGHT_NORMAL
- * @see #BOLDWEIGHT_BOLD
- */
-
- void setBoldweight(short boldweight);
-
- /**
- * get the boldness to use
- * @return boldweight
- * @see #BOLDWEIGHT_NORMAL
- * @see #BOLDWEIGHT_BOLD
- */
-
- short getBoldweight();
-
- /**
- * set normal,super or subscript.
- * @param offset type to use (none,super,sub)
- * @see #SS_NONE
- * @see #SS_SUPER
- * @see #SS_SUB
- */
-
- void setTypeOffset(short offset);
-
- /**
- * get normal,super or subscript.
- * @return offset type to use (none,super,sub)
- * @see #SS_NONE
- * @see #SS_SUPER
- * @see #SS_SUB
- */
-
- short getTypeOffset();
-
- /**
- * set type of text underlining to use
- * @param underline type
- * @see #U_NONE
- * @see #U_SINGLE
- * @see #U_DOUBLE
- * @see #U_SINGLE_ACCOUNTING
- * @see #U_DOUBLE_ACCOUNTING
- */
-
- void setUnderline(byte underline);
-
- /**
- * get type of text underlining to use
- * @return underlining type
- * @see #U_NONE
- * @see #U_SINGLE
- * @see #U_DOUBLE
- * @see #U_SINGLE_ACCOUNTING
- * @see #U_DOUBLE_ACCOUNTING
- */
-
- byte getUnderline();
-
- /**
- * get character-set to use.
- * @return character-set
- * @see #ANSI_CHARSET
- * @see #DEFAULT_CHARSET
- * @see #SYMBOL_CHARSET
- */
- byte getCharSet();
-
- /**
- * set character-set to use.
- * @see #ANSI_CHARSET
- * @see #DEFAULT_CHARSET
- * @see #SYMBOL_CHARSET
- */
- void setCharSet(byte charset);
-
- String toString();
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface Footer {
-
- /**
- * Get the left side of the footer.
- * @return The string representing the left side.
- */
- String getLeft();
-
- /**
- * Sets the left string.
- * @param newLeft The string to set as the left side.
- */
- void setLeft(String newLeft);
-
- /**
- * Get the center of the footer.
- * @return The string representing the center.
- */
- String getCenter();
-
- /**
- * Sets the center string.
- * @param newCenter The string to set as the center.
- */
- void setCenter(String newCenter);
-
- /**
- * Get the right side of the footer.
- * @return The string representing the right side.
- */
- String getRight();
-
- /**
- * Sets the right string.
- * @param newRight The string to set as the right side.
- */
- void setRight(String newRight);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface Header {
-
- /**
- * Get the left side of the header.
- *
- * @return The string representing the left side.
- */
- String getLeft();
-
- /**
- * Sets the left string.
- *
- * @param newLeft The string to set as the left side.
- */
- void setLeft(String newLeft);
-
- /**
- * Get the center of the header.
- *
- * @return The string representing the center.
- */
- String getCenter();
-
- /**
- * Sets the center string.
- *
- * @param newCenter The string to set as the center.
- */
- void setCenter(String newCenter);
-
- /**
- * Get the right side of the header.
- *
- * @return The string representing the right side.
- */
- String getRight();
-
- /**
- * Sets the right string.
- *
- * @param newRight The string to set as the right side.
- */
- void setRight(String newRight);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface Name {
-
- /** Get the sheets name which this named range is referenced to
- * @return sheet name, which this named range refered to
- */
-
- String getSheetName();
-
- /**
- * gets the name of the named range
- * @return named range name
- */
-
- String getNameName();
-
- /**
- * sets the name of the named range
- * @param nameName named range name to set
- */
-
- void setNameName(String nameName);
-
- /**
- * gets the reference of the named range
- * @return reference of the named range
- */
-
- String getReference();
-
- /**
- * sets the reference of this named range
- * @param ref the reference to set
- */
-
- void setReference(String ref);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface Palette {
-
- /**
- * Retrieves the color at a given index
- *
- * @param index the palette index, between 0x8 to 0x40 inclusive
- * @return the color, or null if the index is not populated
- */
- Color getColor(short index);
-
- /**
- * Finds the first occurance of a given color
- *
- * @param red the RGB red component, between 0 and 255 inclusive
- * @param green the RGB green component, between 0 and 255 inclusive
- * @param blue the RGB blue component, between 0 and 255 inclusive
- * @return the color, or null if the color does not exist in this palette
- */
- Color findColor(byte red, byte green, byte blue);
-
- /**
- * Finds the closest matching color in the custom palette. The
- * method for finding the distance between the colors is fairly
- * primative.
- *
- * @param red The red component of the color to match.
- * @param green The green component of the color to match.
- * @param blue The blue component of the color to match.
- * @return The closest color or null if there are no custom
- * colors currently defined.
- */
- Color findSimilarColor(byte red, byte green, byte blue);
-
- /**
- * Sets the color at the given offset
- *
- * @param index the palette index, between 0x8 to 0x40 inclusive
- * @param red the RGB red component, between 0 and 255 inclusive
- * @param green the RGB green component, between 0 and 255 inclusive
- * @param blue the RGB blue component, between 0 and 255 inclusive
- */
- void setColorAtIndex(short index, byte red, byte green, byte blue);
-
- /**
- * Adds a new color into an empty color slot.
- * @param red The red component
- * @param green The green component
- * @param blue The blue component
- *
- * @return The new custom color.
- *
- * @throws RuntimeException if there are more more free color indexes.
- */
- Color addColor(byte red, byte green, byte blue);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-import java.util.List;
-
-import org.apache.poi.hssf.usermodel.HSSFAnchor;
-import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
-import org.apache.poi.hssf.usermodel.HSSFComment;
-import org.apache.poi.hssf.usermodel.HSSFPicture;
-import org.apache.poi.hssf.usermodel.HSSFPolygon;
-import org.apache.poi.hssf.usermodel.HSSFShapeGroup;
-import org.apache.poi.hssf.usermodel.HSSFSimpleShape;
-import org.apache.poi.hssf.usermodel.HSSFTextbox;
-
-public interface Patriarch {
-
- /**
- * Creates a new group record stored under this patriarch.
- *
- * @param anchor the client anchor describes how this group is attached
- * to the sheet.
- * @return the newly created group.
- */
- HSSFShapeGroup createGroup(HSSFClientAnchor anchor);
-
- /**
- * Creates a simple shape. This includes such shapes as lines, rectangles,
- * and ovals.
- *
- * @param anchor the client anchor describes how this group is attached
- * to the sheet.
- * @return the newly created shape.
- */
- HSSFSimpleShape createSimpleShape(HSSFClientAnchor anchor);
-
- /**
- * Creates a picture.
- *
- * @param anchor the client anchor describes how this group is attached
- * to the sheet.
- * @return the newly created shape.
- */
- HSSFPicture createPicture(HSSFClientAnchor anchor, int pictureIndex);
-
- /**
- * Creates a polygon
- *
- * @param anchor the client anchor describes how this group is attached
- * to the sheet.
- * @return the newly created shape.
- */
- HSSFPolygon createPolygon(HSSFClientAnchor anchor);
-
- /**
- * Constructs a textbox under the patriarch.
- *
- * @param anchor the client anchor describes how this group is attached
- * to the sheet.
- * @return the newly created textbox.
- */
- HSSFTextbox createTextbox(HSSFClientAnchor anchor);
-
- /**
- * Constructs a cell comment.
- *
- * @param anchor the client anchor describes how this comment is attached
- * to the sheet.
- * @return the newly created comment.
- */
- HSSFComment createComment(HSSFAnchor anchor);
-
- /**
- * Returns a list of all shapes contained by the patriarch.
- */
- List getChildren();
-
- /**
- * Total count of all children and their children's children.
- */
- int countOfAllChildren();
-
- /**
- * Sets the coordinate space of this group. All children are contrained
- * to these coordinates.
- */
- void setCoordinates(int x1, int y1, int x2, int y2);
-
- /**
- * The top left x coordinate of this group.
- */
- int getX1();
-
- /**
- * The top left y coordinate of this group.
- */
- int getY1();
-
- /**
- * The bottom right x coordinate of this group.
- */
- int getX2();
-
- /**
- * The bottom right y coordinate of this group.
- */
- int getY2();
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface PrintSetup {
-
- public static final short LETTER_PAPERSIZE = 1;
-
- public static final short LEGAL_PAPERSIZE = 5;
-
- public static final short EXECUTIVE_PAPERSIZE = 7;
-
- public static final short A4_PAPERSIZE = 9;
-
- public static final short A5_PAPERSIZE = 11;
-
- public static final short ENVELOPE_10_PAPERSIZE = 20;
-
- public static final short ENVELOPE_DL_PAPERSIZE = 27;
-
- public static final short ENVELOPE_CS_PAPERSIZE = 28;
-
- public static final short ENVELOPE_MONARCH_PAPERSIZE = 37;
-
- /**
- * Set the paper size.
- * @param size the paper size.
- */
- void setPaperSize(short size);
-
- /**
- * Set the scale.
- * @param scale the scale to use
- */
- void setScale(short scale);
-
- /**
- * Set the page numbering start.
- * @param start the page numbering start
- */
- void setPageStart(short start);
-
- /**
- * Set the number of pages wide to fit the sheet in
- * @param width the number of pages
- */
- void setFitWidth(short width);
-
- /**
- * Set the number of pages high to fit the sheet in
- * @param height the number of pages
- */
- void setFitHeight(short height);
-
- /**
- * Sets the options flags. Not advisable to do it directly.
- * @param options The bit flags for the options
- */
- void setOptions(short options);
-
- /**
- * Set whether to go left to right or top down in ordering
- * @param ltor left to right
- */
- void setLeftToRight(boolean ltor);
-
- /**
- * Set whether to print in landscape
- * @param ls landscape
- */
- void setLandscape(boolean ls);
-
- /**
- * Valid settings. I'm not for sure.
- * @param valid Valid
- */
- void setValidSettings(boolean valid);
-
- /**
- * Set whether it is black and white
- * @param mono Black and white
- */
- void setNoColor(boolean mono);
-
- /**
- * Set whether it is in draft mode
- * @param d draft
- */
- void setDraft(boolean d);
-
- /**
- * Print the include notes
- * @param printnotes print the notes
- */
- void setNotes(boolean printnotes);
-
- /**
- * Set no orientation. ?
- * @param orientation Orientation.
- */
- void setNoOrientation(boolean orientation);
-
- /**
- * Set whether to use page start
- * @param page Use page start
- */
- void setUsePage(boolean page);
-
- /**
- * Sets the horizontal resolution.
- * @param resolution horizontal resolution
- */
- void setHResolution(short resolution);
-
- /**
- * Sets the vertical resolution.
- * @param resolution vertical resolution
- */
- void setVResolution(short resolution);
-
- /**
- * Sets the header margin.
- * @param headermargin header margin
- */
- void setHeaderMargin(double headermargin);
-
- /**
- * Sets the footer margin.
- * @param footermargin footer margin
- */
- void setFooterMargin(double footermargin);
-
- /**
- * Sets the number of copies.
- * @param copies number of copies
- */
- void setCopies(short copies);
-
- /**
- * Returns the paper size.
- * @return paper size
- */
- short getPaperSize();
-
- /**
- * Returns the scale.
- * @return scale
- */
- short getScale();
-
- /**
- * Returns the page start.
- * @return page start
- */
- short getPageStart();
-
- /**
- * Returns the number of pages wide to fit sheet in.
- * @return number of pages wide to fit sheet in
- */
- short getFitWidth();
-
- /**
- * Returns the number of pages high to fit the sheet in.
- * @return number of pages high to fit the sheet in
- */
- short getFitHeight();
-
- /**
- * Returns the bit flags for the options.
- * @return bit flags for the options
- */
- short getOptions();
-
- /**
- * Returns the left to right print order.
- * @return left to right print order
- */
- boolean getLeftToRight();
-
- /**
- * Returns the landscape mode.
- * @return landscape mode
- */
- boolean getLandscape();
-
- /**
- * Returns the valid settings.
- * @return valid settings
- */
- boolean getValidSettings();
-
- /**
- * Returns the black and white setting.
- * @return black and white setting
- */
- boolean getNoColor();
-
- /**
- * Returns the draft mode.
- * @return draft mode
- */
- boolean getDraft();
-
- /**
- * Returns the print notes.
- * @return print notes
- */
- boolean getNotes();
-
- /**
- * Returns the no orientation.
- * @return no orientation
- */
- boolean getNoOrientation();
-
- /**
- * Returns the use page numbers.
- * @return use page numbers
- */
- boolean getUsePage();
-
- /**
- * Returns the horizontal resolution.
- * @return horizontal resolution
- */
- short getHResolution();
-
- /**
- * Returns the vertical resolution.
- * @return vertical resolution
- */
- short getVResolution();
-
- /**
- * Returns the header margin.
- * @return header margin
- */
- double getHeaderMargin();
-
- /**
- * Returns the footer margin.
- * @return footer margin
- */
- double getFooterMargin();
-
- /**
- * Returns the number of copies.
- * @return number of copies
- */
- short getCopies();
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-
-public interface RichTextString {
-
- /** Place holder for indicating that NO_FONT has been applied here */
- public static final short NO_FONT = 0;
-
- /**
- * Applies a font to the specified characters of a string.
- *
- * @param startIndex The start index to apply the font to (inclusive)
- * @param endIndex The end index to apply the font to (exclusive)
- * @param fontIndex The font to use.
- */
- void applyFont(int startIndex, int endIndex, short fontIndex);
-
- /**
- * Applies a font to the specified characters of a string.
- *
- * @param startIndex The start index to apply the font to (inclusive)
- * @param endIndex The end index to apply to font to (exclusive)
- * @param font The index of the font to use.
- */
- void applyFont(int startIndex, int endIndex, Font font);
-
- /**
- * Sets the font of the entire string.
- * @param font The font to use.
- */
- void applyFont(Font font);
-
- /**
- * Removes any formatting that may have been applied to the string.
- */
- void clearFormatting();
-
- /**
- * Returns the plain string representation.
- */
- String getString();
-
- /**
- * @return the number of characters in the font.
- */
- int length();
-
- /**
- * Returns the font in use at a particular index.
- *
- * @param index The index.
- * @return The font that's currently being applied at that
- * index or null if no font is being applied or the
- * index is out of range.
- */
- short getFontAtIndex(int index);
-
- /**
- * @return The number of formatting runs used. There will always be at
- * least one of font NO_FONT.
- *
- * @see #NO_FONT
- */
- int numFormattingRuns();
-
- /**
- * The index within the string to which the specified formatting run applies.
- * @param index the index of the formatting run
- * @return the index within the string.
- */
- int getIndexOfFormattingRun(int index);
-
- /**
- * Gets the font used in a particular formatting run.
- *
- * @param index the index of the formatting run
- * @return the font number used.
- */
- short getFontOfFormattingRun(int index);
-
- /**
- * Compares one rich text string to another.
- */
- int compareTo(Object o);
-
- boolean equals(Object o);
-
- /**
- * @return the plain text representation of this string.
- */
- String toString();
-
- /**
- * Applies the specified font to the entire string.
- *
- * @param fontIndex the font to apply.
- */
- void applyFont(short fontIndex);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-import java.util.Iterator;
-
-public interface Row {
-
- // used for collections
- public final static int INITIAL_CAPACITY = 5;
-
- /**
- * Use this to create new cells within the row and return it.
- * <p>
- * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
- * either through calling <code>setCellValue</code> or <code>setCellType</code>.
- *
- * @param column - the column number this cell represents
- *
- * @return HSSFCell a high level representation of the created cell.
- */
-
- Cell createCell(short column);
-
- /**
- * Use this to create new cells within the row and return it.
- * <p>
- * The cell that is returned is a CELL_TYPE_BLANK. The type can be changed
- * either through calling setCellValue or setCellType.
- *
- * @param column - the column number this cell represents
- *
- * @return HSSFCell a high level representation of the created cell.
- */
-
- Cell createCell(short column, int type);
-
- /**
- * remove the HSSFCell from this row.
- * @param cell to remove
- */
- void removeCell(Cell cell);
-
- /**
- * set the row number of this row.
- * @param rowNum the row number (0-based)
- * @throws IndexOutOfBoundsException if the row number is not within the range 0-65535.
- */
-
- void setRowNum(int rowNum);
-
- /**
- * get row number this row represents
- * @return the row number (0 based)
- */
-
- int getRowNum();
-
- /**
- * get the hssfcell representing a given column (logical cell) 0-based. If you
- * ask for a cell that is not defined....you get a null.
- *
- * @param cellnum 0 based column number
- * @return HSSFCell representing that column or null if undefined.
- */
-
- Cell getCell(short cellnum);
-
- /**
- * get the number of the first cell contained in this row.
- * @return short representing the first logical cell in the row, or -1 if the row does not contain any cells.
- */
-
- short getFirstCellNum();
-
- /**
- * gets the number of the last cell contained in this row <b>PLUS ONE</b>.
- * @return short representing the last logical cell in the row <b>PLUS ONE</b>, or -1 if the row does not contain any cells.
- */
-
- short getLastCellNum();
-
- /**
- * gets the number of defined cells (NOT number of cells in the actual row!).
- * That is to say if only columns 0,4,5 have values then there would be 3.
- * @return int representing the number of defined cells in the row.
- */
-
- int getPhysicalNumberOfCells();
-
- /**
- * set the row's height or set to ff (-1) for undefined/default-height. Set the height in "twips" or
- * 1/20th of a point.
- * @param height rowheight or 0xff for undefined (use sheet default)
- */
-
- void setHeight(short height);
-
- /**
- * set whether or not to display this row with 0 height
- * @param zHeight height is zero or not.
- */
- void setZeroHeight(boolean zHeight);
-
- /**
- * get whether or not to display this row with 0 height
- * @return - zHeight height is zero or not.
- */
- boolean getZeroHeight();
-
- /**
- * set the row's height in points.
- * @param height row height in points
- */
-
- void setHeightInPoints(float height);
-
- /**
- * get the row's height or ff (-1) for undefined/default-height in twips (1/20th of a point)
- * @return rowheight or 0xff for undefined (use sheet default)
- */
-
- short getHeight();
-
- /**
- * get the row's height or ff (-1) for undefined/default-height in points (20*getHeight())
- * @return rowheight or 0xff for undefined (use sheet default)
- */
-
- float getHeightInPoints();
-
- /**
- * @return cell iterator of the physically defined cells. Note element 4 may
- * actually be row cell depending on how many are defined!
- */
-
- Iterator cellIterator();
-
- int compareTo(Object obj);
-
- boolean equals(Object obj);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-/**
- * Allows the getting and saving of shared strings
- */
-public interface SharedStringSource {
-
- /**
- * Return the string at position <code>idx</idx> (0-based) in this source.
- *
- * @param idx String position.
- * @return The string, or null if not found.
- */
- public String getSharedStringAt(int idx);
-
- /**
- * Store a string in this source.
- *
- * @param s The string to store.
- * @return The 0-based position of the newly added string.
- */
- public int putSharedString(String s);
-}
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-import java.util.Iterator;
-
-/* ====================================================================
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-==================================================================== */
-
-import org.apache.poi.hssf.util.PaneInformation;
-import org.apache.poi.hssf.util.Region;
-
-public interface Sheet {
-
- /* Constants for margins */
- public static final short LeftMargin = Sheet.LeftMargin;
-
- public static final short RightMargin = Sheet.RightMargin;
-
- public static final short TopMargin = Sheet.TopMargin;
-
- public static final short BottomMargin = Sheet.BottomMargin;
-
- public static final byte PANE_LOWER_RIGHT = (byte) 0;
-
- public static final byte PANE_UPPER_RIGHT = (byte) 1;
-
- public static final byte PANE_LOWER_LEFT = (byte) 2;
-
- public static final byte PANE_UPPER_LEFT = (byte) 3;
-
- /**
- * Used for compile-time optimization. This is the initial size for the collection of
- * rows. It is currently set to 20. If you generate larger sheets you may benefit
- * by setting this to a higher number and recompiling a custom edition of HSSFSheet.
- */
-
- public final static int INITIAL_CAPACITY = 20;
-
- /**
- * Create a new row within the sheet and return the high level representation
- *
- * @param rownum row number
- * @return High level HSSFRow object representing a row in the sheet
- * @see org.apache.poi.hssf.usermodel.HSSFRow
- * @see #removeRow(HSSFRow)
- */
- Row createRow(int rownum);
-
- /**
- * Remove a row from this sheet. All cells contained in the row are removed as well
- *
- * @param row representing a row to remove.
- */
-
- void removeRow(Row row);
-
- /**
- * Returns the logical row (not physical) 0-based. If you ask for a row that is not
- * defined you get a null. This is to say row 4 represents the fifth row on a sheet.
- * @param rownum row to get
- * @return HSSFRow representing the rownumber or null if its not defined on the sheet
- */
-
- Row getRow(int rownum);
-
- /**
- * Returns the number of phsyically defined rows (NOT the number of rows in the sheet)
- */
-
- int getPhysicalNumberOfRows();
-
- /**
- * gets the first row on the sheet
- * @return the number of the first logical row on the sheet
- */
-
- int getFirstRowNum();
-
- /**
- * gets the last row on the sheet
- * @return last row contained n this sheet.
- */
-
- int getLastRowNum();
-
- /**
- * Get the visibility state for a given column.
- * @param column - the column to get (0-based)
- * @param hidden - the visiblity state of the column
- */
-
- void setColumnHidden(short column, boolean hidden);
-
- /**
- * Get the hidden state for a given column.
- * @param column - the column to set (0-based)
- * @return hidden - the visiblity state of the column
- */
-
- boolean isColumnHidden(short column);
-
- /**
- * set the width (in units of 1/256th of a character width)
- * @param column - the column to set (0-based)
- * @param width - the width in units of 1/256th of a character width
- */
-
- void setColumnWidth(short column, short width);
-
- /**
- * get the width (in units of 1/256th of a character width )
- * @param column - the column to set (0-based)
- * @return width - the width in units of 1/256th of a character width
- */
-
- short getColumnWidth(short column);
-
- /**
- * get the default column width for the sheet (if the columns do not define their own width) in
- * characters
- * @return default column width
- */
-
- short getDefaultColumnWidth();
-
- /**
- * get the default row height for the sheet (if the rows do not define their own height) in
- * twips (1/20 of a point)
- * @return default row height
- */
-
- short getDefaultRowHeight();
-
- /**
- * get the default row height for the sheet (if the rows do not define their own height) in
- * points.
- * @return default row height in points
- */
-
- float getDefaultRowHeightInPoints();
-
- /**
- * set the default column width for the sheet (if the columns do not define their own width) in
- * characters
- * @param width default column width
- */
-
- void setDefaultColumnWidth(short width);
-
- /**
- * set the default row height for the sheet (if the rows do not define their own height) in
- * twips (1/20 of a point)
- * @param height default row height
- */
-
- void setDefaultRowHeight(short height);
-
- /**
- * set the default row height for the sheet (if the rows do not define their own height) in
- * points
- * @param height default row height
- */
-
- void setDefaultRowHeightInPoints(float height);
-
- /**
- * get whether gridlines are printed.
- * @return true if printed
- */
-
- boolean isGridsPrinted();
-
- /**
- * set whether gridlines printed.
- * @param value false if not printed.
- */
-
- void setGridsPrinted(boolean value);
-
- /**
- * adds a merged region of cells (hence those cells form one)
- * @param region (rowfrom/colfrom-rowto/colto) to merge
- * @return index of this region
- */
-
- int addMergedRegion(Region region);
-
- /**
- * determines whether the output is vertically centered on the page.
- * @param value true to vertically center, false otherwise.
- */
-
- void setVerticallyCenter(boolean value);
-
- /**
- * Determine whether printed output for this sheet will be vertically centered.
- */
-
- boolean getVerticallyCenter(boolean value);
-
- /**
- * determines whether the output is horizontally centered on the page.
- * @param value true to horizontally center, false otherwise.
- */
-
- void setHorizontallyCenter(boolean value);
-
- /**
- * Determine whether printed output for this sheet will be horizontally centered.
- */
-
- boolean getHorizontallyCenter();
-
- /**
- * removes a merged region of cells (hence letting them free)
- * @param index of the region to unmerge
- */
-
- void removeMergedRegion(int index);
-
- /**
- * returns the number of merged regions
- * @return number of merged regions
- */
-
- int getNumMergedRegions();
-
- /**
- * gets the region at a particular index
- * @param index of the region to fetch
- * @return the merged region (simple eh?)
- */
-
- Region getMergedRegionAt(int index);
-
- /**
- * @return an iterator of the PHYSICAL rows. Meaning the 3rd element may not
- * be the third row if say for instance the second row is undefined.
- */
-
- Iterator rowIterator();
-
- /**
- * whether alternate expression evaluation is on
- * @param b alternative expression evaluation or not
- */
-
- void setAlternativeExpression(boolean b);
-
- /**
- * whether alternative formula entry is on
- * @param b alternative formulas or not
- */
-
- void setAlternativeFormula(boolean b);
-
- /**
- * show automatic page breaks or not
- * @param b whether to show auto page breaks
- */
-
- void setAutobreaks(boolean b);
-
- /**
- * set whether sheet is a dialog sheet or not
- * @param b isDialog or not
- */
-
- void setDialog(boolean b);
-
- /**
- * set whether to display the guts or not
- *
- * @param b guts or no guts (or glory)
- */
-
- void setDisplayGuts(boolean b);
-
- /**
- * fit to page option is on
- * @param b fit or not
- */
-
- void setFitToPage(boolean b);
-
- /**
- * set if row summaries appear below detail in the outline
- * @param b below or not
- */
-
- void setRowSumsBelow(boolean b);
-
- /**
- * set if col summaries appear right of the detail in the outline
- * @param b right or not
- */
-
- void setRowSumsRight(boolean b);
-
- /**
- * whether alternate expression evaluation is on
- * @return alternative expression evaluation or not
- */
-
- boolean getAlternateExpression();
-
- /**
- * whether alternative formula entry is on
- * @return alternative formulas or not
- */
-
- boolean getAlternateFormula();
-
- /**
- * show automatic page breaks or not
- * @return whether to show auto page breaks
- */
-
- boolean getAutobreaks();
-
- /**
- * get whether sheet is a dialog sheet or not
- * @return isDialog or not
- */
-
- boolean getDialog();
-
- /**
- * get whether to display the guts or not
- *
- * @return guts or no guts (or glory)
- */
-
- boolean getDisplayGuts();
-
- /**
- * fit to page option is on
- * @return fit or not
- */
-
- boolean getFitToPage();
-
- /**
- * get if row summaries appear below detail in the outline
- * @return below or not
- */
-
- boolean getRowSumsBelow();
-
- /**
- * get if col summaries appear right of the detail in the outline
- * @return right or not
- */
-
- boolean getRowSumsRight();
-
- /**
- * Returns whether gridlines are printed.
- * @return Gridlines are printed
- */
- boolean isPrintGridlines();
-
- /**
- * Turns on or off the printing of gridlines.
- * @param newPrintGridlines boolean to turn on or off the printing of
- * gridlines
- */
- void setPrintGridlines(boolean newPrintGridlines);
-
- /**
- * Gets the print setup object.
- * @return The user model for the print setup object.
- */
- PrintSetup getPrintSetup();
-
- /**
- * Gets the user model for the document header.
- * @return The Document header.
- */
- Header getHeader();
-
- /**
- * Gets the user model for the document footer.
- * @return The Document footer.
- */
- Footer getFooter();
-
- /**
- * Sets whether sheet is selected.
- * @param sel Whether to select the sheet or deselect the sheet.
- */
- void setSelected(boolean sel);
-
- /**
- * Gets the size of the margin in inches.
- * @param margin which margin to get
- * @return the size of the margin
- */
- double getMargin(short margin);
-
- /**
- * Sets the size of the margin in inches.
- * @param margin which margin to get
- * @param size the size of the margin
- */
- void setMargin(short margin, double size);
-
- /**
- * Answer whether protection is enabled or disabled
- * @return true => protection enabled; false => protection disabled
- */
- boolean getProtect();
-
- /**
- * @return hashed password
- */
- short getPassword();
-
- /**
- * Answer whether object protection is enabled or disabled
- * @return true => protection enabled; false => protection disabled
- */
- boolean getObjectProtect();
-
- /**
- * Answer whether scenario protection is enabled or disabled
- * @return true => protection enabled; false => protection disabled
- */
- boolean getScenarioProtect();
-
- /**
- * Sets the protection on enabled or disabled
- * @param protect true => protection enabled; false => protection disabled
- * @deprecated use protectSheet(String, boolean, boolean)
- */
- void setProtect(boolean protect);
-
- /**
- * Sets the protection enabled as well as the password
- * @param password to set for protection
- */
- void protectSheet(String password);
-
- /**
- * Sets the zoom magnication for the sheet. The zoom is expressed as a
- * fraction. For example to express a zoom of 75% use 3 for the numerator
- * and 4 for the denominator.
- *
- * @param numerator The numerator for the zoom magnification.
- * @param denominator The denominator for the zoom magnification.
- */
- void setZoom(int numerator, int denominator);
-
- /**
- * The top row in the visible view when the sheet is
- * first viewed after opening it in a viewer
- * @return short indicating the rownum (0 based) of the top row
- */
- short getTopRow();
-
- /**
- * The left col in the visible view when the sheet is
- * first viewed after opening it in a viewer
- * @return short indicating the rownum (0 based) of the top row
- */
- short getLeftCol();
-
- /**
- * Sets desktop window pane display area, when the
- * file is first opened in a viewer.
- * @param toprow the top row to show in desktop window pane
- * @param leftcol the left column to show in desktop window pane
- */
- void showInPane(short toprow, short leftcol);
-
- /**
- * Shifts rows between startRow and endRow n number of rows.
- * If you use a negative number, it will shift rows up.
- * Code ensures that rows don't wrap around.
- *
- * Calls shiftRows(startRow, endRow, n, false, false);
- *
- * <p>
- * Additionally shifts merged regions that are completely defined in these
- * rows (ie. merged 2 cells on a row to be shifted).
- * @param startRow the row to start shifting
- * @param endRow the row to end shifting
- * @param n the number of rows to shift
- */
- void shiftRows(int startRow, int endRow, int n);
-
- /**
- * Shifts rows between startRow and endRow n number of rows.
- * If you use a negative number, it will shift rows up.
- * Code ensures that rows don't wrap around
- *
- * <p>
- * Additionally shifts merged regions that are completely defined in these
- * rows (ie. merged 2 cells on a row to be shifted).
- * <p>
- * TODO Might want to add bounds checking here
- * @param startRow the row to start shifting
- * @param endRow the row to end shifting
- * @param n the number of rows to shift
- * @param copyRowHeight whether to copy the row height during the shift
- * @param resetOriginalRowHeight whether to set the original row's height to the default
- */
- void shiftRows(int startRow, int endRow, int n, boolean copyRowHeight, boolean resetOriginalRowHeight);
-
- /**
- * Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
- * @param colSplit Horizonatal position of split.
- * @param rowSplit Vertical position of split.
- * @param topRow Top row visible in bottom pane
- * @param leftmostColumn Left column visible in right pane.
- */
- void createFreezePane(int colSplit, int rowSplit, int leftmostColumn, int topRow);
-
- /**
- * Creates a split (freezepane). Any existing freezepane or split pane is overwritten.
- * @param colSplit Horizonatal position of split.
- * @param rowSplit Vertical position of split.
- */
- void createFreezePane(int colSplit, int rowSplit);
-
- /**
- * Creates a split pane. Any existing freezepane or split pane is overwritten.
- * @param xSplitPos Horizonatal position of split (in 1/20th of a point).
- * @param ySplitPos Vertical position of split (in 1/20th of a point).
- * @param topRow Top row visible in bottom pane
- * @param leftmostColumn Left column visible in right pane.
- * @param activePane Active pane. One of: PANE_LOWER_RIGHT,
- * PANE_UPPER_RIGHT, PANE_LOWER_LEFT, PANE_UPPER_LEFT
- * @see #PANE_LOWER_LEFT
- * @see #PANE_LOWER_RIGHT
- * @see #PANE_UPPER_LEFT
- * @see #PANE_UPPER_RIGHT
- */
- void createSplitPane(int xSplitPos, int ySplitPos, int leftmostColumn, int topRow, int activePane);
-
- /**
- * Returns the information regarding the currently configured pane (split or freeze).
- * @return null if no pane configured, or the pane information.
- */
- PaneInformation getPaneInformation();
-
- /**
- * Sets whether the gridlines are shown in a viewer.
- * @param show whether to show gridlines or not
- */
- void setDisplayGridlines(boolean show);
-
- /**
- * Returns if gridlines are displayed.
- * @return whether gridlines are displayed
- */
- boolean isDisplayGridlines();
-
- /**
- * Sets whether the formulas are shown in a viewer.
- * @param show whether to show formulas or not
- */
- void setDisplayFormulas(boolean show);
-
- /**
- * Returns if formulas are displayed.
- * @return whether formulas are displayed
- */
- boolean isDisplayFormulas();
-
- /**
- * Sets whether the RowColHeadings are shown in a viewer.
- * @param show whether to show RowColHeadings or not
- */
- void setDisplayRowColHeadings(boolean show);
-
- /**
- * Returns if RowColHeadings are displayed.
- * @return whether RowColHeadings are displayed
- */
- boolean isDisplayRowColHeadings();
-
- /**
- * Sets a page break at the indicated row
- * @param row FIXME: Document this!
- */
- void setRowBreak(int row);
-
- /**
- * Determines if there is a page break at the indicated row
- * @param row FIXME: Document this!
- * @return FIXME: Document this!
- */
- boolean isRowBroken(int row);
-
- /**
- * Removes the page break at the indicated row
- * @param row
- */
- void removeRowBreak(int row);
-
- /**
- * Retrieves all the horizontal page breaks
- * @return all the horizontal page breaks, or null if there are no row page breaks
- */
- int[] getRowBreaks();
-
- /**
- * Retrieves all the vertical page breaks
- * @return all the vertical page breaks, or null if there are no column page breaks
- */
- short[] getColumnBreaks();
-
- /**
- * Sets a page break at the indicated column
- * @param column
- */
- void setColumnBreak(short column);
-
- /**
- * Determines if there is a page break at the indicated column
- * @param column FIXME: Document this!
- * @return FIXME: Document this!
- */
- boolean isColumnBroken(short column);
-
- /**
- * Removes a page break at the indicated column
- * @param column
- */
- void removeColumnBreak(short column);
-
- /**
- * Aggregates the drawing records and dumps the escher record hierarchy
- * to the standard output.
- */
- void dumpDrawingRecords(boolean fat);
-
- /**
- * Creates the toplevel drawing patriarch. This will have the effect of
- * removing any existing drawings on this sheet.
- *
- * @return The new patriarch.
- */
- Patriarch createDrawingPatriarch();
-
- /**
- * Expands or collapses a column group.
- *
- * @param columnNumber One of the columns in the group.
- * @param collapsed true = collapse group, false = expand group.
- */
- void setColumnGroupCollapsed(short columnNumber, boolean collapsed);
-
- /**
- * Create an outline for the provided column range.
- *
- * @param fromColumn beginning of the column range.
- * @param toColumn end of the column range.
- */
- void groupColumn(short fromColumn, short toColumn);
-
- void ungroupColumn(short fromColumn, short toColumn);
-
- void groupRow(int fromRow, int toRow);
-
- void ungroupRow(int fromRow, int toRow);
-
- void setRowGroupCollapsed(int row, boolean collapse);
-
- /**
- * Sets the default column style for a given column. POI will only apply this style to new cells added to the sheet.
- *
- * @param column the column index
- * @param style the style to set
- */
- void setDefaultColumnStyle(short column, CellStyle style);
-
- /**
- * Adjusts the column width to fit the contents.
- *
- * This process can be relatively slow on large sheets, so this should
- * normally only be called once per column, at the end of your
- * processing.
- *
- * @param column the column index
- */
- void autoSizeColumn(short column);
-
- /**
- * Returns cell comment for the specified row and column
- *
- * @return cell comment or <code>null</code> if not found
- */
- Comment getCellComment(int row, int column);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-public interface Textbox {
-
- public final static short OBJECT_TYPE_TEXT = 6;
-
- /**
- * @return the rich text string for this textbox.
- */
- RichTextString getString();
-
- /**
- * @param string Sets the rich text string used by this object.
- */
- void setString(RichTextString string);
-
- /**
- * @return Returns the left margin within the textbox.
- */
- int getMarginLeft();
-
- /**
- * Sets the left margin within the textbox.
- */
- void setMarginLeft(int marginLeft);
-
- /**
- * @return returns the right margin within the textbox.
- */
- int getMarginRight();
-
- /**
- * Sets the right margin within the textbox.
- */
- void setMarginRight(int marginRight);
-
- /**
- * @return returns the top margin within the textbox.
- */
- int getMarginTop();
-
- /**
- * Sets the top margin within the textbox.
- */
- void setMarginTop(int marginTop);
-
- /**
- * Gets the bottom margin within the textbox.
- */
- int getMarginBottom();
-
- /**
- * Sets the bottom margin within the textbox.
- */
- void setMarginBottom(int marginBottom);
-
-}
\ No newline at end of file
+++ /dev/null
-/* ====================================================================
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-==================================================================== */
-
-package org.apache.poi.ss.usermodel;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.List;
-
-public interface Workbook {
-
- /**
- * used for compile-time performance/memory optimization. This determines the
- * initial capacity for the sheet collection. Its currently set to 3.
- * Changing it in this release will decrease performance
- * since you're never allowed to have more or less than three sheets!
- */
-
- public final static int INITIAL_CAPACITY = 3;
-
- /** Extended windows meta file */
- public static final int PICTURE_TYPE_EMF = 2;
-
- /** Windows Meta File */
- public static final int PICTURE_TYPE_WMF = 3;
-
- /** Mac PICT format */
- public static final int PICTURE_TYPE_PICT = 4;
-
- /** JPEG format */
- public static final int PICTURE_TYPE_JPEG = 5;
-
- /** PNG format */
- public static final int PICTURE_TYPE_PNG = 6;
-
- /** Device independant bitmap */
- public static final int PICTURE_TYPE_DIB = 7;
-
- /**
- * sets the order of appearance for a given sheet.
- *
- * @param sheetname the name of the sheet to reorder
- * @param pos the position that we want to insert the sheet into (0 based)
- */
-
- void setSheetOrder(String sheetname, int pos);
-
- /**
- * sets the tab whose data is actually seen when the sheet is opened.
- * This may be different from the "selected sheet" since excel seems to
- * allow you to show the data of one sheet when another is seen "selected"
- * in the tabs (at the bottom).
- * @see org.apache.poi.hssf.usermodel.HSSFSheet#setSelected(boolean)
- * @param index
- */
- void setSelectedTab(short index);
-
- /**
- * gets the tab whose data is actually seen when the sheet is opened.
- * This may be different from the "selected sheet" since excel seems to
- * allow you to show the data of one sheet when another is seen "selected"
- * in the tabs (at the bottom).
- * @see org.apache.poi.hssf.usermodel.HSSFSheet#setSelected(boolean)
- */
- short getSelectedTab();
-
- /**
- * sets the first tab that is displayed in the list of tabs
- * in excel.
- * @param index
- */
- void setDisplayedTab(short index);
-
- /**
- * sets the first tab that is displayed in the list of tabs
- * in excel.
- */
- short getDisplayedTab();
-
- /**
- * @deprecated POI will now properly handle unicode strings without
- * forceing an encoding
- */
- public final static byte ENCODING_COMPRESSED_UNICODE = 0;
-
- /**
- * @deprecated POI will now properly handle unicode strings without
- * forceing an encoding
- */
- public final static byte ENCODING_UTF_16 = 1;
-
- /**
- * set the sheet name.
- * Will throw IllegalArgumentException if the name is greater than 31 chars
- * or contains /\?*[]
- * @param sheet number (0 based)
- */
- void setSheetName(int sheet, String name);
-
- /**
- * set the sheet name forcing the encoding. Forcing the encoding IS A BAD IDEA!!!
- * @deprecated 3-Jan-2006 POI now automatically detects unicode and sets the encoding
- * appropriately. Simply use setSheetName(int sheet, String encoding)
- * @throws IllegalArgumentException if the name is greater than 31 chars
- * or contains /\?*[]
- * @param sheet number (0 based)
- */
- void setSheetName(int sheet, String name, short encoding);
-
- /**
- * get the sheet name
- * @param sheet Number
- * @return Sheet name
- */
-
- String getSheetName(int sheet);
-
- /** Returns the index of the sheet by his name
- * @param name the sheet name
- * @return index of the sheet (0 based)
- */
- int getSheetIndex(String name);
-
- /** Returns the index of the given sheet
- * @param sheet the sheet to look up
- * @return index of the sheet (0 based)
- */
- int getSheetIndex(Sheet sheet);
-
- /**
- * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
- * the high level representation. Use this to create new sheets.
- *
- * @return HSSFSheet representing the new sheet.
- */
-
- Sheet createSheet();
-
- /**
- * create an HSSFSheet from an existing sheet in the HSSFWorkbook.
- *
- * @return HSSFSheet representing the cloned sheet.
- */
-
- Sheet cloneSheet(int sheetNum);
-
- /**
- * create an HSSFSheet for this HSSFWorkbook, adds it to the sheets and returns
- * the high level representation. Use this to create new sheets.
- *
- * @param sheetname sheetname to set for the sheet.
- * @return HSSFSheet representing the new sheet.
- */
-
- Sheet createSheet(String sheetname);
-
- /**
- * get the number of spreadsheets in the workbook (this will be three after serialization)
- * @return number of sheets
- */
-
- int getNumberOfSheets();
-
- /**
- * Get the HSSFSheet object at the given index.
- * @param index of the sheet number (0-based physical & logical)
- * @return HSSFSheet at the provided index
- */
-
- Sheet getSheetAt(int index);
-
- /**
- * Get sheet with the given name
- * @param name of the sheet
- * @return HSSFSheet with the name provided or null if it does not exist
- */
-
- Sheet getSheet(String name);
-
- /**
- * removes sheet at the given index
- * @param index of the sheet (0-based)
- */
-
- void removeSheetAt(int index);
-
- /**
- * determine whether the Excel GUI will backup the workbook when saving.
- *
- * @param backupValue true to indicate a backup will be performed.
- */
-
- void setBackupFlag(boolean backupValue);
-
- /**
- * determine whether the Excel GUI will backup the workbook when saving.
- *
- * @return the current setting for backups.
- */
-
- boolean getBackupFlag();
-
- /**
- * Sets the repeating rows and columns for a sheet (as found in
- * File->PageSetup->Sheet). This is function is included in the workbook
- * because it creates/modifies name records which are stored at the
- * workbook level.
- * <p>
- * To set just repeating columns:
- * <pre>
- * workbook.setRepeatingRowsAndColumns(0,0,1,-1-1);
- * </pre>
- * To set just repeating rows:
- * <pre>
- * workbook.setRepeatingRowsAndColumns(0,-1,-1,0,4);
- * </pre>
- * To remove all repeating rows and columns for a sheet.
- * <pre>
- * workbook.setRepeatingRowsAndColumns(0,-1,-1,-1,-1);
- * </pre>
- *
- * @param sheetIndex 0 based index to sheet.
- * @param startColumn 0 based start of repeating columns.
- * @param endColumn 0 based end of repeating columns.
- * @param startRow 0 based start of repeating rows.
- * @param endRow 0 based end of repeating rows.
- */
- void setRepeatingRowsAndColumns(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow);
-
- /**
- * create a new Font and add it to the workbook's font table
- * @return new font object
- */
-
- Font createFont();
-
- /**
- * Finds a font that matches the one with the supplied attributes
- */
- Font findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline);
-
- /**
- * get the number of fonts in the font table
- * @return number of fonts
- */
-
- short getNumberOfFonts();
-
- /**
- * get the font at the given index number
- * @param idx index number
- * @return HSSFFont at the index
- */
-
- Font getFontAt(short idx);
-
- /**
- * create a new Cell style and add it to the workbook's style table
- * @return the new Cell Style object
- */
-
- CellStyle createCellStyle();
-
- /**
- * get the number of styles the workbook contains
- * @return count of cell styles
- */
-
- short getNumCellStyles();
-
- /**
- * get the cell style object at the given index
- * @param idx index within the set of styles
- * @return HSSFCellStyle object at the index
- */
-
- CellStyle getCellStyleAt(short idx);
-
- /**
- * Method write - write out this workbook to an Outputstream. Constructs
- * a new POI POIFSFileSystem, passes in the workbook binary representation and
- * writes it out.
- *
- * @param stream - the java OutputStream you wish to write the XLS to
- *
- * @exception IOException if anything can't be written.
- * @see org.apache.poi.poifs.filesystem.POIFSFileSystem
- */
-
- void write(OutputStream stream) throws IOException;
-
- /**
- * Method getBytes - get the bytes of just the HSSF portions of the XLS file.
- * Use this to construct a POI POIFSFileSystem yourself.
- *
- *
- * @return byte[] array containing the binary representation of this workbook and all contained
- * sheets, rows, cells, etc.
- *
- * @see org.apache.poi.hssf.model.Workbook
- * @see org.apache.poi.hssf.model.Sheet
- */
-
- byte[] getBytes();
-
- /** @deprecated Do not call this method from your applications. Use the methods
- * available in the HSSFRow to add string HSSFCells
- */
- int addSSTString(String string);
-
- /** @deprecated Do not call this method from your applications. Use the methods
- * available in the HSSFRow to get string HSSFCells
- */
- String getSSTString(int index);
-
- /** gets the total number of named ranges in the workboko
- * @return number of named ranges
- */
- int getNumberOfNames();
-
- /** gets the Named range
- * @param index position of the named range
- * @return named range high level
- */
- Name getNameAt(int index);
-
- /** gets the named range name
- * @param index the named range index (0 based)
- * @return named range name
- */
- String getNameName(int index);
-
- /**
- * Sets the printarea for the sheet provided
- * <p>
- * i.e. Reference = $A$1:$B$2
- * @param sheetIndex Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
- * @param reference Valid name Reference for the Print Area
- */
- void setPrintArea(int sheetIndex, String reference);
-
- /**
- * For the Convenience of Java Programmers maintaining pointers.
- * @see #setPrintArea(int, String)
- * @param sheetIndex Zero-based sheet index (0 = First Sheet)
- * @param startColumn Column to begin printarea
- * @param endColumn Column to end the printarea
- * @param startRow Row to begin the printarea
- * @param endRow Row to end the printarea
- */
- void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow);
-
- /**
- * Retrieves the reference for the printarea of the specified sheet, the sheet name is appended to the reference even if it was not specified.
- * @param sheetIndex Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
- * @return String Null if no print area has been defined
- */
- String getPrintArea(int sheetIndex);
-
- /**
- * Delete the printarea for the sheet specified
- * @param sheetIndex Zero-based sheet index (0 = First Sheet)
- */
- void removePrintArea(int sheetIndex);
-
- /** creates a new named range and add it to the model
- * @return named range high level
- */
- Name createName();
-
- /** gets the named range index by his name
- * <i>Note:</i>Excel named ranges are case-insensitive and
- * this method performs a case-insensitive search.
- *
- * @param name named range name
- * @return named range index
- */
- int getNameIndex(String name);
-
- /** remove the named range by his index
- * @param index named range index (0 based)
- */
- void removeName(int index);
-
- /**
- * Returns the instance of HSSFDataFormat for this workbook.
- * @return the HSSFDataFormat object
- * @see org.apache.poi.hssf.record.FormatRecord
- * @see org.apache.poi.hssf.record.Record
- */
- DataFormat createDataFormat();
-
- /** remove the named range by his name
- * @param name named range name
- */
- void removeName(String name);
-
- Palette getCustomPalette();
-
- /** Test only. Do not use */
- void insertChartRecord();
-
- /**
- * Spits out a list of all the drawing records in the workbook.
- */
- void dumpDrawingGroupRecords(boolean fat);
-
- /**
- * Adds a picture to the workbook.
- *
- * @param pictureData The bytes of the picture
- * @param format The format of the picture. One of <code>PICTURE_TYPE_*</code>
- *
- * @return the index to this picture (1 based).
- */
- int addPicture(byte[] pictureData, int format);
-
- /**
- * Gets all pictures from the Workbook.
- *
- * @return the list of pictures (a list of {@link HSSFPictureData} objects.)
- */
- List getAllPictures();
-
- /**
- * protect a workbook with a password (not encypted, just sets writeprotect
- * flags and the password.
- * @param password to set
- */
- void writeProtectWorkbook(String password, String username);
-
- /**
- * removes the write protect flag
- */
- void unwriteProtectWorkbook();
-
- /**
- * Gets all embedded OLE2 objects from the Workbook.
- *
- * @return the list of embedded objects (a list of {@link HSSFObjectData} objects.)
- */
- List getAllEmbeddedObjects();
-
-}
\ No newline at end of file