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


namespace DataWarehouse
{
    /// <summary>
    /// Interface for working with database
    /// </summary>
    public interface IDatabaseInterface
    {
        /// <summary>
        /// Logins
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        void Login(string login, string password);

        /// <summary>
        /// Gets a tree
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="ext">Extention</param>
        /// <returns>Tree document</returns>
        XmlDocument GetTree(string login, string password, string[] ext);

        /// <summary>
        /// Gets string representation of tree
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="ext">Extention</param>
        /// <returns>String representation of tree</returns>
        string GetTreeString(string login, string password, string[] ext);

        /// <summary>
        /// Gets data
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="id">Id of data</param>
        /// <param name="ext">Extention</param>
        /// <returns>Data</returns>
        byte[] GetData(string login, string password, string id, ref string ext);

        /// <summary>
        /// Adds data
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="parentId">Id of parent</param>
        /// <param name="name">Name of data</param>
        /// <param name="description">Description of data</param>
        /// <param name="data">The data</param>
        /// <param name="ext">Extention</param>
        /// <returns>Id of data</returns>
        string AddData(string login, string password, string parentId, 
            string name, string description, byte[] data, string ext);

        /// <summary>
        /// Updates data
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="id">Data id</param>
        /// <param name="data">The data</param>
        void UpdateData(string login, string password, string id, byte[] data);

        /// <summary>
        /// Adds a directory
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="parentId">Directory name</param>
        /// <param name="name">Name of directory</param>
        /// <param name="description">Description of directory</param>
        /// <param name="ext">Extention</param>
        /// <returns>Derectory id</returns>
        string AddDirectory(string login, string password, string parentId, string name, string description, string ext);

        /// <summary>
        /// Udates data
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="Id">Data Id</param>
        /// <param name="name">Name of data</param>
        /// <param name="description">Description</param>
        void UpdateData(string login, string password, string Id, string name, string description);

        /// <summary>
        /// Updates directory
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="id">Id</param>
        /// <param name="name">New directory name</param>
        /// <param name="description">Descroption</param>
        void UpdateDirectory(string login, string password, string id, string name, string description);
        
        /// <summary>
        /// Removes data
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="id">Id</param>
        void RemoveData(string login, string password, string id);

        /// <summary>
        /// Removes directory
        /// </summary>
        /// <param name="login">Login</param>
        /// <param name="password">Password</param>
        /// <param name="id">Directory Id</param>
        void RemoveDirectory(string login, string password, string id);


    }
}
