File indexing completed on 2024-05-19 04:48:39

0001 /****************************************************************************************
0002  * Copyright (c) 2008 Nikolaj Hald Nielsen <nhn@kde.org>                                *
0003  * Copyright (c) 2010 Bart Cerneels <bart.cerneels@kde.org>                             *
0004  * Copyright (c) 2011 Ralf Engels <ralf-engels@gmx.de>                                  *
0005  *                                                                                      *
0006  * This program is free software; you can redistribute it and/or modify it under        *
0007  * the terms of the GNU General Public License as published by the Free Software        *
0008  * Foundation; either version 2 of the License, or (at your option) any later           *
0009  * version.                                                                             *
0010  *                                                                                      *
0011  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0013  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0014  *                                                                                      *
0015  * You should have received a copy of the GNU General Public License along with         *
0016  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0017  ****************************************************************************************/
0018 
0019 #ifndef DYNAMICVIEW_H
0020 #define DYNAMICVIEW_H
0021 
0022 #include "widgets/PrettyTreeView.h"
0023 
0024 #include <QMutex>
0025 
0026 class QKeyEvent;
0027 class QMouseEvent;
0028 class QContextMenuEvent;
0029 
0030 namespace PlaylistBrowserNS {
0031 
0032 class DynamicView : public Amarok::PrettyTreeView
0033 {
0034 Q_OBJECT
0035 public:
0036     explicit DynamicView( QWidget *parent = nullptr );
0037     ~DynamicView() override;
0038 
0039 Q_SIGNALS:
0040     void currentItemChanged( const QModelIndex &current );
0041 
0042 public Q_SLOTS:
0043     void addPlaylist();
0044     void addToSelected();
0045     void cloneSelected();
0046     void editSelected();
0047     void removeSelected();
0048 
0049 protected Q_SLOTS:
0050     void expandRecursive(const QModelIndex &index);
0051     void collapseRecursive(const QModelIndex &index);
0052 
0053 protected:
0054     void keyPressEvent( QKeyEvent *event ) override;
0055     void mouseDoubleClickEvent( QMouseEvent *event ) override;
0056 
0057     void contextMenuEvent( QContextMenuEvent* event ) override;
0058 };
0059 
0060 } // namespace PlaylistBrowserNS
0061 
0062 #endif // DYNAMICVIEW_H