using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Drawing;


namespace ImageBlockz.Api
{
    /// <summary>
    /// Abstract base class that provides implementation of common features of all operations.
    /// </summary>
    public abstract class AbstractOperation : IOperation
    {
        private readonly OperationType type;

        /// <summary>
        /// Constructor that initializes operation with its type.
        /// </summary>
        /// <param name="type">Type of operation.</param>
        protected AbstractOperation(OperationType type)
        {
            this.type = type;
        }

        /// <summary>
        /// <inheritdoc/>
        /// </summary>
        public abstract Bitmap Do(Bitmap bmp);

        /// <summary>
        /// <inheritdoc/>
        /// </summary>
        public abstract XmlNode ToXml(XmlDocument xmlDoc);

        /// <summary>
        /// 	<inheritdoc/>     
        /// </summary>	
        public abstract void FromXml(XmlNode node);

        /// <summary>
        /// 	<inheritdoc/>
        /// </summary>
        public abstract string GetFormattedName();

        /// <summary>
        /// 	<inheritdoc/>
        /// </summary>     
        public abstract string GetInfo();

        /// <summary>
        /// 	<inheritdoc/>
        /// </summary>       
        public OperationType GetOperationType()
        {
            return type;
        }
    }
}
