Sayonara Player
PlaylistTabWidget.h
1 /* PlaylistTabWidget.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 PLAYLISTTABWIDGET_H
24 #define PLAYLISTTABWIDGET_H
25 
26 
27 #include "Helper/Settings/SayonaraClass.h"
28 #include "PlaylistMenuEntry.h"
29 
30 
31 #include <QTabWidget>
32 #include <QLineEdit>
33 #include <QMenu>
34 #include <QAction>
35 #include <QMouseEvent>
36 
37 class PlaylistTabBar;
38 class MetaDataList;
39 class PlaylistTabWidget : public QTabWidget
40 {
41  Q_OBJECT
42 
43 signals:
44  void sig_tab_reset(int tab_idx);
45  void sig_tab_save(int tab_idx);
46  void sig_tab_save_as(int tab_idx, const QString& name);
47  void sig_tab_rename(int tab_idx, const QString& name);
48  void sig_tab_delete(int tab_idx);
49  void sig_tab_clear(int tab_idx);
50  void sig_add_tab_clicked();
51  void sig_metadata_dropped(int tab_idx, const MetaDataList& v_md);
52 
53 
54 public:
55  PlaylistTabWidget(QWidget* parent=nullptr);
57 
58  void show_tabbar();
59  void hide_tabbar();
60 
61  void show_menu_items(PlaylistMenuEntries actions);
62 
63  void removeTab(int index);
64  void addTab(QWidget *widget, const QIcon &icon, const QString &label);
65  void addTab(QWidget *widget, const QString &);
66  void insertTab(int index, QWidget *widget, const QString &);
67  void insertTab(int index, QWidget *widget, const QIcon &icon, const QString &label);
68 
69  bool was_drag_from_playlist() const;
70  int get_drag_origin_tab() const;
71 
72 private:
73  PlaylistTabBar* _tab_bar=nullptr;
74 
75 private:
76  void check_last_tab();
77 
78 
79 };
80 
81 #endif // PLAYLISTTABWIDGET_H
Definition: PlaylistTabBar.h:39
Definition: MetaDataList.h:46
Definition: PlaylistTabWidget.h:39