using System;
using System.Drawing;
using System.Xml;


namespace ImageBlockz.Api
{   
    ///<summary>This interface must be implemented by every operation.</summary>
    public interface IOperation
    {
        /// <summary>
        /// This method applies operation on input bitmap and returns new bitmap.
        /// </summary>
        /// <param name="img">Input bitmap.</param>
        /// <returns>New bitmap with applied operation.</returns>
        Bitmap Do(Bitmap img);

        /// <summary>
        /// Serialize operation into XML DOM node.
        /// </summary>
        /// <param name="xmlDoc">The XML document which is used to create the node.</param>
        /// <returns>Node which contains serialized operation.</returns>
        XmlNode ToXml(XmlDocument xmlDoc);
        
        /// <summary>
        /// Deserialize operation from XML DOM node.
        /// </summary>
        /// <param name="node">Node which contains serialized operation.</param>
        void FromXml(XmlNode node);

        /// <summary>
        /// Get name of operation for printing.
        /// </summary>
        /// <returns>Formatted name of operation.</returns>
        string GetFormattedName();
        
        /// <summary>
        /// Get info about operation for printing. 
        /// Info should contain names of parameters with assigned values.
        /// </summary>
        /// <returns>String of parameters with assigned values.</returns>
        string GetInfo();

        /// <summary>
        /// This method returns type of operation, <see cref="ImageBlockz.Api.OperationType"/>.
        /// </summary>
        /// <returns>Type of operation.</returns>
        OperationType GetOperationType();
    }

}
