File indexing completed on 2024-04-21 05:48:15

0001 /**
0002  * SPDX-FileCopyrightText: (C) 2003 by Sébastien Laoût <slaout@linux62.org>
0003  * SPDX-License-Identifier: GPL-2.0-or-later
0004  */
0005 
0006 #ifndef DECORATEDBASKET_H
0007 #define DECORATEDBASKET_H
0008 
0009 class QString;
0010 class BasketScene;
0011 class QVBoxLayout;
0012 class QGraphicsView;
0013 
0014 #include <QWidget>
0015 
0016 #include "filter.h"
0017 
0018 class KMessageWidget;
0019 
0020 /** This class handle Basket and add a FilterWidget on top of it.
0021  * @author Sébastien Laoût
0022  */
0023 class DecoratedBasket : public QWidget
0024 {
0025     Q_OBJECT
0026 public:
0027     DecoratedBasket(QWidget *parent, const QString &folderName);
0028     ~DecoratedBasket() override  = default;
0029     void setFilterBarPosition(bool onTop);
0030     void resetFilter();
0031     void setFilterBarVisible(bool show, bool switchFocus = true);
0032     bool isFilterBarVisible()
0033     {
0034         return m_filter->isVisible();
0035     }
0036     const FilterData &filterData()
0037     {
0038         return m_filter->filterData();
0039     }
0040     FilterBar *filterBar()
0041     {
0042         return m_filter;
0043     }
0044     BasketScene *basket()
0045     {
0046         return m_basket;
0047     }
0048 
0049     void resizeEvent(QResizeEvent *event) override;
0050 
0051 public Q_SLOTS:
0052     void showErrorMessage(const QString &errorMessage);
0053 
0054 private:
0055     QVBoxLayout *m_layout;
0056     FilterBar *m_filter;
0057 
0058     KMessageWidget *m_messageWidget = nullptr;
0059     BasketScene *m_basket;
0060 };
0061 #endif // DECORATEDBASKET_H