/*
*  Naamari - an AES/SHA-based manual file crypto-synchronizer for cloud transfers
*  Copyright (c) 2015-2017 Sunkware
*  Key FP = 6B6D C8E9 3438 6E9C 3D97  56E5 2CE9 A476 99EF 28F6
*
*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*  See the GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*  ----------------------------------------------------------------
*  WWW:       sunkware.org
*  E-mail:    sunkware@gmail.com
*  ----------------------------------------------------------------
*/

#ifndef CONSOLE_H
#define CONSOLE_H

#include "defines.h"

#define        EGA_BLACK           (0)
#define        EGA_BLUE            (1)
#define        EGA_GREEN           (2)
#define        EGA_CYAN            (3)
#define        EGA_RED             (4)
#define        EGA_MAGENTA         (5)
#define        EGA_BROWN           (6)
#define        EGA_GREY            (7)
#define        EGA_DARKGREY        (8)
#define        EGA_LIGHTBLUE       (9)
#define        EGA_LIGHTGREEN      (10)
#define        EGA_LIGHTCYAN       (11)
#define        EGA_LIGHTRED        (12)
#define        EGA_LIGHTMAGENTA    (13)
#define        EGA_YELLOW          (14)
#define        EGA_WHITE           (15)

#define        TEXTCOLOR_DEFAULT   EGA_GREY
#define        BACKCOLOR_DEFAULT   EGA_BLACK

#define        HELPCOLOR_DEFAULT               EGA_YELLOW
#define        INPUTCOLOR_DEFAULT              EGA_WHITE
#define        SUCCESSCOLOR_DEFAULT            EGA_GREEN
#define        FAILURECOLOR_DEFAULT            EGA_LIGHTRED
#define        BRACKETCOLOR_DEFAULT            EGA_MAGENTA
#define        TIMECOLOR_DEFAULT               EGA_BROWN
#define        SIZECOLOR_DEFAULT               EGA_CYAN
#define        SHADECOLOR_DEFAULT              EGA_DARKGREY
#define        ACTIONCOLOR_DEFAULT             EGA_LIGHTMAGENTA

#define        CR_ASCII_CODE             (0xD)
#define        LF_ASCII_CODE             (0xA)


namespace commander
{

namespace Console
{


int            getKey(void);

void           setTextAttr(quint8 textColor, quint8 backColor);

QString        getLine(QString prompt = ">", quint8 textColor = INPUTCOLOR_DEFAULT, quint8 backColor = BACKCOLOR_DEFAULT);

void           put(QString qStr, quint8 textColor = TEXTCOLOR_DEFAULT, quint8 backColor = BACKCOLOR_DEFAULT);
void           LF(void); // "Line Feed" --- start next line
void           putLine(QString qStr, quint8 textColor = TEXTCOLOR_DEFAULT, quint8 backColor = BACKCOLOR_DEFAULT);

void           putOutcome(bool state, quint8 successTextColor = SUCCESSCOLOR_DEFAULT, quint8 failureTextColor = FAILURECOLOR_DEFAULT, quint8 backColor = BACKCOLOR_DEFAULT);
void           putHelp(QString qStr, quint8 textColor = HELPCOLOR_DEFAULT, quint8 backColor = BACKCOLOR_DEFAULT);
void           putFailure(QString qStr, quint8 textColor = FAILURECOLOR_DEFAULT, quint8 backColor = BACKCOLOR_DEFAULT);

} // namespace "Console"

} // namespace "commander"

#endif // CONSOLE_H
