Sayonara Player
FileListView.h
1 /* FileListView.h */
2 
3 /* Copyright (C) 2011-2016 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef FILELISTVIEW_H
24 #define FILELISTVIEW_H
25 
26 #include "Helper/Settings/SayonaraClass.h"
27 #include "Helper/MetaData/MetaDataList.h"
28 #include "GUI/Helper/SearchableWidget/SearchableListView.h"
29 
30 #include <QModelIndexList>
31 #include <QFileSystemModel>
32 
33 
34 class LibraryContextMenu;
35 class FileListView :
36  public SearchableListView,
37  private SayonaraClass
38 
39 {
40 
41  Q_OBJECT
42 
43 signals:
44  void sig_info_clicked();
45  void sig_delete_clicked();
46  void sig_play_next_clicked();
47  void sig_append_clicked();
48 
49 public:
50  FileListView(QWidget* parent=nullptr);
51 
52  QModelIndexList get_selected_rows() const;
53  QFileSystemModel* get_model() const override;
54  MetaDataList read_metadata() const;
55  QStringList get_filelist() const;
56 
57 private:
58  LibraryContextMenu* _context_menu=nullptr;
59  QFileSystemModel* _model=nullptr;
60 
61 private:
62  void mousePressEvent(QMouseEvent* event) override;
63  void init_context_menu();
64 
65 };
66 
67 
68 #endif // FILELISTVIEW_H
Definition: FileListView.h:35
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:31
Definition: MetaDataList.h:44
Definition: SearchableListView.h:36
Context menu used for Library and playlist windows.
Definition: LibraryContextMenu.h:37