/*
    QAD - Qt ADvanced

    Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) 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 Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef EDOCKWIDGET_H
#define EDOCKWIDGET_H

#include "qad_application_export.h"

#include <QDebug>
#include <QDockWidget>
#include <QHBoxLayout>
#include <QIcon>
#include <QLabel>
#include <QLayout>
#include <QToolButton>


class QAD_APPLICATION_EXPORT EDockWidget: public QDockWidget {
	Q_OBJECT

public:
	explicit EDockWidget(const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags());
	explicit EDockWidget(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags());
	~EDockWidget();

	void setFeatures(QDockWidget::DockWidgetFeatures features);
	void setWindowTitle(const QString & title);
	void setWindowIcon(const QIcon & icon);

	void setEmptyHeader();
	void setStandardHeader();

private:
	bool event(QEvent * e) override;
	void changeEvent(QEvent * e) override;
	void init();
	void updateStyle();

	QFrame * header        = nullptr;
	QWidget * empty_header = nullptr;
	QLabel *lbl_title = nullptr, *lbl_icon = nullptr;
	QToolButton *btn_hide = nullptr, *btn_dock = nullptr, *btn_maximize = nullptr;

private slots:
	void dockClicked();
	void maximize();
};

#endif // EDOCKWIDGET_H
