Add mce-dev into control build templates for dbus support
[vlc-remote] / src / playermainwindow.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 PLAYERMAINWINDOW_H
19 #define PLAYERMAINWINDOW_H
20
21 #include <QMainWindow>
22 #include <QtNetwork>
23 #include <QtXml>
24 #include <QTimer>
25 #include "playlistmainwindow.h"
26 #include "browsemainwindow.h"
27 #include "favouritesmainwindow.h"
28 #include "vlcstatus.h"
29 #if defined(Q_WS_S60) || defined(Q_WS_MAEMO_5)
30   #include <mce/dbus-names.h>
31   #include <mce/mode-names.h>
32   #include <QDBusConnection>
33   #include <QDBusMessage>
34   #include <QDBusInterface>
35 #endif
36
37 namespace Ui {
38     class PlayerMainWindow;
39 }
40
41 class PlayerMainWindow : public QMainWindow {
42     Q_OBJECT
43 public:
44     explicit PlayerMainWindow(QWidget *parent = 0);
45     ~PlayerMainWindow();
46
47 public slots:
48     void displayStateChanged(const QDBusMessage &message);
49     void askStatus();
50     void showSettings();
51     void showConfig();
52     void showAbout();
53     void showFavourites();
54     void play();
55     void playpause();
56     void stop();
57     void pause();
58     void previous();
59     void next();
60     void fullscreen();
61     void volUp();
62     void volDown();
63     void volMute();
64     void slide(int value);
65     void updateUiWithCurrentStatus();
66     void setCoverArt(const QByteArray data);
67     void setCoverArtFromPixmap(QPixmap image);
68     void getCoverArt(int id);
69     void finished(QNetworkReply * reply);
70     void error(QNetworkReply::NetworkError code);
71     void readReady();
72     void updateFromSettings();
73     void orientationChanged();
74     void setPortrait();
75     void setLandscape();
76     void setAutoRotate();
77     void playlistIdUpdated(int id, bool hasart, QString extension);
78
79
80 protected slots:
81     void parseXmlStatus();
82
83 protected:
84     void changeEvent(QEvent *e);
85     void closeEvent(QCloseEvent *);
86
87
88 private:
89     Ui::PlayerMainWindow *ui;
90     PlayListMainWindow * mPlayListMainWindow;
91     BrowseMainWindow * mBrowserMainWindow;
92     FavouritesMainWindow * mFavouritesMainWindow;
93     QNetworkAccessManager * mNetManager;
94     QString mIp;
95     QTimer * mTimer;
96     int mVolume;
97     int mMuted;
98     VlcStatus mCurrentStatus;
99     QByteArray mResponse;
100     bool mIsLandscape;
101     bool mHasImage;
102     bool mIsFirstStatusCall;
103     static QDBusConnection dBusConnection;
104     static QDBusInterface* dBusInterface;
105 };
106
107 #endif // PLAYERMAINWINDOW_H