Began refactoring settings handling.
[vlc-remote] / browsemainwindow.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 BROWSEMAINWINDOW_H
19 #define BROWSEMAINWINDOW_H
20
21 #include <QMainWindow>
22 #include <QtNetwork>
23 #include <QtXml>
24 #include <QListWidgetItem>
25 #include "vlcbrowseelement.h"
26
27 namespace Ui {
28     class BrowseMainWindow;
29 }
30
31 class BrowseMainWindow : public QMainWindow {
32     Q_OBJECT
33 public:
34     explicit BrowseMainWindow(QWidget *parent = 0);
35     ~BrowseMainWindow();
36
37 public slots:
38     void init();
39     void browseDirectory(QString);
40     void onBrowse();
41     void onPlay();
42     void onAddToPlaylist();
43     void onListSelectionChanged();
44     void finished(QNetworkReply * reply);
45     void readReady();
46     void showCurrentDirectory();
47     void setHomeFolder();
48     void showHomeFolder();
49     void setFavourite();
50     void showFavourites();
51     void setHomeDirectory();
52
53 protected slots:
54     void parseXmlDirectory();
55     void updateList();
56
57 protected:
58     void changeEvent(QEvent *e);
59     VlcBrowseElement getElementFromText(QString text);
60     void writeFile(QString path, QByteArray text);
61     QString getExtension(QString path, QString extension);
62
63 private:
64     Ui::BrowseMainWindow *ui;
65     QNetworkAccessManager * mNetManager;
66     QString mCurrentDir;
67     QString mIp;
68     QList<VlcBrowseElement>* mContents;
69     VlcBrowseElement mCurrentElement;
70     QByteArray mResponse;
71 };
72
73 #endif // BROWSEMAINWINDOW_H