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

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

class QMenuBar;



class FancyTitleBar;
class FancyQuickAccessBar;
class FancyBarPrivate;

class FRAMELESS_SHARED_EXPORT FancyBar : public QWidget
{
    Q_OBJECT
public:
    enum AdditionalControlPosition {
        TitlePosition, MenuPosition
    };

    enum FancyStyle{
        WindowStyle, ClassicStyle, MergedStyle, DialogStyle
    };

    explicit FancyBar(QWidget *parent);
    ~FancyBar();

    FancyTitleBar *titleBar() const;

    QMenuBar* menuBar() const;
    void showMenuBar(bool show = false);
    bool isMenuBarVisible() const;

    FancyQuickAccessBar* quickAccessBar() const;
    void showQuickAccess(bool show = true);
    bool isQuickAccessVisible() const;

    void setHoverColor(const QColor &color);
    void setPressColor(const QColor &color);
    void setTextColor(const QColor &color);
    void setBackgroundColor(const QColor &color);

    void addAdditionalControl(QAction *action, AdditionalControlPosition position);
    void addAdditionalControl(QWidget *widget, AdditionalControlPosition position);
    void setApplicationWidget(const QString &label, QWidget *widget);
    void setApplicationButtonBkColor(const QColor &color);

    void setWidgetResizable(bool resizable);
    void setTitleBarHeight(int height);
    void setLogoButtonSize(QSize size);
    void setLogoButtonIconSize(QSize size);

    void setFancyStyle(FancyStyle style);
    void updateWidgetFlags();

    void setWidgetInMiddle(QWidget* widget);
signals:
    void maximizationChanged(bool maximized);

private:
    FancyBarPrivate *d;
};



#endif // FANCYBAR_H
