org.odftoolkit.simple.form.FormContainer Maven / Gradle / Ivy
/*
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.odftoolkit.simple.form;
import java.util.Iterator;
import org.odftoolkit.odfdom.dom.element.office.OfficeFormsElement;
/**
* FormContainer is a container which maintains Form(s) as element(s).
*
* @since 0.8
*/
public interface FormContainer {
/**
* Get the ODF element OfficeFormsElement
which can have
* FormFormElement
as child element directly according to ODF
* specification. This element will help to find the position to insert a
* new FormFormElement
element.
*
* @return the element of office:forms
*/
public OfficeFormsElement getFormContainerElement();
/**
* create and add a form into this container.
*
* @param name
* - form name, represents attribute form:name
* @return an instance of Form
*/
public Form createForm(String name);
/**
* Remove the form and its binding shape.
*
* @param form
* - the form to be removed
* @return true if the form is removed successfully, false if errors happen.
*/
public boolean removeForm(Form form);
/**
* Return a form whose name is a given value.
*
* @param name
* - the name of the form
* @return a form whose name is a given value
*/
public Form getFormByName(String name);
/**
* Get an iterator to traverse each form in this container.
*
* @return form iterator
*/
public Iterator