/***************************************************************************
 **
 **  Copyright (C) 2018-2023 wangjianjun <wangjianjun1018@qq.com>
 **  Contact: https://blog.csdn.net/wocanimei007?type=blog
 **
 **
****************************************************************************/
#ifndef FANCYMODE_H
#define FANCYMODE_H

#include <QWidget>

#include <QIcon>
#include <QMenu>

#include "frameless_global.h"



class FRAMELESS_SHARED_EXPORT FancyMode : public QObject
{
    Q_OBJECT
    Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled)
public:
    explicit FancyMode(QObject *parent = nullptr);
    ~FancyMode();

    QString displayName() const { return m_displayName;}
    QIcon icon() const { return m_icon;}
    int priority() const { return m_priority; }
    bool isEnabled() const;
    QMenu *menu() const { return m_menu; }
    void setWidget(QWidget *widget) { m_widget = widget; }
    QWidget* widget();

    void setEnabled(bool enabled);
    void setDisplayName(const QString &displayName) { m_displayName = displayName;}
    void setIcon(const QIcon &icon) { m_icon = icon;}
    void setPriority(int priority) { m_priority = priority; }
    void setMenu(QMenu *menu) { m_menu = menu; }

signals:
    void enabledStateChanged(bool enabled);

private:
    QString m_displayName;
    QIcon m_icon;
    QMenu *m_menu = nullptr;
    QWidget *m_widget = nullptr;
    int m_priority = -1;
    bool m_isEnabled;
};



#endif // FANCYMODE_H
