Sayonara Player
DirectoryTreeView.h
1 /* DirectoryTreeView.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 DIRECTORYTREEVIEW_H
24 #define DIRECTORYTREEVIEW_H
25 
26 #include "Helper/Settings/SayonaraClass.h"
27 #include "Helper/MetaData/MetaDataList.h"
28 
29 #include <QTreeView>
30 #include <QModelIndexList>
31 
32 class LibraryContextMenu;
35  public QTreeView,
36  private SayonaraClass
37 {
38 
39  Q_OBJECT
40 
41 signals:
42  void sig_info_clicked();
43  void sig_delete_clicked();
44  void sig_play_next_clicked();
45  void sig_append_clicked();
46 
47 public:
48  DirectoryTreeView(QWidget* parent=nullptr);
49 
50  AbstractSearchFileTreeModel* get_model() const;
51 
52  QModelIndexList get_selected_rows() const;
53  MetaDataList read_metadata() const;
54  QStringList get_filelist() const;
55 
56 private:
57  LibraryContextMenu* _context_menu=nullptr;
58  AbstractSearchFileTreeModel* _model = nullptr;
59 
60 private:
61  void mousePressEvent(QMouseEvent* event) override;
62  void init_context_menu();
63 
64 
65 private slots:
66  void _sl_library_path_changed();
67 
68 };
69 
70 #endif // DIRECTORYTREEVIEW_H
Definition: DirectoryTreeView.h:34
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:31
Definition: MetaDataList.h:46
Definition: LibraryContextMenu.h:33
Definition: SearchableFileTreeView.h:32