'use strict';

var Header = require('./Header');
var Footer = require('./Footer');

/**
 * HeaderFactory class
 * @constructor
 */
function HeaderFooterFactory(editor){
  this._editor = editor;
}

HeaderFooterFactory.prototype.insertHeader = function(){
  this.header = new Header(this._editor,this._editor.getBody());
};
HeaderFooterFactory.prototype.insertFooter = function(){
  this.footer = new Footer(this._editor,this._editor.getBody());
};

module.exports = HeaderFooterFactory;

@@ -191,10 +191,123 @@
 or;%0A
-%7D%0A
+  this._hasHeader = false;%0A  this._hasFooter = false;%0A%7D%0A%0A/**%0A * Insert a new header%0A * @method%0A * @returns void%0A */
 %0AHea
@@ -425,18 +425,104 @@
 ody());%0A
-%7D;
+  this._hasHeader = true;%0A%7D;%0A%0A/**%0A * Insert a new footer%0A * @method%0A * @returns void%0A */
 %0AHeaderF
@@ -636,18 +636,481 @@
 ody());%0A
-%7D;
+  this._hasFooter = true;%0A%7D;%0A%0A/**%0A * Check if the document has a header or not%0A * @method%0A * @returns %7BBoolean%7D true if the document has a header, false if not%0A */%0AHeaderFooterFactory.prototype.hasHeader = function()%7B%0A  return this._hasHeader;%0A%7D;%0A%0A/**%0A * Check if the document has a footer or not%0A * @method%0A * @returns %7BBoolean%7D true if the document has a footer, false if not%0A */%0AHeaderFooterFactory.prototype.hasFooter = function()%7B%0A  return this._hasFooter;%0A%7D;%0A
 %0A%0Amodule

create public methods HeaderFooterFactory.prototype.hasHeader() and HeaderFooterFactory.prototype.hasFooter()