File indexing completed on 2025-01-05 04:25:44

0001 /****************************************************************************************
0002  * Copyright (c) 2010 Rainer Sigle <rainer.sigle@web.de>                                *
0003  *                                                                                      *
0004  * This program is free software; you can redistribute it and/or modify it under        *
0005  * the terms of the GNU General Public License as published by the Free Software        *
0006  * Foundation; either version 2 of the License, or (at your option) any later           *
0007  * version.                                                                             *
0008  *                                                                                      *
0009  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0010  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0011  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0012  *                                                                                      *
0013  * You should have received a copy of the GNU General Public License along with         *
0014  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0015  ****************************************************************************************/
0016 
0017 #ifndef AMAROK_TabsVIEW_H
0018 #define AMAROK_TabsVIEW_H
0019 
0020 #include <QGraphicsProxyWidget>
0021 #include <QStandardItemModel>
0022 
0023 class TabsItem;
0024 class TabsTreeView;
0025 
0026 class QModelIndex;
0027 namespace Plasma
0028 {
0029     class ScrollBar;
0030     class TextBrowser;
0031 }
0032 
0033 class TabsView : public QGraphicsProxyWidget
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     explicit TabsView( QGraphicsWidget *parent = nullptr );
0039     ~TabsView();
0040 
0041     void appendTab( TabsItem *tabsItem );
0042     void clear();
0043     void clearTabBrowser();
0044 
0045 public Q_SLOTS:
0046     void showTab( TabsItem *tab );
0047 
0048 protected:
0049     void resizeEvent( QGraphicsSceneResizeEvent *event );
0050 
0051 private Q_SLOTS:
0052     void itemClicked( const QModelIndex &index );
0053     void slotScrollBarRangeChanged( int min, int max );
0054 
0055 private:
0056     Plasma::TextBrowser *m_tabTextBrowser;
0057     TabsTreeView *m_treeView;
0058     QGraphicsProxyWidget *m_treeProxy;
0059     QStandardItemModel *m_model;
0060 
0061     void updateScrollBarVisibility();
0062     Plasma::ScrollBar *m_scrollBar;
0063 };
0064 
0065 #endif // multiple inclusion guard