// Path: java2word/src/main/java/word/api/interfaces/IBody.java
// public interface IBody extends IHasElement{
// 	
// 	/**
// 	 * @author leonardo_correa
// 	 * This is to provide another way to add raw text to the body or replace something like style or whatever you want.
// 	 * 
// 	 * Like Serializable, IBody has no methods or fields and serves only to identify the semantics of being IBody. 
// 	 */	
// 	
// 	public IHeader getHeader();
// //	public void setHeader(IHeader header);
// 	
// 	public IFooter getFooter();
// //	public void setFooter(IFooter footer);	
// 	
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IDocument.java
// public interface IDocument extends IHasElement {
// 
//     /**
//      * @return the URI ready to be added to the document
//      */
//     String getUri();
// 
//     /**
//      * @return the body of the document
//      */
//     IBody getBody();
// 
//     /**
//      * @return the header that may contain other elements
//      */
//     IHeader getHeader();
// 
//     /**
//      * @return the Footer that may contain other elements
//      */
//     IFooter getFooter();
// 
//     /**
//      * Sets page orientation to Landscape. Default is Portrait
//      */
//     void setPageOrientationLandscape();
// 
// 
//     /**
//      * @param title  Represents the title of the document. The title can be different than the file name. The title is used when searching for the document and also when creating Web pages from the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 title(String title);
// 
//     /**
//      * @param subject Represents the subject of the document. This property can be used to group similar files together, so you can search for all files that have the same subject.
//      * @return fluent @Document reference
//      */
//     public Document2004 subject(String subject);
// 
//     /**
//      * @param keywords Represents keywords to be used when searching for the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 keywords(String keywords);
// 
//     /**
//      * @param description Represents comments to be used when searching for the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 description(String description);
// 
//     /**
//      * @param category Represents the author who created the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 category(String category);
// 
//     /**
//      * @param author Represents the name of the author of the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 author(String author);
// 
//     /**
//      * @param lastAuthor Represents the name of the author who last saved the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 lastAuthor(String lastAuthor);
// 
//     /**
//      * @param manager Represents the manager of the author of the document. This property can be used to group similar files together, so you can search for all the files that have the same manager.
//      * @return fluent @Document reference
//      */
//     public Document2004 manager(String manager);
// 
//     /**
//      * @param company  Represents the company that employs the author. This property can be used to group similar files together, so you can search for all files that have the same company.
//      * @return fluent @Document reference
//      */
//     public Document2004 company(String company);
// 
//     /**
//      * @param encoding The encoding you want to use in your document. UTF-8 or ISO8859-1, according to the Enum @Encoding
//      * @return
//      */
//     public Document2004 encoding(Encoding encoding);
// 
//     /**
//      * It gives a chance to set up your own encoding by passing the final string ready to go.
//      * @param encoding
//      * @return
//      */
//     public Document2004 encoding(String encoding);
// 
// 
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IElement.java
// public interface IElement {
// 
// 	/**
// 	 * <p>This method returns the content (XML or HTML) of the Element and the content.</p>
// 	 * <p>If you are using W2004, the return will be the XML required to generate the element.</p>
// 	 *
// 	 * <p>Important: Once you call this method, the Document value is cached an no elements can be added later.</p>
// 	 *
// 	 * @return this is the String value of the element ready to be appended/inserted in the Document.<br>
// 	 *
// 	 * <p>This is the XML that generates a <code>BreakLine</code>:</p>
// 	 * <code>
// 	 *  <w:p wsp:rsidR='008979E8' wsp:rsidRDefault='008979E8'/>
// 	 * </code>
// 	 */
// 	public String getContent();
// 
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IFooter.java
// public interface IFooter extends IHasElement{
// 	
// 	public void showPageNumber(boolean value);//default is true 
// 	
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IHeader.java
// public interface IHeader extends IHasElement{
// 
// 	void setHideHeaderAndFooterFirstPage(boolean value);
// 	boolean getHideHeaderAndFooterFirstPage();
// 	
// 	String getHideHeaderAndFooterFirstPageXml();
// 	
// }


import word.api.interfaces.IBody;
import word.api.interfaces.IDocument;
import word.api.interfaces.IElement;
import word.api.interfaces.IFooter;
import word.api.interfaces.IHeader;
package word.w2004;


/**
 * This is the main class in this API. It represents the MS Word document.
 * @author leonardo_correa
 *
 */
public class Document2004 implements IDocument, IElement{

    private boolean hasBeenCalledBefore = false; // if getContent has already been called, I cached the result for future invocations

    private StringBuilder txt = new StringBuilder();
// Path: java2word/src/main/java/word/api/interfaces/IBody.java
// public interface IBody extends IHasElement{
// 	
// 	/**
// 	 * @author leonardo_correa
// 	 * This is to provide another way to add raw text to the body or replace something like style or whatever you want.
// 	 * 
// 	 * Like Serializable, IBody has no methods or fields and serves only to identify the semantics of being IBody. 
// 	 */	
// 	
// 	public IHeader getHeader();
// //	public void setHeader(IHeader header);
// 	
// 	public IFooter getFooter();
// //	public void setFooter(IFooter footer);	
// 	
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IDocument.java
// public interface IDocument extends IHasElement {
// 
//     /**
//      * @return the URI ready to be added to the document
//      */
//     String getUri();
// 
//     /**
//      * @return the body of the document
//      */
//     IBody getBody();
// 
//     /**
//      * @return the header that may contain other elements
//      */
//     IHeader getHeader();
// 
//     /**
//      * @return the Footer that may contain other elements
//      */
//     IFooter getFooter();
// 
//     /**
//      * Sets page orientation to Landscape. Default is Portrait
//      */
//     void setPageOrientationLandscape();
// 
// 
//     /**
//      * @param title  Represents the title of the document. The title can be different than the file name. The title is used when searching for the document and also when creating Web pages from the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 title(String title);
// 
//     /**
//      * @param subject Represents the subject of the document. This property can be used to group similar files together, so you can search for all files that have the same subject.
//      * @return fluent @Document reference
//      */
//     public Document2004 subject(String subject);
// 
//     /**
//      * @param keywords Represents keywords to be used when searching for the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 keywords(String keywords);
// 
//     /**
//      * @param description Represents comments to be used when searching for the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 description(String description);
// 
//     /**
//      * @param category Represents the author who created the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 category(String category);
// 
//     /**
//      * @param author Represents the name of the author of the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 author(String author);
// 
//     /**
//      * @param lastAuthor Represents the name of the author who last saved the document.
//      * @return fluent @Document reference
//      */
//     public Document2004 lastAuthor(String lastAuthor);
// 
//     /**
//      * @param manager Represents the manager of the author of the document. This property can be used to group similar files together, so you can search for all the files that have the same manager.
//      * @return fluent @Document reference
//      */
//     public Document2004 manager(String manager);
// 
//     /**
//      * @param company  Represents the company that employs the author. This property can be used to group similar files together, so you can search for all files that have the same company.
//      * @return fluent @Document reference
//      */
//     public Document2004 company(String company);
// 
//     /**
//      * @param encoding The encoding you want to use in your document. UTF-8 or ISO8859-1, according to the Enum @Encoding
//      * @return
//      */
//     public Document2004 encoding(Encoding encoding);
// 
//     /**
//      * It gives a chance to set up your own encoding by passing the final string ready to go.
//      * @param encoding
//      * @return
//      */
//     public Document2004 encoding(String encoding);
// 
// 
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IElement.java
// public interface IElement {
// 
// 	/**
// 	 * <p>This method returns the content (XML or HTML) of the Element and the content.</p>
// 	 * <p>If you are using W2004, the return will be the XML required to generate the element.</p>
// 	 *
// 	 * <p>Important: Once you call this method, the Document value is cached an no elements can be added later.</p>
// 	 *
// 	 * @return this is the String value of the element ready to be appended/inserted in the Document.<br>
// 	 *
// 	 * <p>This is the XML that generates a <code>BreakLine</code>:</p>
// 	 * <code>
// 	 *  <w:p wsp:rsidR='008979E8' wsp:rsidRDefault='008979E8'/>
// 	 * </code>
// 	 */
// 	public String getContent();
// 
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IFooter.java
// public interface IFooter extends IHasElement{
// 	
// 	public void showPageNumber(boolean value);//default is true 
// 	
// }
// 
// Path: java2word/src/main/java/word/api/interfaces/IHeader.java
// public interface IHeader extends IHasElement{
// 
// 	void setHideHeaderAndFooterFirstPage(boolean value);
// 	boolean getHideHeaderAndFooterFirstPage();
// 	
// 	String getHideHeaderAndFooterFirstPageXml();
// 	
// }


// Path: java2word/src/main/java/word/w2004/Document2004.java
import word.api.interfaces.IBody;
import word.api.interfaces.IDocument;
import word.api.interfaces.IElement;
import word.api.interfaces.IFooter;
import word.api.interfaces.IHeader;

package word.w2004;


/**
 * This is the main class in this API. It represents the MS Word document.
 * @author leonardo_correa
 *
 */
public class Document2004 implements IDocument, IElement{

    private boolean hasBeenCalledBefore = false; // if getContent has already been called, I cached the result for future invocations

    private StringBuilder txt = new StringBuilder();
    private IBody body = new Body2004();