using System.Collections.Generic;

namespace StreamBuddy.PluginInterface
{
    /// <summary>
    /// Defines functions for interfacing with a stream
    /// </summary>
    public interface IStream : Commands.ICommandManager, Features.IFeatureManager, DB.IValueStore, IRC.IIRCConnection
    {
        /// <summary>
        /// A connection to the stream-specific database
        /// </summary>
        SQLite.SQLiteConnection DBConnection { get; }
		/// <summary>
		/// A connection to the stream-specific temporary database
		/// </summary>
		SQLite.SQLiteConnection TempDB { get; }

		/// <summary>
		/// The name of the stream.
		/// </summary>
		string Name { get; }
		/// <summary>
		/// A quick way of getting the stream owner user.
		/// </summary>
		Users.IUser Owner { get; }
        /// <summary>
        /// Is the bot to be enabled on the stream, setting this to false will leave the bot unresponsive in the stream.
        /// </summary>
        bool Enabled { get; set; }
        /// <summary>
        /// Gets a list of users with privileges above that of a guest.
        /// </summary>
        IReadOnlyList<Users.IUser> PrivilegedUsers { get; }
        /// <summary>
        /// Gets a list of all the current users in the stream.
        /// </summary>
        IReadOnlyList<Users.IUser> AllUsers { get; }
        /// <summary>
        /// Gets or sets the nick handler to be used on the stream.
        /// </summary>
        INickHandler NickHandler { get; set; }

        /// <summary>
        /// Gets a user with the given nick, adding them to the channel if they don't already exist.
        /// Note that this can be dangerous if used with the UserRank Guest, since it can add a non-existant user.
        /// </summary>
        /// <param name="Nick">The nick of the user to add.</param>
        /// <param name="Rank">The rank the user shall have.</param>
        /// <returns>The user object of the newly added user</returns>
		Users.IUser AddUser(string Nick, Users.UserRank Rank = Users.UserRank.User);
        /// <summary>
        /// Gets a user object for the given nick, the user does not need to necessarily exist or be online at the moment.
        /// </summary>
        /// <param name="Nick">The nick of the user to find.</param>
        /// <returns>A user object for a user with the given nick</returns>
        Users.IUser GetUser(string Nick);
        /// <summary>
        /// Removes a user from the list of privileged users.
        /// </summary>
        /// <param name="Nick">The nick of the user to remove.</param>
        void RemoveUser(string Nick);
    }
}
