/* ====================================================================
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.
==================================================================== */
namespace HH.WMS.Utils.NPOI.HSSF.UserModel
{
using System;
using HH.WMS.Utils.NPOI.HSSF.Record;
using HH.WMS.Utils.NPOI.HSSF.Record.Aggregates;
using HH.WMS.Utils.NPOI.SS.UserModel;
///
/// Class to Read and manipulate the footer.
/// The footer works by having a left, center, and right side. The total cannot
/// be more that 255 bytes long. One uses this class by Getting the HSSFFooter
/// from HSSFSheet and then Getting or Setting the left, center, and right side.
/// For special things (such as page numbers and date), one can use a the methods
/// that return the Chars used to represent these. One can also Change the
/// fonts by using similar methods.
/// @author Shawn Laubach (slaubach at apache dot org)
///
public class HSSFFooter : HeaderFooter,IFooter
{
private PageSettingsBlock _psb;
///
/// Initializes a new instance of the class.
///
/// Footer record to create the footer with
public HSSFFooter(PageSettingsBlock psb)
{
_psb = psb;
}
///
/// Gets the raw footer.
///
/// The raw footer.
public override String RawText
{
get
{
FooterRecord hf = _psb.Footer;
if (hf == null)
{
return string.Empty;
}
return hf.Text;
}
}
protected override void SetHeaderFooterText(string text)
{
FooterRecord hfr = _psb.Footer;
if (hfr == null)
{
hfr = new FooterRecord(text);
_psb.Footer=(hfr);
}
else
{
hfr.Text=(text);
}
}
}
}