#ifndef WINDOWTITLE_H
#define WINDOWTITLE_H

#include <QWidget>
#include <QMenu>

namespace Ui {
class WindowTitle;
}

class WindowTitle : public QWidget
{
    Q_OBJECT
signals:
    // log
    void info(QString); void warn(QString);
    void error(QString); void debug(QString);

    void close();
    void max();
    void min();
public:
    explicit WindowTitle(QWidget *parent = nullptr);
    ~WindowTitle();
public:
    void onlyShowButton();
    void onlyShowLogo();
    void onlyShowInDialog();
    void onlyVisibleClose(bool);

public slots:
    void onWindowIconChange(QIcon);
    void onWindowTitleChange(QString);
    void onWindowShowMaxed(bool);
    void setIsTabletMode(bool);
protected:
    bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
private:
    bool             m_bShowTitle;
    bool             m_bAppRunning;
    QMenu           *m_oMenu;
    QAction         *m_oActionSelf;
    QAction         *m_oActionMax;
    QAction         *m_oActionMin;
    QAction         *m_oActionClose;
private:
    Ui::WindowTitle *ui;
};

#endif // WINDOWTITLE_H
