Sayonara Player
Loading...
Searching...
No Matches
FileListView.h
1/* FileListView.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (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#ifndef FILELISTVIEW_H
22#define FILELISTVIEW_H
23
24#include "Gui/InfoDialog/InfoDialogContainer.h"
25#include "Gui/Utils/SearchableWidget/SearchableView.h"
26#include "Gui/Utils/Widgets/Dragable.h"
27
28#include "Utils/Pimpl.h"
29
30namespace Library
31{
32 class Info;
33 class InfoAccessor;
34}
35
36namespace Directory
37{
38 class FileListModel;
46 private Gui::Dragable
47 {
48 Q_OBJECT
49 PIMPL(FileListView)
50
51 signals:
52 void sigDeleteClicked();
53 void sigPlayClicked();
54 void sigPlayNewTabClicked();
55 void sigPlayNextClicked();
56 void sigAppendClicked();
57 void sigEnterPressed();
58 void sigImportRequested(LibraryId lib_id, const QStringList& files, const QString& targetDirectory);
59
60 void sigRenameRequested(const QString& old_name, const QString& newName);
61 void sigRenameByExpressionRequested(const QString& oldName, const QString& expression);
62
63 void sigCopyToLibraryRequested(LibraryId libraryId);
64 void sigMoveToLibraryRequested(LibraryId libraryId);
65
66 public:
67 explicit FileListView(QWidget* parent = nullptr);
68 ~FileListView() override;
69
70 void init(Library::InfoAccessor* libraryInfoAccessor, const Library::Info& info);
71
72 QStringList selectedPaths() const;
73
74 void setParentDirectory(const QString& dir);
75 QString parentDirectory() const;
76
77 private:
78 void initContextMenu();
79
80 private slots:
81 void renameFileClicked();
82 void renameFileByTagClicked();
83
84 protected:
85 void contextMenuEvent(QContextMenuEvent* event) override;
86
87 void dragEnterEvent(QDragEnterEvent* event) override;
88 void dragMoveEvent(QDragMoveEvent* event) override;
89 void dropEvent(QDropEvent* event) override;
90
91 void skinChanged() override;
92
93 // SayonaraSelectionView
94 int mapModelIndexToIndex(const QModelIndex& idx) const override;
95 ModelIndexRange mapIndexToModelIndexes(int idx) const override;
96
97 // InfoDialogContainer interface
98 MD::Interpretation metadataInterpretation() const override;
99 MetaDataList infoDialogData() const override;
100 bool hasMetadata() const override;
101 QStringList pathlist() const override;
102 QWidget* getParentWidget() override;
103 };
104}
105
106#endif // FILELISTVIEW_H
The FileListView class.
Definition FileListView.h:47
The Dragable class.
Definition Dragable.h:62
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition WidgetTemplate.h:86
Definition InfoDialogContainer.h:61
Definition LibraryManager.h:36
The Info class.
Definition LibraryInfo.h:38
Definition MetaDataList.h:34
Definition typedefs.h:33