Minor bugfixes
[someplayer] / src / playlistsortform.h
1 /*
2  * SomePlayer - An alternate music player for Maemo 5
3  * Copyright (C) 2010 Nikolay (somebody) Tischenko <niktischenko@gmail.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef PLAYLISTSORTFORM_H
21 #define PLAYLISTSORTFORM_H
22
23 #include <QWidget>
24 #include <QStandardItemModel>
25 #include <QStandardItem>
26 #include <QItemSelection>
27 #include <QItemSelectionModel>
28 #include "someplayer.h"
29 #include "playlist.h"
30 #include "trackrenderer.h"
31
32 using SomePlayer::DataObjects::Playlist;
33
34 namespace Ui {
35         class PlaylistSortForm;
36 }
37
38 class PlaylistSortForm : public QWidget
39 {
40         Q_OBJECT
41
42 public:
43         explicit PlaylistSortForm(QWidget *parent = 0);
44         ~PlaylistSortForm();
45         void setPlaylist(Playlist playlist);
46         Playlist getPlaylist();
47
48 private slots:
49         void done();
50         void updateView();
51         void _process_selection(QItemSelection,QItemSelection);
52         void moveUp();
53         void moveDown();
54         void sortAlphAsc();
55         void sortAlphDesc();
56         void sortArtist();
57         void shuffle();
58
59 public slots:
60         void landscapeMode();
61         void portraitMode();
62         void updateTranslations();
63         void updateGradiend();
64         void updateIcons();
65
66 signals:
67         void playlistChanged();
68
69 private:
70         Ui::PlaylistSortForm *ui;
71         Playlist _playlist;
72         TrackRenderer *_track_renderer;
73         QStandardItemModel *_model;
74         void _move(QList<int> rows, int diff);
75         QString _bottom_gradient;
76         QString _top_gradient;
77 };
78
79 #endif // PLAYLISTSORTFORM_H