Began refactoring settings handling.
[vlc-remote] / playlistmainwindow.h
1 /*   VLC-REMOTE for MAEMO 5
2 *   Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
3 *   This program is free software; you can redistribute it and/or modify
4 *   it under the terms of the GNU General Public License version 2,
5 *   or (at your option) any later version, as published by the Free
6 *   Software Foundation
7 *
8 *   This program is distributed in the hope that it will be useful,
9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details
12 *
13 *   You should have received a copy of the GNU General Public
14 *   License along with this program; if not, write to the
15 *   Free Software Foundation, Inc.,
16 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 #ifndef PLAYLISTMAINWINDOW_H
19 #define PLAYLISTMAINWINDOW_H
20
21 #include <QMainWindow>
22 #include <QTimer>
23 #include <QtNetwork>
24 #include <QtXml>
25 #include "vlcplaylistelementsimple.h"
26 #include "vlcstatus.h"
27
28 #ifndef LIST_ITEM_TYPE_OFFSET
29 #define LIST_ITEM_TYPE_OFFSET 1000
30 #endif
31
32 namespace Ui {
33     class PlayListMainWindow;
34 }
35
36 class PlayListMainWindow : public QMainWindow {
37     Q_OBJECT
38 public:
39     explicit PlayListMainWindow(QWidget *parent = 0);
40     ~PlayListMainWindow();
41     void init();
42 public slots:
43     void onClear();
44     void onShuffle();
45     void onLoop();
46     void onPlay();
47     void onRepeat();
48     void onRemove();
49     void requestPlayList();
50     void onListSelectionChanged();
51     void finished(QNetworkReply * reply);
52     void readReady();
53     void showPlayList();
54     void updateUiWithCurrentStatus(VlcStatus * status);
55
56 protected slots:
57     void parseXmlPlayList();
58     void updateList();
59
60 signals:
61     void idUpdated(int id, bool hasArt, QString extension);
62
63 protected:
64     void changeEvent(QEvent *e);
65     VlcPlayListElementSimple getElementFromText(QString text);
66     QString getExtension(QString path, QString extension);
67
68 private:
69     Ui::PlayListMainWindow *ui;
70     QTimer * mTimer;
71     QString mIp;
72     QNetworkAccessManager * mNetManager;
73     QList<VlcPlayListElementSimple>* mContents;
74     VlcPlayListElementSimple mCurrentElement;
75     int mCurrentVlcIndex;
76     int mCurrentDepth;
77     QByteArray mResponse;
78 };
79
80 #endif // PLAYLISTMAINWINDOW_H