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

#include <QWidget>
#include "frameless_global.h"



class TinyTabWidgetPrivate;
class FRAMELESS_SHARED_EXPORT TinyTabWidget : public QWidget
{
    Q_OBJECT
public:
    explicit TinyTabWidget(QWidget *parent = nullptr);
    ~TinyTabWidget();

    int addTab(QWidget *page, const QString &label);
    int addTab(QWidget *page, const QIcon &icon, const QString &label);

    enum TabPosition { North, South, West, East };
    Q_ENUM(TabPosition)
    TabPosition tabPosition() const;
    void setTabPosition(TabPosition pos);

    void setHoverColor(const QColor &color);
    QColor hoverColor() const;

    void setPressColor(const QColor &color);
    QColor pressColor() const;

    void setTextColor(const QColor &color);
    void setSelectedTextColor(const QColor &color);

    void setBackgroundColor(const QColor &color);
    void setNormalColor(const QColor &color);
    void setSlideColor(const QColor &color);

    void setTabSpace(int space);

    int currentIndex() const;
    QWidget* currentWidget() const;
    QWidget* widget(int index);

signals:
    void currentChanged(int index);

public slots:
    void setCurrentIndex(int index);
    void setCurrentWidget(QWidget *widget);

private:
    TinyTabWidgetPrivate *d;
};



#endif // TINYTABWIDGET_H
