// "Therefore those skilled at the unorthodox
// are infinite as heaven and earth,
// inexhaustible as the great rivers.
// When they come to an end,
// they begin again,
// like the days and months;
// they die and are reborn,
// like the four seasons."
//
// - Sun Tsu,
// "The Art of War"
using TheArtOfDev.HtmlRenderer.Adapters;
using TheArtOfDev.HtmlRenderer.Adapters.Entities;
namespace TheArtOfDev.HtmlRenderer.Core.Dom
{
///
/// Represents a word inside an inline box
///
internal sealed class CssRectImage : CssRect
{
#region Fields and Consts
///
/// the image object if it is image word (can be null if not loaded)
///
private RImage _image;
///
/// the image rectangle restriction as returned from image load event
///
private RRect _imageRectangle;
#endregion
///
/// Creates a new BoxWord which represents an image
///
/// the CSS box owner of the word
public CssRectImage(CssBox owner)
: base(owner)
{ }
///
/// Gets the image this words represents (if one exists)
///
public override RImage Image
{
get { return _image; }
set { _image = value; }
}
///
/// Gets if the word represents an image.
///
public override bool IsImage
{
get { return true; }
}
///
/// the image rectange restriction as returned from image load event
///
public RRect ImageRectangle
{
get { return _imageRectangle; }
set { _imageRectangle = value; }
}
///
/// Represents this word for debugging purposes
///
///
public override string ToString()
{
return "Image";
}
}
}