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

namespace CatelSample.ViewModels.Interfaces
{
    public interface ITabService
    {
        /// <summary>
        /// Gets all the tabs.
        /// </summary>
        /// <value>The tabs.</value>
        IEnumerable<ITabItem> Tabs { get; }

        /// <summary>
        /// Gets the selected tab.
        /// </summary>
        /// <value>The selected tab.</value>
        ITabItem SelectedTab { get; }

        /// <summary>
        /// Occurs when the selected tab has changed.
        /// </summary>
        event EventHandler<TabItemEventArgs> SelectedTabChanged;

        /// <summary>
        /// Determines whether the specified tab item is visible.
        /// </summary>
        /// <param name="tabItem">The tab item.</param>
        /// <returns><c>true</c> if the specified tab item is visible; otherwise, <c>false</c>.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="tabItem"/> is <c>null</c>.</exception>
        bool IsVisible(ITabItem tabItem);

        /// <summary>
        /// Determines whether the specified tab item is active.
        /// </summary>
        /// <param name="tabItem">The tab item.</param>
        /// <returns><c>true</c> if the specified tab item is active; otherwise, <c>false</c>.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="tabItem"/> is <c>null</c>.</exception>
        bool IsActive(ITabItem tabItem);

        /// <summary>
        /// Removes all tabs
        /// </summary>
        void Clear();

        /// <summary>
        /// Shows the specified tab item in a tab.
        /// <para />
        /// If the tab is already in the list of open tabs, this method won't do anything.
        /// </summary>
        /// <param name="tabItem">The tab item.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="tabItem"/> is <c>null</c>.</exception>
        void Add(ITabItem tabItem);

        /// <summary>
        /// Shows the specified tab item in a tab.
        /// <para />
        /// If the tab is already in the list of open tabs, this method won't do anything.
        /// </summary>
        /// <param name="index">The index.</param>
        /// <param name="tabItem">The tab item.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="tabItem" /> is <c>null</c>.</exception>
        void Insert(int index, ITabItem tabItem);

        /// <summary>
        /// Activates the specified tab item.
        /// </summary>
        /// <param name="tabItem">The tab item.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="tabItem"/> is <c>null</c>.</exception>
        /// <exception cref="InvalidOperationException">The <paramref name="tabItem"/> is not visible, use <see cref="Add"/> first.</exception>
        void Activate(ITabItem tabItem);

        /// <summary>
        /// Hides the specified tab item.
        /// <para />
        /// If the tab is not in the list of open tabs, this method won't do anything.
        /// </summary>
        /// <param name="tabItem">The tab item.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="tabItem"/> is <c>null</c>.</exception>
        void Remove(ITabItem tabItem);

        void SetTabControl(object tabControl);
    }
}
