Warning, file /multimedia/amarok/src/amarokurls/BookmarkTreeView.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /**************************************************************************************** 0002 * Copyright (c) 2008 Nikolaj Hald Nielsen <nhn@kde.org> * 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 BOOKMARKTREEVIEW_H 0018 #define BOOKMARKTREEVIEW_H 0019 0020 #include "amarok_export.h" 0021 #include "AmarokUrl.h" 0022 #include "BookmarkModel.h" 0023 #include "BookmarkViewItem.h" 0024 #include "widgets/PrettyTreeView.h" 0025 0026 #include <QSortFilterProxyModel> 0027 0028 class QMenu; 0029 0030 class QAction; 0031 0032 class QAction; 0033 0034 class AMAROK_EXPORT BookmarkTreeView : public QTreeView 0035 { 0036 Q_OBJECT 0037 0038 public: 0039 explicit BookmarkTreeView( QWidget *parent = nullptr ); 0040 ~BookmarkTreeView() override; 0041 0042 void setNewGroupAction( QAction * action ); 0043 QMenu* contextMenu( const QPoint& point ); 0044 0045 void setProxy( QSortFilterProxyModel *proxy ); 0046 void slotEdit( const QModelIndex &index ); 0047 0048 protected: 0049 void keyPressEvent( QKeyEvent *event ) override; 0050 void mouseDoubleClickEvent( QMouseEvent *event ) override; 0051 void contextMenuEvent( QContextMenuEvent *event ) override; 0052 void resizeEvent( QResizeEvent *event ) override; 0053 bool viewportEvent( QEvent *event ) override; 0054 0055 protected Q_SLOTS: 0056 void slotLoad(); 0057 void slotDelete(); 0058 void slotRename(); 0059 0060 0061 //for testing... 0062 void slotCreateTimecodeTrack() const; 0063 0064 void slotSectionResized( int logicalIndex, int oldSize, int newSize ); 0065 void slotSectionCountChanged( int oldCount, int newCount ); 0066 0067 void selectionChanged ( const QItemSelection & selected, const QItemSelection & deselected ) override; 0068 0069 Q_SIGNALS: 0070 void bookmarkSelected( AmarokUrl bookmark ); 0071 void showMenu( QMenu*, const QPointF& ); 0072 0073 private: 0074 QSet<BookmarkViewItemPtr> selectedItems() const; 0075 QList<QAction *> createCommonActions( const QModelIndexList &indices ); 0076 0077 QAction *m_loadAction; 0078 QAction *m_deleteAction; 0079 0080 //for testing... 0081 QAction *m_createTimecodeTrackAction; 0082 0083 QAction *m_addGroupAction; 0084 0085 QMap<BookmarkModel::Column, qreal> m_columnsSize; 0086 0087 QSortFilterProxyModel * m_proxyModel; 0088 }; 0089 0090 #endif