/* -*- Mode: C++; indent-tabs-mode: nil; tab-width: 4 -*-
 * -*- coding: utf-8 -*-
 *
 * Copyright (C) 2025 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * the Free Software Foundation, either version 3 of the License, or
 * 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/>.
 */

#ifndef AUDIO_H
#define AUDIO_H

#include <QWidget>
#include <QObject>
#include <QtPlugin>
#include <QProcess>
#include <ukcc/interface/interface.h>
#include <QTranslator>
#include <QtCore/qglobal.h>

#include "Ukui4SwitchButtonItem.h"
#include "Ukui4VolumeSliderItem.h"
#include "Ukui4SelectComboxItem.h"

#if defined(LIBUKCC_LIBRARY)
#  define LIBUKCC_EXPORT Q_DECL_EXPORT
#else
#  define LIBUKCC_EXPORT Q_DECL_IMPORT
#endif

namespace Ui {
class Audio;
}

class Audio : public QObject, CommonInterface
{
    Q_OBJECT
    Q_PLUGIN_METADATA(IID "org.ukcc.CommonInterface")
    Q_INTERFACES(CommonInterface)

public:
    Audio();
    ~Audio() = default;

public:
    QString plugini18nName()        Q_DECL_OVERRIDE;

    int pluginTypes()               Q_DECL_OVERRIDE;

    QWidget* pluginUi()             Q_DECL_OVERRIDE;

    bool isEnable() const           Q_DECL_OVERRIDE;

    const QString name() const      Q_DECL_OVERRIDE;

    bool isShowOnHomePage() const   Q_DECL_OVERRIDE;

    QIcon icon() const              Q_DECL_OVERRIDE;

    QString translationPath() const Q_DECL_OVERRIDE;

private:
    void initSearchText(); // 搜索翻译

private:
    QString m_pluginName = "";
    int m_pluginType = SYSTEM;
    QWidget* m_pWidget = nullptr;
    bool m_firstLoad = true;
//    std::unordered_map<SwitchButtonType, QString> m_switchButtonkeys {
//        {SwitchButtonType::SWITCH_BUTTON_VOLUMEBOOST, tr("Volume Increase")},
//        {SwitchButtonType::SWITCH_BUTTON_MONO, tr("Mono Audio")},
//        {SwitchButtonType::SWITCH_BUTTON_ECHOCANCEL, tr("Noise Reduction")},
//        {SwitchButtonType::SWITCH_BUTTON_LOOPBACK, tr("Voice Monitor")},
//        {SwitchButtonType::SWITCH_BUTTON_STARTUP, tr("Startup Misic")},
//        {SwitchButtonType::SWITCH_BUTTON_POWEROFF, tr("Poweroff Music")},
//        {SwitchButtonType::SWITCH_BUTTON_LOGOUT, tr("Logout Music")},
//        {SwitchButtonType::SWITCH_BUTTON_WAKEUP, tr("Wakeup Music")},
//        {SwitchButtonType::SWITCH_BUTTON_ALERT, tr("Beep Switch")}
//    };

//    std::unordered_map<VolumeSliderType, QString> m_volumeSliderKeys {
//        {VolumeSliderType::VOLUME_SLIDER_INPUT, tr("Volume")},
//        {VolumeSliderType::VOLUME_SLIDER_OUTPUT, tr("Master Volume")},
//        {VolumeSliderType::VOLUME_SLIDER_INPUTLEVEL, tr("Input Level")},
//        {VolumeSliderType::VOLUME_SLIDER_BALANCE, tr("Balance")}
//    };

//    std::unordered_map<SelectComboxType, QString> m_selectComboxKeys {
//        {SelectComboxType::SELECT_COMBOX_INPUT, tr("Input Device")},
//        {SelectComboxType::SELECT_COMBOX_OUTPUT, tr("Output Device")},
//        {SelectComboxType::SELECT_COMBOX_SOUNDEFFECT, tr("Sound Theme")},
//        {SelectComboxType::SELECT_COMBOX_VOLUMEADJUST, tr("Volume Control Sound")},
//        {SelectComboxType::SELECT_COMBOX_NOTIFICTION, tr("Notification Sound")}
//    };
};

#endif // AUDIO_H
