15 * |
15 * |
16 */ |
16 */ |
17 #ifndef IRAPPLICATION_H |
17 #ifndef IRAPPLICATION_H |
18 #define IRAPPLICATION_H |
18 #define IRAPPLICATION_H |
19 |
19 |
20 #include <QObject> |
|
21 #include <QEvent> |
20 #include <QEvent> |
22 #include <hbglobal.h> |
21 #include <hbglobal.h> |
|
22 #include <xqserviceprovider.h> |
|
23 |
23 #include "irqevent.h" |
24 #include "irqevent.h" |
24 #include "irviewdefinitions.h" |
25 #include "irviewdefinitions.h" |
25 |
26 |
26 |
27 |
27 |
28 |
28 class IRAbstractViewManager; |
29 class IRViewManager; |
29 class IRQIsdsClient; |
30 class IRQIsdsClient; |
30 class IRPlayController; |
31 class IRPlayController; |
31 class IRQSettings; |
32 class IRQSettings; |
32 class IRMediaKeyObserver; |
33 class IRMediaKeyObserver; |
33 class IRLastPlayedStationInfo; |
34 class IRLastPlayedStationInfo; |
34 class IRQFavoritesDB; |
35 class IRQFavoritesDB; |
35 class IRQNetworkController; |
36 class IRQNetworkController; |
36 class IRQNwkInfoObserver; |
|
37 class IRQStatisticsReporter; |
|
38 class IRQMusicShop; |
|
39 class IRQDiskSpaceWatcher; |
37 class IRQDiskSpaceWatcher; |
40 class QLocalServer; |
38 class QLocalServer; |
41 class IRQAdvClient; |
39 class IRQAdvClient; |
42 class HbMessageBox; |
40 class HbProgressDialog; |
|
41 class IRQSystemEventHandler; |
|
42 class XQSharableFile; |
|
43 class IRPlayList; |
43 |
44 |
44 #ifdef LOCALIZATION |
45 #ifdef LOCALIZATION |
45 class QTranslator; |
46 class QTranslator; |
46 #endif |
47 #endif |
47 |
48 |
48 class IRApplication : public QObject |
49 class IRApplication : public XQServiceProvider |
49 { |
50 { |
50 Q_OBJECT |
51 Q_OBJECT |
51 |
52 |
52 public: |
53 public: |
53 explicit IRApplication(IRAbstractViewManager *aViewManager); |
54 IRApplication(IRViewManager *aViewManager, IRQSystemEventHandler* aSystemEventHandler); |
|
55 |
54 ~IRApplication(); |
56 ~IRApplication(); |
55 |
57 |
56 bool verifyNetworkConnectivity(const QString &aConnectingText = hbTrId("Connecting to server...")); |
58 bool verifyNetworkConnectivity(const QString &aConnectingText = hbTrId("Connecting to server...")); |
57 |
59 |
58 void createConnectingDialog(); |
60 void createConnectingDialog(); |
59 |
61 |
60 void closeConnectingDialog(); |
62 void closeConnectingDialog(); |
61 |
63 |
62 IRAbstractViewManager* getViewManager() const; |
64 IRViewManager* getViewManager() const; |
63 IRQNetworkController* getNetworkController(); |
65 IRQNetworkController* getNetworkController(); |
64 IRQIsdsClient* getIsdsClient(); |
66 IRQIsdsClient* getIsdsClient(); |
65 IRPlayController* getPlayController(); |
67 IRPlayController* getPlayController(); |
66 IRLastPlayedStationInfo* getLastPlayedStationInfo(); |
68 IRLastPlayedStationInfo* getLastPlayedStationInfo(); |
67 IRQFavoritesDB* getFavoritesDB(); |
69 IRQFavoritesDB* getFavoritesDB(); |
68 IRQSettings * getSettings(); |
70 IRQSettings * getSettings(); |
69 IRMediaKeyObserver* getMediaKeyObserver(); |
71 IRMediaKeyObserver* getMediaKeyObserver(); |
70 IRQNwkInfoObserver* getNwkInfoObserver(); |
72 IRQAdvClient* getAdvClient(); |
71 IRQStatisticsReporter* getStatisticsReporter(); |
73 IRPlayList* getPlayList() const; |
72 IRQMusicShop* getMusicShop(); |
74 |
73 IRQAdvClient* getAdvClient(); |
75 #ifdef LOCALIZATION |
|
76 /* |
|
77 * this function will take ownership of the translator |
|
78 */ |
|
79 void setTranslator(QTranslator* aTranslator); |
|
80 #endif |
74 |
81 |
75 //from QObject |
82 //from QObject |
76 bool event(QEvent* e); |
83 bool event(QEvent* e); |
77 |
84 |
78 #ifdef _DEBUG |
85 #ifdef _DEBUG |
79 public: |
86 public: |
80 bool iTestPreferredBitrate; |
87 bool iTestPreferredBitrate; |
81 #endif |
88 #endif |
82 |
89 |
|
90 public slots: |
|
91 void view(const QString &aFileName); |
|
92 void view(const XQSharableFile &aSharableFile); |
|
93 |
83 signals: |
94 signals: |
84 void quit(); |
95 void quit(); |
85 |
96 |
86 private slots: |
97 private slots: |
87 //connect to signal 'networkEventNotified' from IRQNetworkController |
98 //connect to signal 'networkEventNotified' from IRQNetworkController |
88 void networkEventNotified(IRQNetworkEvent aEvent); |
99 void networkEventNotified(IRQNetworkEvent aEvent); |
89 void cancelConnect(); |
100 void cancelConnect(); |
90 void loadGenre(); |
101 void loadGenre(); |
91 void newLocalSocketConnection(); |
102 void newLocalSocketConnection(); |
92 void handleDiskSpaceLow(qint64 aCriticalLevel); |
103 void handleDiskSpaceLow(qint64 aCriticalLevel); |
|
104 void handleTermsConsAccepted(); |
93 |
105 |
94 private: |
106 private: |
95 void createComponents(); |
107 void createComponents(); |
96 void destroyComponents(); |
108 void destroyComponents(); |
97 void setupConnection(); |
109 void setupConnection(); |
98 void setLaunchView(); |
110 void setLaunchView(); |
99 void launchStartingView(); |
111 void launchStartingView(TIRViewId aViewId); |
100 void startMonitoringNwkInfo(); |
112 void startSystemEventMonitor(); |
101 void startMonitoringDiskSpace(); |
|
102 void initApp(); |
113 void initApp(); |
103 void setExitingView(); |
114 void setExitingView(); |
104 |
115 |
105 TIRHandleResult handleConnectionEstablished(); |
116 TIRHandleResult handleConnectionEstablished(); |
106 |
117 |
107 void startLocalServer(); |
118 void startLocalServer(); |
108 |
119 bool eventFilter(QObject *object, QEvent *event); |
109 #ifdef LOCALIZATION |
|
110 void initLanguage(); |
|
111 #endif |
|
112 |
120 |
113 #ifdef _DEBUG |
121 #ifdef _DEBUG |
114 void readConfiguration(); |
122 void readConfiguration(); |
115 #endif |
123 #endif |
116 |
124 |
117 private: |
125 private: |
118 IRAbstractViewManager* iViewManager; |
126 IRViewManager* iViewManager; |
|
127 |
|
128 TIRViewId iStartingViewId; |
119 |
129 |
120 IRQNetworkController* iNetworkController; |
130 IRQNetworkController* iNetworkController; |
121 |
131 |
122 IRQIsdsClient* iIsdsClient; |
132 IRQIsdsClient* iIsdsClient; |
123 |
133 |