qtinternetradio/ui/inc/irapplication.h
changeset 0 09774dfdd46b
child 3 ee64f059b8e1
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #ifndef IRAPPLICATION_H
       
    18 #define IRAPPLICATION_H
       
    19 
       
    20 #include <QObject>
       
    21 #include <QEvent>
       
    22 #include <hbglobal.h>
       
    23 #include "irqevent.h"
       
    24 #include "irviewdefinitions.h"
       
    25 
       
    26  
       
    27 
       
    28 class IRAbstractViewManager;
       
    29 class IRQIsdsClient;
       
    30 class IRPlayController;     
       
    31 class IRQSettings;
       
    32 class IRMediaKeyObserver;
       
    33 class IRLastPlayedStationInfo;
       
    34 class IRQFavoritesDB;
       
    35 class IRQNetworkController;
       
    36 class IRQNwkInfoObserver;
       
    37 class IRQStatisticsReporter;
       
    38 class IRQMusicShop;
       
    39 class IRQDiskSpaceWatcher;
       
    40 class QLocalServer;
       
    41 class IRQAdvClient;
       
    42 class HbMessageBox;
       
    43 
       
    44 #ifdef LOCALIZATION
       
    45 class QTranslator;
       
    46 #endif
       
    47 
       
    48 class IRApplication : public QObject
       
    49 {
       
    50     Q_OBJECT
       
    51     
       
    52 public:
       
    53     explicit IRApplication(IRAbstractViewManager *aViewManager);
       
    54     ~IRApplication();
       
    55     
       
    56     bool verifyNetworkConnectivity(const QString &aConnectingText = hbTrId("Connecting to server..."));
       
    57     
       
    58     void createConnectingDialog();
       
    59     
       
    60     void closeConnectingDialog();
       
    61     
       
    62     IRAbstractViewManager* getViewManager() const;
       
    63     IRQNetworkController* getNetworkController();
       
    64     IRQIsdsClient* getIsdsClient();
       
    65     IRPlayController* getPlayController();
       
    66     IRLastPlayedStationInfo* getLastPlayedStationInfo();
       
    67     IRQFavoritesDB* getFavoritesDB();
       
    68     IRQSettings *   getSettings();
       
    69     IRMediaKeyObserver* getMediaKeyObserver();
       
    70     IRQNwkInfoObserver* getNwkInfoObserver();
       
    71     IRQStatisticsReporter* getStatisticsReporter();
       
    72     IRQMusicShop* getMusicShop();
       
    73     IRQAdvClient* getAdvClient();
       
    74 	
       
    75     //from QObject
       
    76     bool event(QEvent* e);
       
    77 
       
    78 #ifdef _DEBUG
       
    79 public:
       
    80     bool iTestPreferredBitrate;
       
    81 #endif
       
    82 
       
    83 signals:
       
    84     void quit();
       
    85 
       
    86 private slots:
       
    87     //connect to signal 'networkEventNotified' from IRQNetworkController
       
    88     void networkEventNotified(IRQNetworkEvent aEvent);
       
    89     void cancelConnect();
       
    90     void loadGenre();
       
    91     void newLocalSocketConnection();
       
    92     void handleDiskSpaceLow(qint64 aCriticalLevel);
       
    93     
       
    94 private:
       
    95     void createComponents();
       
    96     void destroyComponents();
       
    97     void setupConnection();
       
    98     void setLaunchView();
       
    99     void launchStartingView();
       
   100     void startMonitoringNwkInfo();
       
   101     void startMonitoringDiskSpace();
       
   102     void initApp();
       
   103     void setExitingView();
       
   104     
       
   105     TIRHandleResult handleConnectionEstablished();
       
   106     
       
   107     void startLocalServer();
       
   108     
       
   109 #ifdef LOCALIZATION
       
   110     void initLanguage();
       
   111 #endif
       
   112     
       
   113 #ifdef _DEBUG
       
   114     void readConfiguration();
       
   115 #endif
       
   116 
       
   117 private:
       
   118     IRAbstractViewManager* iViewManager;
       
   119     
       
   120     IRQNetworkController* iNetworkController;
       
   121     
       
   122     IRQIsdsClient* iIsdsClient;
       
   123     
       
   124     IRPlayController* iPlayController;
       
   125     
       
   126     IRQFavoritesDB* iFavPresets;
       
   127     
       
   128     IRQSettings      *iSettings;
       
   129 
       
   130     IRMediaKeyObserver *iMediaKeyObserver;
       
   131 
       
   132     IRLastPlayedStationInfo *iLastPlayedStationInfo;
       
   133 
       
   134     IRQNwkInfoObserver *iNwkInfoObserver;
       
   135 
       
   136     IRQStatisticsReporter *iStatisticsReporter;
       
   137     
       
   138     IRQMusicShop *iMusicShop;
       
   139 
       
   140     IRQAdvClient *iAdvertisementClient;
       
   141 
       
   142     IRQDiskSpaceWatcher *iDiskSpaceWatcher;
       
   143 
       
   144     bool iEnableGlobalAdv;
       
   145 
       
   146     bool iDisconnected;
       
   147 
       
   148     bool iConnectingCanceled;
       
   149 
       
   150     QEvent::Type iInitEvent;
       
   151 
       
   152     QString iConnectingText;
       
   153     
       
   154     QLocalServer *iLocalServer;
       
   155     
       
   156     HbMessageBox *iConnectingNote;
       
   157     
       
   158 #ifdef LOCALIZATION
       
   159     QTranslator  *iTranslator;
       
   160 #endif
       
   161 };
       
   162 
       
   163 #endif