Skip to content
Snippets Groups Projects
Printer.hpp 2.3 KiB
Newer Older
Philip Müller's avatar
Philip Müller committed
/*
 *  This file is part of the mhwd - Manjaro Hardware Detection project
 *  
dec's avatar
dec committed
 *  mhwd - Manjaro Hardware Detection
 *  Roland Singer <roland@manjaro.org>
 *  Łukasz Matysiak <december0123@gmail.com>
Philip Müller's avatar
Philip Müller committed
 *  Filipe Marques <eagle.software3@gmail.com>
Philip Müller's avatar
Philip Müller committed
 *
dec's avatar
dec committed
 *  Copyright (C) 2007 Free Software Foundation, Inc.
 *
 *  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/>.
Philip Müller's avatar
Philip Müller committed
 */

#ifndef PRINTER_HPP_
#define PRINTER_HPP_

Łukasz Matysiak's avatar
Łukasz Matysiak committed
#include <hd.h>

december0123's avatar
december0123 committed
#include <string>
#include <vector>

Philip Müller's avatar
Philip Müller committed
#include "Config.hpp"
#include "Device.hpp"
#include "Enums.hpp"

class Printer
{
public:
    void printStatus(std::string statusMsg) const;
    void printError(std::string errorMsg) const;
    void printWarning(std::string warningMsg) const;
    void printMessage(MHWD::MESSAGETYPE type, std::string str) const;
    void printHelp() const;
    void printVersion(std::string versionMhwd, std::string yearCopy) const;
Philip Müller's avatar
Philip Müller committed
    void listDevices(const std::vector<std::shared_ptr<Device>>& devices,
            std::string typeOfDevice) const;
december0123's avatar
december0123 committed
    void listConfigs(const std::vector<std::shared_ptr<Config>>& configs,
    void printAvailableConfigsInDetail(const std::string& deviceType,
december0123's avatar
december0123 committed
            const std::vector<std::shared_ptr<Device>>& devices) const;
december0123's avatar
december0123 committed
    void printInstalledConfigs(const std::string& deviceType,
december0123's avatar
december0123 committed
            const std::vector<std::shared_ptr<Config>>& installedConfigs) const;
Philip Müller's avatar
Philip Müller committed
    void printConfigDetails(const Config& config) const;
    void printDeviceDetails(hw_item hw, FILE *f = stdout) const;
december0123's avatar
december0123 committed
private:
    void printLine() const;
dec's avatar
dec committed
    const char* CONSOLE_COLOR_RESET {"\033[m"};
    const char* CONSOLE_RED_MESSAGE_COLOR {"\033[1m\033[31m"};
dec's avatar
dec committed
    const char* CONSOLE_TEXT_OUTPUT_COLOR {"\033[0;32m"};
Philip Müller's avatar
Philip Müller committed
};

#endif /* PRINTER_HPP_ */