/*
 * Host.cs --
 *
 * Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: $
 */

using System;
using Eagle._Attributes;
using Eagle._Components.Public;
using Eagle._Containers.Public;

#if !CONSOLE
using ConsoleColor = Eagle._Components.Public.ConsoleColor;
#endif

namespace Eagle._Interfaces.Public
{
    [ObjectId("0b056d8f-c52e-4cb9-a92d-ddc478a00be7")]
    public interface IHost :
            IInteractiveHost, IEngineHost, IStreamHost,
            IDebugHost, IInformationHost
    {
        string Profile { get; set; }

        bool UseAttach { get; set; }
        bool NoColor { get; set; }
        bool NoTitle { get; set; }
        bool NoIcon { get; set; }
        bool NoProfile { get; set; }
        bool NoCancel { get; set; }

        string DefaultTitle { get; set; }

        bool Echo { get; set; }

        bool Beep(int frequency, int duration);

        bool IsIdle();
        bool Clear();

        bool ResetFlags();

        bool ResetPosition();

        bool GetPosition(ref int left, ref int top);
        bool SetPosition(int left, int top);

        bool GetDefaultPosition(ref int left, ref int top);
        bool SetDefaultPosition(int left, int top);

        bool ResetSize(HostSizeType hostSizeType);

        bool GetSize(HostSizeType hostSizeType, ref int width, ref int height);
        bool SetSize(HostSizeType hostSizeType, int width, int height);

        ReturnCode GetMode(ChannelType channelType, ref uint mode,
            ref Result error);
        ReturnCode SetMode(ChannelType channelType, uint mode,
            ref Result error);

        bool ResetColors();
        bool GetColors(ref ConsoleColor foregroundColor,
            ref ConsoleColor backgroundColor);
        bool AdjustColors(ref ConsoleColor foregroundColor,
            ref ConsoleColor backgroundColor);
        bool SetForegroundColor(ConsoleColor foregroundColor);
        bool SetBackgroundColor(ConsoleColor backgroundColor);
        bool SetColors(bool foreground, bool background,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor);

        ReturnCode GetColors(string theme, string name, bool foreground,
            bool background, ref ConsoleColor foregroundColor,
            ref ConsoleColor backgroundColor, ref Result error);
        ReturnCode SetColors(string theme, string name, bool foreground,
            bool background, ConsoleColor foregroundColor,
            ConsoleColor backgroundColor, ref Result error);

        ReturnCode Open(ref Result error);
        ReturnCode Close(ref Result error);
        ReturnCode Discard(ref Result error);
        ReturnCode Reset(ref Result error);

        bool Read(ref int value); /* RECOMMENDED */
        bool ReadKey(bool intercept, ref IClientData clientData); /* RECOMMENDED */

#if CONSOLE
        [Obsolete()]
        bool ReadKey(bool intercept, ref ConsoleKeyInfo keyInfo); /* DEPRECATED */
#endif

        bool Write(char value, bool newLine);
        bool Write(char value, int count);
        bool Write(char value, int count, bool newLine);
        bool Write(char value, int count, bool newLine,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor);
        bool Write(char value, ConsoleColor foregroundColor,
            ConsoleColor backgroundColor);

        bool Write(string value, ConsoleColor foregroundColor);
        bool Write(string value, ConsoleColor foregroundColor,
            ConsoleColor backgroundColor);
        bool Write(string value, bool newLine);
        bool Write(string value, bool newLine, ConsoleColor foregroundColor);
        bool Write(string value, bool newLine, ConsoleColor foregroundColor,
            ConsoleColor backgroundColor);

        bool WriteFormat(StringPairList list, bool newLine,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor);

        bool WriteLine(string value, ConsoleColor foregroundColor);
        bool WriteLine(string value, ConsoleColor foregroundColor,
            ConsoleColor backgroundColor);

        bool BeginSection(string name, IClientData clientData);
        bool EndSection(string name, IClientData clientData);

        bool BeginBox(string name, StringPairList list, IClientData clientData);
        bool EndBox(string name, StringPairList list, IClientData clientData);

        bool WriteBox(string name, string value, IClientData clientData,
            bool newLine, bool restore, ref int left, ref int top);
        bool WriteBox(string name, string value, IClientData clientData,
            bool newLine, bool restore, ref int left, ref int top,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor);
        bool WriteBox(string name, string value, IClientData clientData,
            bool newLine, bool restore, ref int left, ref int top,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor,
            ConsoleColor boxForegroundColor, ConsoleColor boxBackgroundColor);
        bool WriteBox(string name, StringPairList list, IClientData clientData,
            bool newLine, bool restore, ref int left, ref int top);
        bool WriteBox(string name, StringPairList list, IClientData clientData,
            bool newLine, bool restore, ref int left, ref int top,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor);
        bool WriteBox(string name, StringPairList list, IClientData clientData,
            bool newLine, bool restore, ref int left, ref int top,
            ConsoleColor foregroundColor, ConsoleColor backgroundColor,
            ConsoleColor boxForegroundColor, ConsoleColor boxBackgroundColor);
    }
}
