# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277305440 -10800 # Node ID f683e24efca3dcac6405fd79a8c4773a461b0815 # Parent 3b03c28289e685ff52f32c8d91a83e91dd54c3c3 Revision: 201023 Kit: 2010125 diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/bmarm/irnetworkcontrolleru.def --- a/internetradio2.0/bmarm/irnetworkcontrolleru.def Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/bmarm/irnetworkcontrolleru.def Wed Jun 23 18:04:00 2010 +0300 @@ -18,12 +18,8 @@ _ZN20CIRNetworkController32RegisterLogoDataTransferTrackerLER12RHTTPSession @ 17 NONAME _ZN20CIRNetworkController5CloseEv @ 18 NONAME _ZN20CIRNetworkController5OpenLEP20MIRNetworkController @ 19 NONAME - _ZNK20CIRNetworkController13GetBearerListEv @ 20 NONAME - _ZNK20CIRNetworkController14GetNetworkListEv @ 21 NONAME - _ZNK20CIRNetworkController15IsWlanSupportedEv @ 22 NONAME - _ZNK20CIRNetworkController16GetNetworkStatusEv @ 23 NONAME - _ZNK20CIRNetworkController18GetAccessPointListEv @ 24 NONAME - _ZNK20CIRNetworkController22IdentifyConnectionTypeEv @ 25 NONAME - _ZNK20CIRNetworkController8GetIAPIdERm @ 26 NONAME - _ZNK20CIRNetworkController9GetApListEv @ 27 NONAME + _ZNK20CIRNetworkController15IsWlanSupportedEv @ 20 NONAME + _ZNK20CIRNetworkController16GetNetworkStatusEv @ 21 NONAME + _ZNK20CIRNetworkController22IdentifyConnectionTypeEv @ 22 NONAME + _ZNK20CIRNetworkController8GetIAPIdERm @ 23 NONAME diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/bwinscw/irnetworkcontrolleru.def --- a/internetradio2.0/bwinscw/irnetworkcontrolleru.def Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/bwinscw/irnetworkcontrolleru.def Wed Jun 23 18:04:00 2010 +0300 @@ -1,29 +1,25 @@ EXPORTS - ?CancelConnecting@CIRNetworkController@@QAEXXZ @ 1 NONAME ; void CIRNetworkController::CancelConnecting(void) - ?ChooseAccessPointL@CIRNetworkController@@QAEXH@Z @ 2 NONAME ; void CIRNetworkController::ChooseAccessPointL(int) - ?Close@CIRNetworkController@@QAEXXZ @ 3 NONAME ; void CIRNetworkController::Close(void) - ?DataTransferTracker@CIRNetworkController@@QAEAAVMIRDataTransferTracker@@XZ @ 4 NONAME ; class MIRDataTransferTracker & CIRNetworkController::DataTransferTracker(void) - ?DeleteActiveNetworkObserver@CIRNetworkController@@QAEXAAVMIRActiveNetworkObserver@@@Z @ 5 NONAME ; void CIRNetworkController::DeleteActiveNetworkObserver(class MIRActiveNetworkObserver &) - ?GetAccessPointList@CIRNetworkController@@QBEPBVCDesC16Array@@XZ @ 6 NONAME ; class CDesC16Array const * CIRNetworkController::GetAccessPointList(void) const - ?GetApList@CIRNetworkController@@QBE?BV?$RArray@K@@XZ @ 7 NONAME ; class RArray const CIRNetworkController::GetApList(void) const - ?GetBearerList@CIRNetworkController@@QBE?BV?$RArray@K@@XZ @ 8 NONAME ; class RArray const CIRNetworkController::GetBearerList(void) const - ?GetIAPId@CIRNetworkController@@QBEHAAK@Z @ 9 NONAME ; int CIRNetworkController::GetIAPId(unsigned long &) const - ?GetIRConnection@CIRNetworkController@@QAEAAVRConnection@@XZ @ 10 NONAME ; class RConnection & CIRNetworkController::GetIRConnection(void) - ?GetIRSocketServer@CIRNetworkController@@QAEAAVRSocketServ@@XZ @ 11 NONAME ; class RSocketServ & CIRNetworkController::GetIRSocketServer(void) - ?GetNetworkList@CIRNetworkController@@QBE?BV?$RArray@K@@XZ @ 12 NONAME ; class RArray const CIRNetworkController::GetNetworkList(void) const - ?GetNetworkStatus@CIRNetworkController@@QBEHXZ @ 13 NONAME ; int CIRNetworkController::GetNetworkStatus(void) const - ?GetUAProfString@CIRNetworkController@@QAEPAVHBufC8@@XZ @ 14 NONAME ; class HBufC8 * CIRNetworkController::GetUAProfString(void) - ?GetWapProfString@CIRNetworkController@@QAEPAVHBufC8@@XZ @ 15 NONAME ; class HBufC8 * CIRNetworkController::GetWapProfString(void) - ?IdentifyConnectionType@CIRNetworkController@@QBE?AW4TIRConnectionType@@XZ @ 16 NONAME ; enum TIRConnectionType CIRNetworkController::IdentifyConnectionType(void) const - ?InitializeHttpSessionL@CIRNetworkController@@QAEXABVRHTTPSession@@W4TIRTransferCategory@MIRDataTransferTracker@@@Z @ 17 NONAME ; void CIRNetworkController::InitializeHttpSessionL(class RHTTPSession const &, enum MIRDataTransferTracker::TIRTransferCategory) - ?IsHandingOverConnection@CIRNetworkController@@QAEHXZ @ 18 NONAME ; int CIRNetworkController::IsHandingOverConnection(void) - ?IsOfflineMode@CIRNetworkController@@QAEHXZ @ 19 NONAME ; int CIRNetworkController::IsOfflineMode(void) + ?GetUAProfString@CIRNetworkController@@QAEPAVHBufC8@@XZ @ 1 NONAME ; class HBufC8 * CIRNetworkController::GetUAProfString(void) + ?GetWapProfString@CIRNetworkController@@QAEPAVHBufC8@@XZ @ 2 NONAME ; class HBufC8 * CIRNetworkController::GetWapProfString(void) + ?IsOfflineMode@CIRNetworkController@@QAEHXZ @ 3 NONAME ; int CIRNetworkController::IsOfflineMode(void) + ?GetIRSocketServer@CIRNetworkController@@QAEAAVRSocketServ@@XZ @ 4 NONAME ; class RSocketServ & CIRNetworkController::GetIRSocketServer(void) + ?IsHandingOverConnection@CIRNetworkController@@QAEHXZ @ 5 NONAME ; int CIRNetworkController::IsHandingOverConnection(void) + ?GetIAPId@CIRNetworkController@@QBEHAAK@Z @ 6 NONAME ; int CIRNetworkController::GetIAPId(unsigned long &) const + ?RegisterActiveNetworkObserverL@CIRNetworkController@@QAEXAAVMIRActiveNetworkObserver@@@Z @ 7 NONAME ; void CIRNetworkController::RegisterActiveNetworkObserverL(class MIRActiveNetworkObserver &) + ?IdentifyConnectionType@CIRNetworkController@@QBE?AW4TIRConnectionType@@XZ @ 8 NONAME ; enum TIRConnectionType CIRNetworkController::IdentifyConnectionType(void) const + ?GetNetworkStatus@CIRNetworkController@@QBEHXZ @ 9 NONAME ; int CIRNetworkController::GetNetworkStatus(void) const + ?ResetConnectionStatus@CIRNetworkController@@QAEXXZ @ 10 NONAME ; void CIRNetworkController::ResetConnectionStatus(void) + ?DeleteActiveNetworkObserver@CIRNetworkController@@QAEXAAVMIRActiveNetworkObserver@@@Z @ 11 NONAME ; void CIRNetworkController::DeleteActiveNetworkObserver(class MIRActiveNetworkObserver &) + ?GetIRConnection@CIRNetworkController@@QAEAAVRConnection@@XZ @ 12 NONAME ; class RConnection & CIRNetworkController::GetIRConnection(void) + ?OpenL@CIRNetworkController@@SAPAV1@PAVMIRNetworkController@@@Z @ 13 NONAME ; class CIRNetworkController * CIRNetworkController::OpenL(class MIRNetworkController *) + ?NewL@CIRNetworkObserver@@SAPAV1@PAVCIRNetworkController@@@Z @ 14 NONAME ; class CIRNetworkObserver * CIRNetworkObserver::NewL(class CIRNetworkController *) + ?CancelConnecting@CIRNetworkController@@QAEXXZ @ 15 NONAME ; void CIRNetworkController::CancelConnecting(void) + ?ChooseAccessPointL@CIRNetworkController@@QAEXH@Z @ 16 NONAME ; void CIRNetworkController::ChooseAccessPointL(int) + ?DataTransferTracker@CIRNetworkController@@QAEAAVMIRDataTransferTracker@@XZ @ 17 NONAME ; class MIRDataTransferTracker & CIRNetworkController::DataTransferTracker(void) + ?NotifyActiveNetworkObserversL@CIRNetworkController@@QAEXW4TIRNetworkEvent@@@Z @ 18 NONAME ; void CIRNetworkController::NotifyActiveNetworkObserversL(enum TIRNetworkEvent) + ?InitializeHttpSessionL@CIRNetworkController@@QAEXABVRHTTPSession@@W4TIRTransferCategory@MIRDataTransferTracker@@@Z @ 19 NONAME ; void CIRNetworkController::InitializeHttpSessionL(class RHTTPSession const &, enum MIRDataTransferTracker::TIRTransferCategory) ?IsWlanSupported@CIRNetworkController@@QBEHXZ @ 20 NONAME ; int CIRNetworkController::IsWlanSupported(void) const - ?LogoDataTransferTracker@CIRNetworkController@@QAEAAVMIRDataTransferTracker@@XZ @ 21 NONAME ; class MIRDataTransferTracker & CIRNetworkController::LogoDataTransferTracker(void) - ?NewL@CIRNetworkObserver@@SAPAV1@PAVCIRNetworkController@@@Z @ 22 NONAME ; class CIRNetworkObserver * CIRNetworkObserver::NewL(class CIRNetworkController *) - ?NotifyActiveNetworkObserversL@CIRNetworkController@@QAEXW4TIRNetworkEvent@@@Z @ 23 NONAME ; void CIRNetworkController::NotifyActiveNetworkObserversL(enum TIRNetworkEvent) - ?OpenL@CIRNetworkController@@SAPAV1@PAVMIRNetworkController@@@Z @ 24 NONAME ; class CIRNetworkController * CIRNetworkController::OpenL(class MIRNetworkController *) - ?RegisterActiveNetworkObserverL@CIRNetworkController@@QAEXAAVMIRActiveNetworkObserver@@@Z @ 25 NONAME ; void CIRNetworkController::RegisterActiveNetworkObserverL(class MIRActiveNetworkObserver &) - ?RegisterLogoDataTransferTrackerL@CIRNetworkController@@QAEXAAVRHTTPSession@@@Z @ 26 NONAME ; void CIRNetworkController::RegisterLogoDataTransferTrackerL(class RHTTPSession &) - ?ResetConnectionStatus@CIRNetworkController@@QAEXXZ @ 27 NONAME ; void CIRNetworkController::ResetConnectionStatus(void) + ?Close@CIRNetworkController@@QAEXXZ @ 21 NONAME ; void CIRNetworkController::Close(void) + ?RegisterLogoDataTransferTrackerL@CIRNetworkController@@QAEXAAVRHTTPSession@@@Z @ 22 NONAME ; void CIRNetworkController::RegisterLogoDataTransferTrackerL(class RHTTPSession &) + ?LogoDataTransferTracker@CIRNetworkController@@QAEAAVMIRDataTransferTracker@@XZ @ 23 NONAME ; class MIRDataTransferTracker & CIRNetworkController::LogoDataTransferTracker(void) diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/cachemgmtsrc/ircachemgmt.cpp --- a/internetradio2.0/cachemgmtsrc/ircachemgmt.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/cachemgmtsrc/ircachemgmt.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -450,15 +450,16 @@ { iPtrCategory->ResetAndDestroy(); } + else + { + break; + } for(TInt iter=0;iter>*ptr; - if (iPtrCategory) - { - iPtrCategory->AppendL(ptr); - } + iPtrCategory->AppendL(ptr); CleanupStack::Pop(ptr); } CleanupStack::PopAndDestroy( &instream ); diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/dataprovidersrc/irhttpdataprovider.cpp --- a/internetradio2.0/dataprovidersrc/irhttpdataprovider.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/dataprovidersrc/irhttpdataprovider.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -740,12 +740,16 @@ TInt pfCount = pf.Count(); for(ii=0;ii z; - TBuf z1; + RBuf z; + RBuf z1; TBool first; //file extensions const CDesC8Array &fe=pf[ii]->SupportedFileExtensions(); first=TRUE; + z.CreateL(KSize); + z.CleanupClosePushL(); + z1.CreateL(KSize); + z1.CleanupClosePushL(); z1.Zero(); for(j=0;jSetName(aName); saveItem->SetUrlCount(1);//only one url is saved for manually added channel saveItem->SetChannelType(EUserDefined); @@ -212,7 +212,8 @@ //bitrate set to zero so that it is accessible to all kinds of bitrate settings saveItem->SetUrlL(KNotAvailable,aURl,0); AddPresetL(*saveItem,aReturn); - delete saveItem; + CleanupStack::PopAndDestroy(saveItem); + IRLOG_DEBUG( "CIRFavoritesDb::AddPresetL(des des int int) - Exiting." ); } diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/filerecognizersrc/irrecognizer.cpp --- a/internetradio2.0/filerecognizersrc/irrecognizer.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/filerecognizersrc/irrecognizer.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -152,7 +152,13 @@ RFs fs; User::LeaveIfError(fs.Connect()); RFile file; - file.Open(fs, aFileName, EFileRead); + TInt ret = file.Open(fs, aFileName, EFileRead); + if (KErrNone != ret) + { + fs.Close(); + return; + } + RBuf8 content; TInt maxLen = 0; file.Size(maxLen); diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/include/irpubsubkeys.h --- a/internetradio2.0/include/irpubsubkeys.h Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/include/irpubsubkeys.h Wed Jun 23 18:04:00 2010 +0300 @@ -164,5 +164,10 @@ const TUint32 KIRPSBufferingState = { KIRPubSubBase + 0x00000012 }; +/******************************************************************** +* KIRPubSubBase + 0x00000015 should be reserved for startup key which is defined in \qtinternetradio\irqcommon\inc\irservicedef.h +*const unsigned long int KInternetRadioStartupKey = 0x00000035; // = KIRPubSubBase + 0x00000015 +*/ + #endif // IRPUBSUBKEYS_H diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/networkcontrollerinc/irnetworkcontroller.h --- a/internetradio2.0/networkcontrollerinc/irnetworkcontroller.h Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/networkcontrollerinc/irnetworkcontroller.h Wed Jun 23 18:04:00 2010 +0300 @@ -23,10 +23,6 @@ #include #include -//Added for ALR/SNAP -#include -#include -#include #include #include "iractivenetworkobserver.h" @@ -38,25 +34,6 @@ class CIRSettings; class MIRActiveNetworkObserver; -typedef RArray RDestinationArray; - -//Added for ALR/SNAP -enum TUserDefinedSelection - { - EUserDefinedSelectionAlwaysAsk = 0, - EUserDefinedSelectionDefaultConnection, - EUserDefinedSelectionDestination, - EUserDefinedSelectionConnectionMethod - }; - - -namespace CommsDat - { - class CMDBSession; - } - -using namespace CommsDat; - /** * This class provides the interface to IRNetworkController component * @@ -102,18 +79,6 @@ * // this is used by download manager for choosing the access point * iNetworkController->GetIAPId(); * - * // This API returns the list of available access points - * iNetworkController->GetAccessPointList(); - * - * // This API returns the list of bearer ids for available access points - * iNetworkController->GetBearerList(); - * - * // This API returns the list of network ids for available access points - * iNetworkController->GetNetworkList(); - * - * // This API returns the list of iap ids for available access points - * iNetworkController->GetApList(); - * * // This API is called to initiate access point selection * iNetworkController->ChooseAccessPointL(); * @@ -203,30 +168,6 @@ IMPORT_C TInt GetIAPId(TUint32& aIapId) const; /** - * Returns the list of available access points - * @return CDesCArray* array specifying the access point names - */ - IMPORT_C const CDesCArray* GetAccessPointList() const; - - /** - * Returns the list of bearer ids for available access points - * @return const RArray array specifying the bearer ids - */ - IMPORT_C const RArray GetBearerList() const; - - /** - * Returns the list of network ids for available access points - * @return const RArray array specifying the network ids - */ - IMPORT_C const RArray GetNetworkList() const; - - /** - * Returns the list of iap ids for available access points - * @return const RArray array specifying the iap ids - */ - IMPORT_C const RArray GetApList() const; - - /** * Configures the Access Point which is used by all the components for network connectivity */ IMPORT_C void ChooseAccessPointL(TBool aDefaultConnection = ETrue); @@ -522,21 +463,6 @@ CDesCArrayFlat* iIapList; /** - * Array of bearer ids for access points - */ - RArray iBearerList; - - /** - * Array of network ids for access points - */ - RArray iNetworkList; - - /** - * Array of iap ids for access points - */ - RArray iIapIdList; - - /** * Indicates if WiFi is supported or not */ TBool iIsWlanSupported; diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/networkcontrollersrc/irnetworkcontroller.cpp --- a/internetradio2.0/networkcontrollersrc/irnetworkcontroller.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/networkcontrollersrc/irnetworkcontroller.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -36,15 +36,10 @@ #include "iractivenetworkobserver.h" -//for ALR/SNAP -#include -#include - const TInt KMaxIRUAProfLength = 250; // Max length of the UAProf string const TInt KIRDefaultUAProfBufferSize = 0x80; const TUint KIRESockMessageSlots = 16; -const TUint32 KIRUniqueWlanId = 0x2000883F; // Just to make it unique const TInt KArraySize = 5; const TInt KWlanStringMaxLength = 9; const TInt KTwo = 2; @@ -101,6 +96,13 @@ CleanupStack::Pop(networkController); } networkController->iSingletonInstances++; + + if (NULL != aObserver) + { + networkController->iObserver = aObserver; + networkController->iIRNetworkObserver->SetObserver(aObserver); + } + IRLOG_DEBUG( "CIRNetworkController::OpenL - Exiting." ); return networkController; } @@ -261,49 +263,6 @@ } // --------------------------------------------------------------------------- -// CIRNetworkController::GetAccessPointList -// Reset the connection status to Disconnected statet -// --------------------------------------------------------------------------- -// -EXPORT_C const CDesCArray* CIRNetworkController::GetAccessPointList() const -{ - IRLOG_DEBUG( "CIRNetworkController::GetAccessPointList" ); - return iIapList; -} - -// --------------------------------------------------------------------------- -// CIRNetworkController::GetBearerList -// Reset the connection status to Disconnected statet -// -EXPORT_C const RArray CIRNetworkController::GetBearerList() const -{ - IRLOG_DEBUG( "CIRNetworkController::GetBearerList" ); - return iBearerList; -} - -// --------------------------------------------------------------------------- -// CIRNetworkController::GetNetworkList -// Reset the connection status to Disconnected statet -// --------------------------------------------------------------------------- -// -EXPORT_C const RArray CIRNetworkController::GetNetworkList() const -{ - IRLOG_DEBUG( "CIRNetworkController::GetNetworkList" ); - return iNetworkList; -} - -// --------------------------------------------------------------------------- -// CIRNetworkController::GetApList -// Reset the connection status to Disconnected statet -// --------------------------------------------------------------------------- -// -EXPORT_C const RArray CIRNetworkController::GetApList() const -{ - IRLOG_DEBUG( "CIRNetworkController::GetApList" ); - return iIapIdList; -} - -// --------------------------------------------------------------------------- // CIRNetworkController::ChooseAccessPointL // Configures the Access Point which is used by all the components for network // connectivity @@ -330,6 +289,13 @@ // Always validate the Access Points status if ( ValidateAccessPointsL() ) { + if(NULL != iMobility) + { + iMobility->Cancel(); + delete iMobility; + iMobility = NULL; + } + // Connect to the Symbian Socket Server iIRNetworkConnection->Close(); iIRSocketServer.Close(); @@ -531,7 +497,13 @@ _LIT(KErrorMsg,"Method Close not called"); __ASSERT_ALWAYS(iSingletonInstances == 0, User::Panic(KErrorMsg, KErrCorrupt)); - delete iMobility; + if(NULL != iMobility) + { + iMobility->Cancel(); + delete iMobility; + iMobility = NULL; + } + if (IsActive()) { Cancel(); @@ -552,9 +524,7 @@ } delete iIRNetworkObserver; iIRSocketServer.Close(); - iBearerList.Close(); - iNetworkList.Close(); - iIapIdList.Close(); + if (iIapList) { iIapList->Reset(); @@ -622,9 +592,6 @@ // Reset all the comms info iIapList->Reset(); - iBearerList.Reset(); - iNetworkList.Reset(); - iIapIdList.Reset(); #ifndef __WINS__ CIRFilteredApReader* filteredReader = CIRFilteredApReader:: @@ -639,9 +606,6 @@ CleanupStack::PushL( iapRecord ); iIapList->AppendL( iapRecord->iRecordName.GetL() ); - iBearerList.AppendL( static_cast(iapRecord->iBearer) ); - iNetworkList.AppendL( static_cast(iapRecord->iNetwork) ); - iIapIdList.AppendL( iapRecord->RecordId() ); CleanupStack::PopAndDestroy( iapRecord ); iapRecord = filteredReader->NextRecordL(); @@ -662,9 +626,6 @@ CCDIAPRecord* iapRecord = static_cast (iapSet->iRecords[i]); iIapList->AppendL(iapRecord->iRecordName.GetL()); - iBearerList.AppendL(static_cast (iapRecord->iBearer)); - iNetworkList.AppendL(static_cast (iapRecord->iNetwork)); - iIapIdList.AppendL(iapRecord->RecordId()); } CleanupStack::PopAndDestroy(2, dbSession); @@ -679,10 +640,6 @@ TBuf wlanString; wlanString.Copy(KIRWLanName); iIapList->AppendL(wlanString); - TUint32 WlanIdentifier(KIRUniqueWlanId); - iBearerList.AppendL(WlanIdentifier); - iNetworkList.AppendL((TUint32)KErrNotFound); - iIapIdList.AppendL((TUint32)KErrNotFound); } #endif @@ -871,6 +828,14 @@ void CIRNetworkController::DoCancel() { IRLOG_DEBUG( "CIRNetworkController::DoCancel - Entering" ); + + if(NULL != iMobility) + { + iMobility->Cancel(); + delete iMobility; + iMobility = NULL; + } + iIRNetworkConnection->Stop(); iIRNetworkConnection->Close(); iIRSocketServer.Close(); diff -r 3b03c28289e6 -r f683e24efca3 internetradio2.0/networkcontrollersrc/irnetworkobserver.cpp --- a/internetradio2.0/networkcontrollersrc/irnetworkobserver.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/internetradio2.0/networkcontrollersrc/irnetworkobserver.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -181,7 +181,14 @@ { if(iMonitoringRequired) { - iMonitorObserver->IRNetworkEventL(ENetworkConnectionDisconnected); + if (iMonitorObserver) + { + iMonitorObserver->IRNetworkEventL(ENetworkConnectionDisconnected); + } + else + { + iNetworkController->NotifyActiveNetworkObserversL(ENetworkConnectionDisconnected); + } } } } @@ -369,60 +376,30 @@ case EBearerGPRS: { iIRConnectionType = EGprs; - if(iMonitoringRequired) - { - // Intimate the connection established event - iMonitorObserver->IRNetworkEventL( - ENetworkConnectionEstablished); - } } break; case EBearerEdgeGPRS: { iIRConnectionType = EEdge; - if(iMonitoringRequired) - { - // Intimate the connection established event - iMonitorObserver->IRNetworkEventL( - ENetworkConnectionEstablished); - } } break; case EBearerWLAN: { iIRConnectionType = EWiFi; - if(iMonitoringRequired) - { - // Intimate the connection established event - iMonitorObserver->IRNetworkEventL( - ENetworkConnectionEstablished); - } } break; case EBearerWCDMA: { iIRConnectionType = EWcdma; - if(iMonitoringRequired) - { - // Intimate the connection established event - iMonitorObserver->IRNetworkEventL( - ENetworkConnectionEstablished); - } } break; case EBearerCDMA2000: { iIRConnectionType = ECdma2000; - if(iMonitoringRequired) - { - // Intimate the connection established event - iMonitorObserver->IRNetworkEventL( - ENetworkConnectionEstablished); - } } break; @@ -430,17 +407,25 @@ { #ifdef __WINS__ iIRConnectionType = EGprs; - if(iMonitoringRequired) - { - // Intimate the connection established event - iMonitorObserver->IRNetworkEventL( - ENetworkConnectionEstablished); - } #endif } break; } + + if (iMonitoringRequired) + { + if (iMonitorObserver) + { + // Intimate the connection established event + iMonitorObserver->IRNetworkEventL(ENetworkConnectionEstablished); + } + else + { + iNetworkController->NotifyActiveNetworkObserversL(ENetworkConnectionEstablished); + } + } + iNetworkController->ResetHandingOverConnection(); } break; diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/bwins/irqnetworkcontrolleru.def --- a/qtinternetradio/bwins/irqnetworkcontrolleru.def Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/bwins/irqnetworkcontrolleru.def Wed Jun 23 18:04:00 2010 +0300 @@ -1,19 +1,15 @@ EXPORTS - ?getNetworkList@IRQNetworkController@@QAEXAAV?$QList@K@@@Z @ 1 NONAME ; void IRQNetworkController::getNetworkList(class QList &) - ?isWlanSupported@IRQNetworkController@@QBE_NXZ @ 2 NONAME ; bool IRQNetworkController::isWlanSupported(void) const - ?getIAPId@IRQNetworkController@@QBE?AW4IRQError@@AAK@Z @ 3 NONAME ; enum IRQError IRQNetworkController::getIAPId(unsigned long &) const - ?getApIdList@IRQNetworkController@@QAEXAAV?$QList@K@@@Z @ 4 NONAME ; void IRQNetworkController::getApIdList(class QList &) - ?cancelConnecting@IRQNetworkController@@QAEXXZ @ 5 NONAME ; void IRQNetworkController::cancelConnecting(void) - ?isHandlingOverConnection@IRQNetworkController@@QAE_NXZ @ 6 NONAME ; bool IRQNetworkController::isHandlingOverConnection(void) - ?getBearerList@IRQNetworkController@@QAEXAAV?$QList@K@@@Z @ 7 NONAME ; void IRQNetworkController::getBearerList(class QList &) - ?getAccessPointList@IRQNetworkController@@QAEXAAVQStringList@@@Z @ 8 NONAME ; void IRQNetworkController::getAccessPointList(class QStringList &) - ?identifyConnectionType@IRQNetworkController@@QBE?AW4IRQConnectionType@@XZ @ 9 NONAME ; enum IRQConnectionType IRQNetworkController::identifyConnectionType(void) const - ?openInstance@IRQNetworkController@@SAPAV1@XZ @ 10 NONAME ; class IRQNetworkController * IRQNetworkController::openInstance(void) - ?closeInstance@IRQNetworkController@@QAEXXZ @ 11 NONAME ; void IRQNetworkController::closeInstance(void) - ?notifyActiveNetworkObservers@IRQNetworkController@@QAEXW4IRQNetworkEvent@@@Z @ 12 NONAME ; void IRQNetworkController::notifyActiveNetworkObservers(enum IRQNetworkEvent) - ?getNetworkStatus@IRQNetworkController@@QBE_NXZ @ 13 NONAME ; bool IRQNetworkController::getNetworkStatus(void) const - ?resetConnectionStatus@IRQNetworkController@@QAEXXZ @ 14 NONAME ; void IRQNetworkController::resetConnectionStatus(void) - ?isOfflineMode@IRQNetworkController@@QAE_NXZ @ 15 NONAME ; bool IRQNetworkController::isOfflineMode(void) - ?isConnectRequestIssued@IRQNetworkController@@QBE_NXZ @ 16 NONAME ; bool IRQNetworkController::isConnectRequestIssued(void) const - ?chooseAccessPoint@IRQNetworkController@@QAEXXZ @ 17 NONAME ; void IRQNetworkController::chooseAccessPoint(void) + ?isWlanSupported@IRQNetworkController@@QBE_NXZ @ 1 NONAME ; bool IRQNetworkController::isWlanSupported(void) const + ?getIAPId@IRQNetworkController@@QBE?AW4IRQError@@AAK@Z @ 2 NONAME ; enum IRQError IRQNetworkController::getIAPId(unsigned long &) const + ?cancelConnecting@IRQNetworkController@@QAEXXZ @ 3 NONAME ; void IRQNetworkController::cancelConnecting(void) + ?isHandlingOverConnection@IRQNetworkController@@QAE_NXZ @ 4 NONAME ; bool IRQNetworkController::isHandlingOverConnection(void) + ?identifyConnectionType@IRQNetworkController@@QBE?AW4IRQConnectionType@@XZ @ 5 NONAME ; enum IRQConnectionType IRQNetworkController::identifyConnectionType(void) const + ?openInstance@IRQNetworkController@@SAPAV1@XZ @ 6 NONAME ; class IRQNetworkController * IRQNetworkController::openInstance(void) + ?closeInstance@IRQNetworkController@@QAEXXZ @ 7 NONAME ; void IRQNetworkController::closeInstance(void) + ?notifyActiveNetworkObservers@IRQNetworkController@@QAEXW4IRQNetworkEvent@@@Z @ 8 NONAME ; void IRQNetworkController::notifyActiveNetworkObservers(enum IRQNetworkEvent) + ?getNetworkStatus@IRQNetworkController@@QBE_NXZ @ 9 NONAME ; bool IRQNetworkController::getNetworkStatus(void) const + ?resetConnectionStatus@IRQNetworkController@@QAEXXZ @ 10 NONAME ; void IRQNetworkController::resetConnectionStatus(void) + ?isOfflineMode@IRQNetworkController@@QAE_NXZ @ 11 NONAME ; bool IRQNetworkController::isOfflineMode(void) + ?isConnectRequestIssued@IRQNetworkController@@QBE_NXZ @ 12 NONAME ; bool IRQNetworkController::isConnectRequestIssued(void) const + ?chooseAccessPoint@IRQNetworkController@@QAEXXZ @ 13 NONAME ; void IRQNetworkController::chooseAccessPoint(void) diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/eabi/irqnetworkcontrolleru.def --- a/qtinternetradio/eabi/irqnetworkcontrolleru.def Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/eabi/irqnetworkcontrolleru.def Wed Jun 23 18:04:00 2010 +0300 @@ -1,19 +1,15 @@ EXPORTS - _ZN20IRQNetworkController11getApIdListER5QListImE @ 1 NONAME - _ZN20IRQNetworkController12openInstanceEv @ 2 NONAME - _ZN20IRQNetworkController13closeInstanceEv @ 3 NONAME - _ZN20IRQNetworkController13getBearerListER5QListImE @ 4 NONAME - _ZN20IRQNetworkController13isOfflineModeEv @ 5 NONAME - _ZN20IRQNetworkController14getNetworkListER5QListImE @ 6 NONAME - _ZN20IRQNetworkController16cancelConnectingEv @ 7 NONAME - _ZN20IRQNetworkController17chooseAccessPointEv @ 8 NONAME - _ZN20IRQNetworkController18getAccessPointListER11QStringList @ 9 NONAME - _ZN20IRQNetworkController21resetConnectionStatusEv @ 10 NONAME - _ZN20IRQNetworkController24isHandlingOverConnectionEv @ 11 NONAME - _ZN20IRQNetworkController28notifyActiveNetworkObserversE15IRQNetworkEvent @ 12 NONAME - _ZNK20IRQNetworkController15isWlanSupportedEv @ 13 NONAME - _ZNK20IRQNetworkController16getNetworkStatusEv @ 14 NONAME - _ZNK20IRQNetworkController22identifyConnectionTypeEv @ 15 NONAME - _ZNK20IRQNetworkController22isConnectRequestIssuedEv @ 16 NONAME - _ZNK20IRQNetworkController8getIAPIdERm @ 17 NONAME + _ZN20IRQNetworkController12openInstanceEv @ 1 NONAME + _ZN20IRQNetworkController13closeInstanceEv @ 2 NONAME + _ZN20IRQNetworkController13isOfflineModeEv @ 3 NONAME + _ZN20IRQNetworkController16cancelConnectingEv @ 4 NONAME + _ZN20IRQNetworkController17chooseAccessPointEv @ 5 NONAME + _ZN20IRQNetworkController21resetConnectionStatusEv @ 6 NONAME + _ZN20IRQNetworkController24isHandlingOverConnectionEv @ 7 NONAME + _ZN20IRQNetworkController28notifyActiveNetworkObserversE15IRQNetworkEvent @ 8 NONAME + _ZNK20IRQNetworkController15isWlanSupportedEv @ 9 NONAME + _ZNK20IRQNetworkController16getNetworkStatusEv @ 10 NONAME + _ZNK20IRQNetworkController22identifyConnectionTypeEv @ 11 NONAME + _ZNK20IRQNetworkController22isConnectRequestIssuedEv @ 12 NONAME + _ZNK20IRQNetworkController8getIAPIdERm @ 13 NONAME diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/inc/irappinspector.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/inc/irappinspector.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Radio App Insecptor +* +*/ + +#ifndef IRAPPINSPECTOR_H_ +#define IRAPPINSPECTOR_H_ + +// System includes +#include +#include + +// User includes + +// Forward declarations +class XQSettingsManager; +class QVariant; + +Q_ENUMS(IrServiceCmd::IrRunningStatus) + +class IrAppInspector : public QObject +{ + Q_OBJECT + +public: + explicit IrAppInspector(QObject *aParent = 0); + virtual ~IrAppInspector(); + + bool isIrRunning(); + + bool startInspectingIrRunningStatus(); + void stopInspectingIrRunningStatus(); + + enum IrRunningStatus + { + StartingUp = 0, + Exiting = 1 + }; + +signals: + void irRunningStatusChanged(IrAppInspector::IrRunningStatus aNewStatus); + +private slots: + void handleIrExit(const XQSettingsKey &aKey); + void handleIrRunningStatusChanged(const XQSettingsKey &aKey, const QVariant &aValue); + +private: + XQSettingsManager *mSettingsManager; // For getting and P&S notifications + XQSettingsKey mIrRunningStatusKey; + + Q_DISABLE_COPY(IrAppInspector) +}; + +#endif /* IRAPPINSPECTOR_H_ */ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/inc/irhswidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/inc/irhswidget.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Radio home screen widget +* +*/ + +#ifndef IRHSWIDGET_H +#define IRHSWIDGET_H + +// System includes +#include +#include +#include + +// User includes +#include "irservicedef.h" + +// Forward declarations +class HbLabel; +class IrServiceClient; + +class IrHsWidget : public HbWidget +{ + Q_OBJECT + +public: + explicit IrHsWidget(QGraphicsItem *aParent = 0, Qt::WindowFlags aFlags = 0); + virtual ~IrHsWidget(); + + +public slots: + // from KQTI widget model framework, must be slots + void onInitialize(); + void onUninitialize(); + void onShow(); + void onHide(); + +private: + void setupUi(); + void setupConnection(); + + enum IrHsWidgetState + { + EUnknown = -1, + EInit = 0, + EPlaying = 1, + EStopped = 2, + ELoading = 3 + + }; + void handleHsWidgetStateChange(IrHsWidgetState aNewState); + + void loadStationLogo(); + + void initHomeSreenWidget(); + void loadInitLayout(); + void loadStoppedLayout(); + void loadPlayingLayout(); + void loadLoadingLayout(); + + // from QObject + bool eventFilter(QObject *aObject, QEvent *aEvent); + +private slots: + // handle user press event + void handleLogoAreaAction(); + void handleControlAreaAction(); + void handleGoToIrAreaAction(); + void handleCentralAreaAction(); + + void handleControlFailed(); + + // for service notification + void handleStationNameUpdated(const QString &aStationName); + void handleStationLogoUpdated(bool aLogoAvailable); + void handleMetaDataUpdated(const QString &aMetaData); + void handleIrStateUpdated(IrAppState::Type aNewState); + +private: + HbIcon mLoadingIcon; + + HbLabel *mLogoLabel; + HbLabel *mControlLabel; + HbLabel *mGoToIrLabel; + HbLabel *mStationNameLabel; + HbLabel *mMetadataLabel; + + HbWidget *mInfoControlArea; + HbWidget *mCentralArea; + + IrServiceClient *mServiceClient; + + IrAppState::Type mIrState; + IrHsWidgetState mIrHsWidgetState; + + Q_DISABLE_COPY(IrHsWidget) +}; + +#endif // IRHSWIDGET_H diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/inc/irhswidgetplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/inc/irhswidgetplugin.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Radio home screen widget plugin +* +*/ + +#ifndef IRHSWIDGETPLUGIN_H +#define IRHSWIDGETPLUGIN_H + +#include +#include + +QTM_USE_NAMESPACE +class IrHsWidgetPlugin : public QObject, public QServicePluginInterface +{ + Q_OBJECT + Q_INTERFACES(QtMobility::QServicePluginInterface) + +public: + QObject *createInstance(const QServiceInterfaceDescriptor &aDescriptor, + QServiceContext *aContext, + QAbstractSecuritySession *aSession); +}; + +#endif // IRHSWIDGETPLUGIN_H diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/inc/irserviceclient.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/inc/irserviceclient.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: internet radio hs widget service client +* +*/ + +#ifndef IRSERVICECLIENT_H_ +#define IRSERVICECLIENT_H_ + +// System includes +#include +#include + +// User includes +#include "irservicedef.h" +#include "irappinspector.h" + +// Forward declarations +class XQAiwRequest; +class IrServiceData; +class QString; +class QVariant; + +class IrServiceClient : public QObject +{ +Q_OBJECT + +public: + explicit IrServiceClient(QObject *aParent = 0); + virtual ~IrServiceClient(); + +public: + bool startMonitoringIrState(); + void stopMonitoringIrState(); + + bool isStationPlayed(); + bool loadStationName(QString &aStationName); + bool loadStationLogoFlag(); + + bool bringIrForeground(); + bool launchIrNormally(); + bool launchIrNowPlaying(); + + bool startPlaying(); + bool stopPlaying(); + bool cancelLoading(); + +signals: + void stationNameUpdated(const QString &aStationName); + void stationLogoUpdated(bool aIsLogoAvailable); + void metaDataUpdated(const QString &aMetaData); + void irStateChanged(IrAppState::Type aNewState); + + void controlFailed(); + +private slots: + // used for return value from Monitor Service via Qt HighWay + void handleMonitorRequestOk(const QVariant &aRetValue); + void handleMonitorRequestError(int aErrCode, const QString &aErrMessage); + + // used for return value from Control Service via Qt HighWay + void handleControlRequestOk(const QVariant &aRetValue); + void handleControlRequestError(int aErrCode, const QString &aErrMessage); + + // used for signals from IrAppInspector + void handleIrRunningStatusChanged(IrAppInspector::IrRunningStatus aNewStatus); + +private: + bool createControlServiceRequest(); + bool createMonitorServiceRequest(); + bool createRefreshServiceRequest(); + + enum IrAppVisibilty + { + DoNotChange, + ToForeground, + ToBackground + }; + + bool doSendMonitorRequest(); + bool doSendRefreshRequest(); + bool doSendControlRequest(const QVariant &aArgument, bool aIsSync, IrAppVisibilty aVisibility); + void prepareRequestInfo(XQAiwRequest *aRequest, IrAppVisibilty aVisibility); + + void processNotificationData(const IrServiceData &aServiceData); + + void initHsWidgetNoRunStopped(); + void resetHsWidgetExitStopped(); + +private: + IrAppInspector *mIrAppInspector; + + bool mMonitorReqOngoing; + bool mControlReqOngoing; + + XQApplicationManager mApplicationManager; + XQAiwRequest *mMonitorRequest; + XQAiwRequest *mRefreshRequest; + XQAiwRequest *mControlRequest; + + Q_DISABLE_COPY(IrServiceClient) +}; + +#endif /* IRSERVICECLIENT_H_ */ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/irhswidgetplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/irhswidgetplugin.pro Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,76 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: + +TEMPLATE = lib +TARGET = irhswidgetplugin +CONFIG += plugin mobility hb +MOBILITY = serviceframework + +LIBS += -lxqsettingsmanager \ + -lxqservice \ + -lxqserviceutil + +MOC_DIR = moc + +HEADERS += ./inc/*.h +SOURCES += ./src/*.cpp + +INCLUDEPATH += ./inc +INCLUDEPATH += ../irqcommon/inc + +UID = E257CD03 +RESOURCES = resources.qrc + +symbian: { + + DESTDIR = /private/20022F35/import/widgetregistry/$${UID} + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + + TARGET.UID3 = 0x$${UID} + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = ALL -TCB + + plugins.path = $${DESTDIR} + plugins.sources = $${TARGET}.dll + + widgetResources.path = $${DESTDIR} + widgetResources.sources += resource/$${TARGET}.xml + widgetResources.sources += resource/$${TARGET}.manifest + widgetResources.sources += resource/$${TARGET}.png + + DEPLOYMENT += plugins \ + widgetResources +} + +win32: { + + CONFIG(debug, debug|release) { + SUBDIRPART = debug + } else { + SUBDIRPART = release + } + + PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/$${UID} + + DESTDIR = $$PWD/../../../../bin/$${SUBDIRPART}/$${PLUGIN_SUBDIR} + + manifest.path = $${DESTDIR} + manifest.files = ./resource/*.manifest ./resource/*.xml ./resource/*.png + + INSTALLS += manifest + +} + +symbian:include(irhswidgetplugin_rom.pri) diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/irhswidgetplugin_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/irhswidgetplugin_rom.pri Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,27 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +BLD_INF_RULES.prj_exports += \ +"$${LITERAL_HASH}include " + +#iby exports to core +BLD_INF_RULES.prj_exports += \ +"rom/irhswidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(irhswidgetplugin.iby)" + +#iby exports to language +#BLD_INF_RULES.prj_exports += \ +#"rom/irhswidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(irhswidgetplugin_resources.iby)" + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/resource/irhswidget.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/resource/irhswidget.docml Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/resource/irhswidgetplugin.manifest --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/resource/irhswidgetplugin.manifest Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,9 @@ + + + irhswidgetplugin + Internet Radio HS Widget + Internet Radio HS Widget + irhswidgetplugin.png + false + irhswidgetplugin.xml + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/resource/irhswidgetplugin.png Binary file qtinternetradio/irhswidgetplugin/resource/irhswidgetplugin.png has changed diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/resource/irhswidgetplugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/resource/irhswidgetplugin.xml Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,14 @@ + + + irhswidgetplugin + irhswidgetplugin + Internet Radio HS Widget + + com.nokia.symbian.IHomeScreenWidget + 1.0 + Internet Radio HS Widget + + irhswidgetplugin.png + Internet Radio HS Widget + + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/resources.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/resources.qrc Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,5 @@ + + + resource/irhswidget.docml + + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/rom/irhswidgetplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/rom/irhswidgetplugin.iby Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __IRHSWIDGETPLUGIN_IBY__ +#define __IRHSWIDGETPLUGIN_IBY__ + +file=ABI_DIR\BUILD_DIR\irhswidgetplugin.dll SHARED_LIB_DIR\irhswidgetplugin.dll +data=ZPRIVATE\20022f35\import\widgetregistry\E257CD03\irhswidgetplugin.qtplugin private\20022f35\import\widgetregistry\E257CD03\irhswidgetplugin.qtplugin +data=ZPRIVATE\20022f35\import\widgetregistry\E257CD03\irhswidgetplugin.manifest private\20022f35\import\widgetregistry\E257CD03\irhswidgetplugin.manifest +data=ZPRIVATE\20022f35\import\widgetregistry\E257CD03\irhswidgetplugin.xml private\20022f35\import\widgetregistry\E257CD03\irhswidgetplugin.xml + + +#endif //__IRHSWIDGETPLUGIN_IBY__ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/rom/irhswidgetplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/rom/irhswidgetplugin_resources.iby Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef IRHSWIDGETPLUGIN_RESOURCES_IBY +#define IRHSWIDGETPLUGIN_RESOURCES_IBY + + +#endif // IRHSWIDGETPLUGIN_RESOURCES_IBY diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/src/irappinspector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/src/irappinspector.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Radio App Insecptor +* +*/ + +// System includes +#include +#include +#include + +// User includes +#include "irappinspector.h" +#include "irservicedef.h" + +// Constructor +IrAppInspector::IrAppInspector(QObject *aParent) : + QObject(aParent), + mSettingsManager(new XQSettingsManager(this)), + mIrRunningStatusKey(XQSettingsKey::TargetPublishAndSubscribe, + KInternetRadioPSUid, + KInternetRadioStartupKey) +{ + QObject::connect(mSettingsManager, SIGNAL(itemDeleted(XQSettingsKey)), + this, SLOT(handleIrExit(XQSettingsKey))); + QObject::connect(mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), + this, SLOT(handleIrRunningStatusChanged(XQSettingsKey, QVariant))); +} + +// Destructor +IrAppInspector::~IrAppInspector() +{ + stopInspectingIrRunningStatus(); +} + + +/*! + Handling of deletion of listened P&S key. + \param aKey Deleted key. + */ +void IrAppInspector::handleIrExit(const XQSettingsKey &aKey) +{ + if (KInternetRadioPSUid == aKey.uid() + && KInternetRadioStartupKey == aKey.key()) + { + emit irRunningStatusChanged(Exiting); + + // since the P&S key has been deleted, should re-start the inspecting + startInspectingIrRunningStatus(); + } +} + + +void IrAppInspector::handleIrRunningStatusChanged(const XQSettingsKey &aKey, + const QVariant &aValue) +{ + if (KInternetRadioPSUid == aKey.uid() + && KInternetRadioStartupKey == aKey.key()) + { + if (aValue.isValid()) + { + if (aValue.canConvert(QVariant::Int)) + { + emit irRunningStatusChanged(StartingUp); + } + } + } +} + +bool IrAppInspector::startInspectingIrRunningStatus() +{ + return mSettingsManager->startMonitoring(mIrRunningStatusKey); +} + +void IrAppInspector::stopInspectingIrRunningStatus() +{ + mSettingsManager->stopMonitoring(mIrRunningStatusKey); +} + +bool IrAppInspector::isIrRunning() +{ + QVariant value = mSettingsManager->readItemValue(mIrRunningStatusKey); + if (value.isValid()) + { + if (value.canConvert(QVariant::Int)) + { + return true; + } + } + return false; +} + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/src/irhswidget.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/src/irhswidget.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,484 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Radio home screen widget +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// User includes +#include "irhswidget.h" +#include "irserviceclient.h" + +// Defines +static const QString KIrHsWidgetDocml = ":/resource/irhswidget.docml"; +static const QString KIrHsWidget = "irhswidget"; +static const QString KLogoLabel = "logoLabel"; +static const QString KGoToIrLabel = "goToIrLabel"; +static const QString KControlLabel = "controlLabel"; +static const QString KFirstRowLabel = "firstRowLabel"; +static const QString KSecondRowLabel = "secondRowLabel"; +static const QString KInfoControlArea = "info_control_area"; +static const QString KCentrolArea = "infoLayout"; + +static const QString KDefaultStationLogo = "qtg_large_internet_radio"; +static const QString KPlayButtonIcon = "qtg_mono_play"; +static const QString KStopButtonIcon = "qtg_mono_stop"; + +static const QString KFrameGraphicsName = "qtg_fr_hswidget_normal"; +static const QString KStationNameColor = "qtc_hs_list_item_title"; +static const QString KMetaDataColor = "qtc_hs_list_item_content"; + +static const QString KLoadingAnimationPrefix = "qtg_anim_loading_"; +static const QString KLoadingIconName = "LoadingAnimation"; + +const int KIrHsWidgetLogoSize = 50; // hs widget logo size + +// ======== MEMBER FUNCTIONS ======== +// Constructor +IrHsWidget::IrHsWidget(QGraphicsItem* aParent, Qt::WindowFlags aFlags) + : HbWidget(aParent, aFlags), + mLogoLabel(NULL), + mControlLabel(NULL), + mGoToIrLabel(NULL), + mStationNameLabel(NULL), + mMetadataLabel(NULL), + mInfoControlArea(NULL), + mCentralArea(NULL), + mServiceClient(NULL), + mIrState(IrAppState::Unknown), + mIrHsWidgetState(EUnknown) +{ + setupUi(); + initHomeSreenWidget(); + + mServiceClient = new IrServiceClient(this); + setupConnection(); +} + +// Destructor +IrHsWidget::~IrHsWidget() +{ +} + +// Initializes the widget. +// called by kqti fw when widget is added to home screen +void IrHsWidget::onInitialize() +{ + mServiceClient->startMonitoringIrState(); +} + +// Uninitializes the widget. +// called by kqti fw when widget is removed from home screen +void IrHsWidget::onUninitialize() +{ +} + +// Called when widget is shown in the home screen +void IrHsWidget::onShow() +{ +} + +// Called when widget is hidden from the home screen +void IrHsWidget::onHide() +{ +} + + +void IrHsWidget::setupUi() +{ + HbDocumentLoader *uiLoader = new HbDocumentLoader(); + uiLoader->reset(); + + bool loaded = false; + uiLoader->load(KIrHsWidgetDocml, &loaded); + + if (loaded) + { + HbWidget *irHsWidget = qobject_cast(uiLoader->findWidget(KIrHsWidget)); + HbFrameDrawer *irHsWidgetDrawer = new HbFrameDrawer(KFrameGraphicsName, HbFrameDrawer::NinePieces); + HbFrameItem *irHsWidgetBgItem = new HbFrameItem(irHsWidgetDrawer, irHsWidget); + irHsWidgetBgItem->setPreferredSize(irHsWidget->preferredSize()); + + QGraphicsLinearLayout *irHsWidgetLayout = new QGraphicsLinearLayout(Qt::Vertical, this); + irHsWidgetLayout->addItem(irHsWidget); + setLayout(irHsWidgetLayout); + + mGoToIrLabel = qobject_cast(uiLoader->findWidget(KGoToIrLabel)); + mLogoLabel = qobject_cast(uiLoader->findWidget(KLogoLabel)); + mControlLabel = qobject_cast(uiLoader->findWidget(KControlLabel)); + mInfoControlArea = qobject_cast(uiLoader->findWidget(KInfoControlArea)); + mCentralArea = qobject_cast(uiLoader->findWidget(KCentrolArea)); + + // make system's hs backgourd item under logo + irHsWidgetBgItem->stackBefore(mLogoLabel); + + // set font for station name line + mStationNameLabel = qobject_cast(uiLoader->findWidget(KFirstRowLabel)); + mStationNameLabel->setTextColor(HbColorScheme::color(KStationNameColor)); + + // set font for meta data line + mMetadataLabel = qobject_cast(uiLoader->findWidget(KSecondRowLabel)); + mMetadataLabel->setTextColor(HbColorScheme::color(KMetaDataColor)); + + // Create animation. + HbIconAnimationManager *animationManager = HbIconAnimationManager::global(); + HbIconAnimationDefinition animationDefinition; + HbIconAnimationDefinition::AnimationFrame animationFrame; + QList animationFrameList; + + QString animationFrameIconName; + for (int i = 1; i < 11; i++) + { + animationFrame.duration = 100; + animationFrameIconName.clear(); + animationFrameIconName.append(KLoadingAnimationPrefix); + animationFrameIconName.append(animationFrameIconName.number(i)); + animationFrame.iconName = animationFrameIconName; + animationFrameList.append(animationFrame); + } + animationDefinition.setPlayMode(HbIconAnimationDefinition::Loop); + animationDefinition.setFrameList(animationFrameList); + animationManager->addDefinition(KLoadingIconName, animationDefinition); + + // Construct an icon using the animation definition. + mLoadingIcon.setIconName(KLoadingIconName); + + // install event filter to widget + mGoToIrLabel->installEventFilter(this); + mControlLabel->installEventFilter(this); + mLogoLabel->installEventFilter(this); + mCentralArea->installEventFilter(this); + } + + delete uiLoader; +} + +void IrHsWidget::initHomeSreenWidget() +{ + if (mServiceClient->isStationPlayed()) + { + loadStoppedLayout(); + QString stationName; + if (mServiceClient->loadStationName(stationName)) + { + mStationNameLabel->setPlainText(stationName); + } + + if (mServiceClient->loadStationLogoFlag()) + { + loadStationLogo(); + } + } + else + { + loadInitLayout(); + } +} + +void IrHsWidget::setupConnection() +{ + // signal - slot for service event + QObject::connect(mServiceClient, SIGNAL(stationNameUpdated(QString)), + this, SLOT(handleStationNameUpdated(QString))); + QObject::connect(mServiceClient, SIGNAL(stationLogoUpdated(bool)), + this, SLOT(handleStationLogoUpdated(bool))); + QObject::connect(mServiceClient, SIGNAL(metaDataUpdated(QString)), + this, SLOT(handleMetaDataUpdated(QString))); + QObject::connect(mServiceClient, SIGNAL(irStateChanged(IrAppState::Type)), + this, SLOT(handleIrStateUpdated(IrAppState::Type))); + QObject::connect(mServiceClient, SIGNAL(controlFailed()), + this, SLOT(handleControlFailed())); +} + +bool IrHsWidget::eventFilter(QObject *aObject, QEvent *aEvent) +{ + bool eventWasConsumed = false; + QString objectName = aObject->objectName(); + QEvent::Type eventType = aEvent->type(); + + if (KGoToIrLabel == objectName) + { + if (QEvent::GraphicsSceneMousePress == eventType) + { + eventWasConsumed = true; + handleGoToIrAreaAction(); + } + } + else if (KLogoLabel == objectName) + { + if (QEvent::GraphicsSceneMousePress == eventType) + { + eventWasConsumed = true; + handleLogoAreaAction(); + } + } + else if (KControlLabel == objectName) + { + if (QEvent::GraphicsSceneMousePress == eventType) + { + eventWasConsumed = true; + handleControlAreaAction(); + } + } + else if (KCentrolArea == objectName) + { + if (QEvent::GraphicsSceneMousePress == eventType) + { + eventWasConsumed = true; + handleCentralAreaAction(); + } + } + + return eventWasConsumed; +} + +// ================ handle user press event =============== +void IrHsWidget::handleLogoAreaAction() +{ + switch (mIrState) + { + case IrAppState::NoRunInit: + case IrAppState::NoRunStopped: + mServiceClient->launchIrNormally(); + break; + + case IrAppState::RunningInit: + case IrAppState::RunningStopped: + case IrAppState::Playing: + case IrAppState::Loading: + mServiceClient->bringIrForeground(); + break; + + default: + break; + } +} + +void IrHsWidget::handleControlAreaAction() +{ + switch (mIrState) + { + case IrAppState::NoRunStopped: + mServiceClient->launchIrNowPlaying(); + loadLoadingLayout(); + break; + + case IrAppState::RunningStopped: + mServiceClient->startPlaying(); + loadLoadingLayout(); + break; + + case IrAppState::Playing: + mServiceClient->stopPlaying(); + loadStoppedLayout(); + break; + + case IrAppState::Loading: + mServiceClient->cancelLoading(); + loadStoppedLayout(); + break; + + default: + break; + } +} + +void IrHsWidget::handleGoToIrAreaAction() +{ + handleLogoAreaAction(); +} + +void IrHsWidget::handleCentralAreaAction() +{ + handleLogoAreaAction(); +} + +void IrHsWidget::handleControlFailed() +{ + switch (mIrHsWidgetState) + { + case EInit: // LAF == [logo][go to interneat radio] + loadInitLayout(); + break; + + case EPlaying: // LAF == [logo][StationInfo][Play] + loadPlayingLayout(); + break; + + case EStopped: // LAF == [logo][StationInfo][Stop] + loadStoppedLayout(); + break; + + case ELoading: // LAF == [logo][StationInfo][Loading] + loadLoadingLayout(); + break; + + default: + break; + } +} + + +// ======== for service notification ======== +void IrHsWidget::handleStationNameUpdated(const QString &aStationName) +{ + if (mStationNameLabel->plainText() != aStationName) + { + mStationNameLabel->setPlainText(aStationName); + } +} + +void IrHsWidget::handleStationLogoUpdated(bool aLogoAvailable) +{ + if (aLogoAvailable) + { + loadStationLogo(); + } + else + { + mLogoLabel->setIcon(KDefaultStationLogo); + } +} + +void IrHsWidget::handleMetaDataUpdated(const QString &aMetaData) +{ + if (mMetadataLabel->plainText() != aMetaData) + { + mMetadataLabel->setPlainText(aMetaData); + } +} + + +void IrHsWidget::handleIrStateUpdated(IrAppState::Type aNewState) +{ + if (aNewState == mIrState) + { + return; + } + + mIrState = aNewState; + switch (mIrState) + { + case IrAppState::NoRunInit: + case IrAppState::RunningInit: // LAF == [logo][go to interneat radio] + handleHsWidgetStateChange(EInit); + break; + + case IrAppState::NoRunStopped: + case IrAppState::RunningStopped: // LAF == [logo][StationInfo][Play] + handleHsWidgetStateChange(EStopped); + break; + + case IrAppState::Playing: // LAF == [logo][StationInfo][Stop] + handleHsWidgetStateChange(EPlaying); + break; + + case IrAppState::Loading: // LAF == [logo][StationInfo][Loading] + handleHsWidgetStateChange(ELoading); + break; + + default: + break; + } +} + +void IrHsWidget::handleHsWidgetStateChange(IrHsWidgetState aNewState) +{ + if (aNewState == mIrHsWidgetState) + { + return; + } + + mIrHsWidgetState = aNewState; + switch (mIrHsWidgetState) + { + case EInit: // LAF == [logo][go to interneat radio] + loadInitLayout(); + break; + + case EPlaying: // LAF == [logo][StationInfo][Play] + loadPlayingLayout(); + break; + + case EStopped: // LAF == [logo][StationInfo][Stop] + loadStoppedLayout(); + break; + + case ELoading: // LAF == [logo][StationInfo][Loading] + loadLoadingLayout(); + break; + + default: + break; + } +} +// LAF == [logo][go to interneat radio] +void IrHsWidget::loadInitLayout() +{ + mInfoControlArea->hide(); + mGoToIrLabel->show(); +} + +// LAF == [logo][StationInfo][Play] +void IrHsWidget::loadStoppedLayout() +{ + mGoToIrLabel->hide(); + mInfoControlArea->show(); + mMetadataLabel->setPlainText(QString("")); + mControlLabel->setIcon(KPlayButtonIcon); +} + +// LAF == [logo][StationInfo][Stop] +void IrHsWidget::loadPlayingLayout() +{ + mGoToIrLabel->hide(); + mInfoControlArea->show(); + mControlLabel->setIcon(KStopButtonIcon); +} + +// LAF == [logo][StationInfo][Loading] +void IrHsWidget::loadLoadingLayout() +{ + mGoToIrLabel->hide(); + mInfoControlArea->show(); + mMetadataLabel->setPlainText(QString("")); + mControlLabel->setIcon(mLoadingIcon); +} + +void IrHsWidget::loadStationLogo() +{ + QSettings settings(KIrSettingOrganization, KIrSettingApplicaton); + if (settings.value(KIrSettingStationLogo).canConvert()) + { + QPixmap logoPixmap = settings.value(KIrSettingStationLogo).value(); + QPixmap newLogoPixmap = + logoPixmap.scaled(QSize(KIrHsWidgetLogoSize,KIrHsWidgetLogoSize),Qt::KeepAspectRatio); + QIcon logoQIcon(newLogoPixmap); + HbIcon logoHbIcon(logoQIcon); + mLogoLabel->setIcon(logoHbIcon); + } +} + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/src/irhswidgetplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/src/irhswidgetplugin.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Internet Radio home screen widget plugin +* +*/ + +#include +#include +#include + +#include "irhswidgetplugin.h" +#include "irhswidget.h" + + +/*! + Initialize plugin for Internet Radio home screen widget. Contains necessary information about + the internet radio widget that it can be loaded through QT Service Framework. +*/ +QObject *IrHsWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &aDescriptor, + QServiceContext *aContext, + QAbstractSecuritySession *aSession) +{ + Q_UNUSED(aContext); + Q_UNUSED(aSession); + + if (aDescriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) + { + return new IrHsWidget(); + } + else + { + return 0; + } +} + +Q_EXPORT_PLUGIN2(irhswidgetplugin, IrHsWidgetPlugin) diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irhswidgetplugin/src/irserviceclient.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irhswidgetplugin/src/irserviceclient.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,507 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: internet radio hs widget service client +* +*/ + +// System includes +#include +#include +#include +#include +#include +#include + + +// User includes +#include "irserviceclient.h" +#include "irservicedata.h" + +// Constants +// For services via Qt HighWay +static const QString KIrServiceName = "internet_radio_10_1"; +static const QString KIrServiceControlInterfaceName = "com.nokia.symbian.IInternetRadioControl"; +static const QString KIrServiceControlOperation = "handleCmd(int)"; +static const QString KIrServiceMonitorInterfaceName = "com.nokia.symbian.IInternetRadioMonitor"; +static const QString KIrServiceMonitorOperation = "registerNotifications()"; +static const QString KIrServiceRefreshOperation = "refreshAllData()"; + +// ==================== MEMBER FUNCTIONS ====================== +// Constructor +IrServiceClient::IrServiceClient(QObject *aParent) : + QObject(aParent), + mIrAppInspector(NULL), + mMonitorReqOngoing(false), + mControlReqOngoing(false), + mMonitorRequest(NULL), + mRefreshRequest(NULL), + mControlRequest(NULL) +{ + mIrAppInspector = new IrAppInspector(this); + + QObject::connect(mIrAppInspector, SIGNAL(irRunningStatusChanged(IrAppInspector::IrRunningStatus)), + this, SLOT(handleIrRunningStatusChanged(IrAppInspector::IrRunningStatus))); +} + +// Destructor +IrServiceClient::~IrServiceClient() +{ + delete mMonitorRequest; + mMonitorRequest = NULL; + + delete mRefreshRequest; + mRefreshRequest = NULL; + + delete mControlRequest; + mControlRequest = NULL; +} + +bool IrServiceClient::startMonitoringIrState() +{ + bool retVal = false; + if (mIrAppInspector->isIrRunning()) + { + retVal = doSendRefreshRequest(); + } + else + { + if (isStationPlayed()) + { + initHsWidgetNoRunStopped(); + } + else + { + emit irStateChanged(IrAppState::NoRunInit); + } + } + + return mIrAppInspector->startInspectingIrRunningStatus() && retVal; +} + +void IrServiceClient::stopMonitoringIrState() +{ + delete mMonitorRequest; + mMonitorRequest = NULL; + + delete mRefreshRequest; + mRefreshRequest = NULL; +} + +void IrServiceClient::initHsWidgetNoRunStopped() +{ + emit irStateChanged(IrAppState::NoRunStopped); + + QString stationName; + if (loadStationName(stationName)) + { + emit stationNameUpdated(stationName); + } + else + { + emit stationNameUpdated(QString("")); + } + + emit stationLogoUpdated(loadStationLogoFlag()); +} + +/****************************************************************** +**************** Monitor Service Request ********************** +*******************************************************************/ +bool IrServiceClient::doSendMonitorRequest() +{ + if(mMonitorReqOngoing) + { + return false; + } + + if (NULL == mMonitorRequest + &&!createMonitorServiceRequest()) + { + return false; + } + + prepareRequestInfo(mMonitorRequest, DoNotChange); + return mMonitorRequest->send(); +} + +bool IrServiceClient::createMonitorServiceRequest() +{ + bool retVal = false; + + if (NULL == mMonitorRequest) + { + mMonitorRequest = mApplicationManager.create(KIrServiceName, + KIrServiceMonitorInterfaceName, + KIrServiceMonitorOperation, + false); + + if (mMonitorRequest) + { + retVal = true; + + connect(mMonitorRequest, SIGNAL(requestOk(const QVariant&)), + this, SLOT(handleMonitorRequestOk(const QVariant&))); + connect(mMonitorRequest, SIGNAL(requestError(int,const QString&)), + this, SLOT(handleMonitorRequestError(int,const QString&))); + + mMonitorRequest->setEmbedded(false); + mMonitorRequest->setSynchronous(false); + } + } + else + { + retVal = true; + } + + return retVal; +} + +// ==================== Refresh Service Request =========================== +bool IrServiceClient::doSendRefreshRequest() +{ + if(mMonitorReqOngoing) + { + return false; + } + + if (NULL == mRefreshRequest + && !createRefreshServiceRequest()) + { + return false; + } + + prepareRequestInfo(mRefreshRequest, DoNotChange); + return mRefreshRequest->send(); +} + +bool IrServiceClient::createRefreshServiceRequest() +{ + bool retVal = false; + + if (NULL == mRefreshRequest) + { + mRefreshRequest = mApplicationManager.create(KIrServiceName, + KIrServiceMonitorInterfaceName, + KIrServiceRefreshOperation, + false); + + if (mRefreshRequest) + { + retVal = true; + + connect(mRefreshRequest, SIGNAL(requestOk(const QVariant&)), + this, SLOT(handleMonitorRequestOk(const QVariant&))); + connect(mRefreshRequest, SIGNAL(requestError(int,const QString&)), + this, SLOT(handleMonitorRequestError(int,const QString&))); + + mRefreshRequest->setEmbedded(false); + mRefreshRequest->setSynchronous(false); + } + } + else + { + retVal = true; + } + + return retVal; +} + +void IrServiceClient::handleMonitorRequestOk(const QVariant &aRetValue) +{ + mMonitorReqOngoing = false; + + doSendMonitorRequest(); + + if (aRetValue.isValid() + && aRetValue.canConvert(QVariant::List)) + { + QVariantList dataList = aRetValue.toList(); + foreach (const QVariant& data, dataList) + { + if (data.canConvert()) + { + IrServiceData serviceData = data.value(); + processNotificationData(serviceData); + } + } + } +} + +void IrServiceClient::handleMonitorRequestError(int aErrCode, const QString &aErrMessage) +{ + mMonitorReqOngoing = false; + + Q_UNUSED(aErrCode); + Q_UNUSED(aErrMessage); +} + +/****************************************************************** +**************** Control Service Request ********************** +*******************************************************************/ +bool IrServiceClient::bringIrForeground() +{ + QVariant commandArgument(QVariant::Int); + commandArgument.setValue((int)IrServiceCmd::Foreground); + return doSendControlRequest(commandArgument, true, ToForeground); +} + +bool IrServiceClient::launchIrNormally() +{ + QVariant commandArgument(QVariant::Int); + commandArgument.setValue((int)IrServiceCmd::LaunchNormally); + return doSendControlRequest(commandArgument, true, ToForeground); +} + +bool IrServiceClient::launchIrNowPlaying() +{ + QVariant commandArgument(QVariant::Int); + commandArgument.setValue((int)IrServiceCmd::LaunchNowPlayingView); + return doSendControlRequest(commandArgument, false, ToBackground); +} + + +bool IrServiceClient::startPlaying() +{ + QVariant commandArgument(QVariant::Int); + commandArgument.setValue((int)IrServiceCmd::Play); + return doSendControlRequest(commandArgument, true, DoNotChange); +} + + +bool IrServiceClient::stopPlaying() +{ + QVariant commandArgument(QVariant::Int); + commandArgument.setValue((int)IrServiceCmd::Stop); + return doSendControlRequest(commandArgument, true, DoNotChange); +} + +bool IrServiceClient::cancelLoading() +{ + QVariant commandArgument(QVariant::Int); + commandArgument.setValue((int)IrServiceCmd::Cancel); + return doSendControlRequest(commandArgument, true, DoNotChange); +} + +bool IrServiceClient::doSendControlRequest(const QVariant &aArgument, bool aIsSync, IrAppVisibilty aVisibility) +{ + if(mControlReqOngoing) + { + return false; + } + + if (NULL == mControlRequest && + !createControlServiceRequest()) + { + return false; + } + + QList arguments; + arguments.append(aArgument); + mControlRequest->setArguments(arguments); + + prepareRequestInfo(mControlRequest, aVisibility); + mControlRequest->setSynchronous(aIsSync); + return mControlRequest->send(); +} + +bool IrServiceClient::createControlServiceRequest() +{ + bool retVal = false; + + if (NULL == mControlRequest) + { + mControlRequest = mApplicationManager.create(KIrServiceName, + KIrServiceControlInterfaceName, + KIrServiceControlOperation, + false); + + if (mControlRequest) + { + retVal = true; + + connect(mControlRequest, SIGNAL(requestOk(const QVariant&)), + this, SLOT(handleControlRequestOk(const QVariant&))); + connect(mControlRequest, SIGNAL(requestError(int,const QString&)), + this, SLOT(handleControlRequestError(int,const QString&))); + + mControlRequest->setEmbedded(false); + } + } + else + { + retVal = true; + } + + return retVal; +} + +void IrServiceClient::handleControlRequestOk(const QVariant &aRetValue) +{ + mControlReqOngoing = false; + + if (aRetValue.isValid() + && aRetValue.canConvert(QVariant::Int)) + { + if (IrServiceResult::Fail == aRetValue.toInt()) + { + emit controlFailed(); + } + } +} + +void IrServiceClient::handleControlRequestError(int aErrCode, const QString &aErrMessage) +{ + mControlReqOngoing = false; + + emit controlFailed(); + + Q_UNUSED(aErrCode); + Q_UNUSED(aErrMessage); +} +/****************************************************************** +************************* Others ****************************** +*******************************************************************/ +// slot connected to signals from IrAppInspector, +// used to monitor the startup / exit of IR +void IrServiceClient::handleIrRunningStatusChanged(IrAppInspector::IrRunningStatus aNewStatus) +{ + switch (aNewStatus) + { + case IrAppInspector::StartingUp : + doSendRefreshRequest(); + break; + + case IrAppInspector::Exiting : + stopMonitoringIrState(); + + if (isStationPlayed()) + { + resetHsWidgetExitStopped(); + } + else + { + emit irStateChanged(IrAppState::NoRunInit); + } + break; + + default: + break; + } +} + +void IrServiceClient::resetHsWidgetExitStopped() +{ + emit irStateChanged(IrAppState::NoRunStopped); + emit metaDataUpdated(QString("")); +} + +// used to process service data sent from IR app. +void IrServiceClient::processNotificationData(const IrServiceData &aServiceData) +{ + QVariant data = aServiceData.mData; + if (!data.isValid()) + { + return; + } + switch (aServiceData.mType) + { + case IrServiceNotification::StationName: + if (data.canConvert(QVariant::String)) + { + emit stationNameUpdated(data.toString()); + } + break; + + case IrServiceNotification::MetaData: + if (data.canConvert(QVariant::String)) + { + emit metaDataUpdated(data.toString()); + } + break; + + case IrServiceNotification::StationLogo: + if (data.canConvert(QVariant::Bool)) + { + emit stationLogoUpdated(data.toBool()); + } + break; + + case IrServiceNotification::IrState: + if (data.canConvert(QVariant::Int)) + { + emit irStateChanged((IrAppState::Type)data.toInt()); + } + break; + + default: + break; + } + +} + +// prepare the request send to IR app, including control request, refresh request, monitor request. +void IrServiceClient::prepareRequestInfo(XQAiwRequest *aRequest, IrAppVisibilty aVisibility) +{ + if (NULL == aRequest) + { + return; + } + + XQRequestInfo reqInfo; + switch (aVisibility) + { + case ToForeground: + reqInfo.setForeground(true); + break; + case ToBackground: + reqInfo.setBackground(true); + break; + case DoNotChange: + break; + default: + break; + } + + aRequest->setInfo(reqInfo); +} + +bool IrServiceClient::isStationPlayed() +{ + QSettings settings(KIrSettingOrganization, KIrSettingApplicaton); + QString stationName = settings.value(KIrSettingStationName,KIrDefaultStationName).toString(); + return stationName != KIrDefaultStationName; +} + +bool IrServiceClient::loadStationLogoFlag() +{ + QSettings settings(KIrSettingOrganization, KIrSettingApplicaton); + return settings.value(KIrSettingStationLogoAvailable,false).toBool(); +} + +bool IrServiceClient::loadStationName(QString &aStationName) +{ + QSettings settings(KIrSettingOrganization, KIrSettingApplicaton); + aStationName = settings.value(KIrSettingStationName,KIrDefaultStationName).toString(); + if(aStationName != KIrDefaultStationName) + { + return true; + } + else + { + return false; + } +} + +Q_IMPLEMENT_USER_METATYPE(IrServiceData) + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqcommon/inc/irqisdsdatastructure.h --- a/qtinternetradio/irqcommon/inc/irqisdsdatastructure.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqcommon/inc/irqisdsdatastructure.h Wed Jun 23 18:04:00 2010 +0300 @@ -103,7 +103,6 @@ int uniqID; //unique id generated for the preset saved at favourite int type; //0 for user defined 1 for isds type. - int index;//index in the preset table int presetId;//isds generated preset id QString name; //preset name QString languageCode;//preset language code @@ -118,7 +117,6 @@ QString shortDesc;//channel short desription QString genreName;//channel genre name QString genreId;//channel genre id - int bitrate;//channel bitrate //in our spec but not in current code QString advertisementUrl; diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqcommon/inc/irservicedata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irqcommon/inc/irservicedata.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef IRSERVICEDATA_H +#define IRSERVICEDATA_H + +#include +#include +#include + +class IrServiceData +{ +public: + + IrServiceData() : mType(-1) {} + IrServiceData(int aType, const QVariant &aData) : + mType(aType), + mData(aData) + {} + + virtual ~IrServiceData() {} + + template void serialize(Stream &aStream) const; + template void deserialize(Stream &aStream); + + int mType; + QVariant mData; +}; + +template inline void IrServiceData::serialize(Stream &aStream) const +{ + aStream << mType; + aStream << mData; +} + +template inline void IrServiceData::deserialize(Stream &aStream) +{ + aStream >> mType; + aStream >> mData; +} + +Q_DECLARE_USER_METATYPE(IrServiceData) + + + +#endif // IRSERVICEDATA_H diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqcommon/inc/irservicedef.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/irqcommon/inc/irservicedef.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef IRSERVICEDEF_H +#define IRSERVICEDEF_H + +#include + +// For settings via QSetting +static const QString KIrSettingOrganization = "nokia.s60.mymex"; +static const QString KIrSettingApplicaton = "internetradio"; +static const QString KIrSettingStationName = "lastplayedinfo/station_name"; +static const QString KIrDefaultStationName = "no_station_played_yet"; +static const QString KIrSettingStationLogo = "lastplayedinfo/station_logo"; +static const QString KIrSettingStationLogoAvailable = "lastplayedinfo/station_logo_available"; + +// For P&S XQSettingsManager +const long int KInternetRadioPSUid = 0xE28364bb; // Internet Radio's UID3 +const unsigned long int KInternetRadioStartupKey = 0x00000035; // a empty slot in internetradio2.0\include\irpubsubkeys.h + + +Q_ENUMS(IrServiceCmd::Type IrServiceNotification::Type IrAppState::Type IrServiceResult::Type) + +namespace IrServiceCmd +{ + enum Type + { + Unknown = -1, + LaunchNormally = 0, + LaunchNowPlayingView = 1, + Play = 2, + Stop = 3, + Cancel = 4, + Foreground = 5 + }; +} + +namespace IrServiceNotification +{ + enum Type + { + Unknown = -1, + IrState = 0, + StationLogo = 1, + StationName = 2, + MetaData = 3 + }; +} + + +namespace IrAppState +{ + enum Type + { + Unknown = -1, + NoRunInit = 0, // internet radio is not running, and no station has been played yet + NoRunStopped = 1, // internet radio is not running, with last played station + RunningInit = 2, // running, no station has been played yet + RunningStopped = 3, // running, with last played station + Playing = 4, + Loading = 5 + }; +} + +namespace IrServiceResult +{ + enum Type + { + Success = -1, + Fail = 0 + }; +} + +#endif // IRSERVICEDEF_H diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqcommon/irqcommon.pro --- a/qtinternetradio/irqcommon/irqcommon.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqcommon/irqcommon.pro Wed Jun 23 18:04:00 2010 +0300 @@ -18,7 +18,7 @@ MOC_DIR = moc DEPENDPATH = src - +defFilePath = .. INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE INCLUDEPATH += ../../internetradio2.0/datastructuresinc \ @@ -31,6 +31,7 @@ -lapgrfx \ -lxqsettingsmanager \ -lapmime \ + -lapparc \ -lpsclient100 symbian{ @@ -42,7 +43,9 @@ #header files list HEADERS += inc\irqisdsdatastructure.h \ - inc\irqutility.h + inc\irqutility.h \ + inc\irservicedata.h \ + inc\irservicedef.h #source files list diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqcommon/src/irqisdsdatastructure.cpp --- a/qtinternetradio/irqcommon/src/irqisdsdatastructure.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqcommon/src/irqisdsdatastructure.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -31,8 +31,8 @@ //we need to initialize all the member for sometimes, it will //crash by overflow if we don't do this. -EXPORT_C IRQPreset::IRQPreset():uniqID(0),type(0),index(0),presetId(0), - bitrate(0),iIsSorted(false),iChannelUrlCount(0) +EXPORT_C IRQPreset::IRQPreset():uniqID(0),type(0),presetId(0), + iIsSorted(false),iChannelUrlCount(0) { } @@ -63,7 +63,6 @@ this->imgUrl = aOther.imgUrl; this->advertisementInUse = aOther.advertisementInUse; this->advertisementUrl = aOther.advertisementUrl; - this->bitrate = aOther.bitrate; this->genreId = aOther.genreId; this->genreName = aOther.genreName; this->shortDesc = aOther.shortDesc; @@ -78,7 +77,6 @@ this->languageName = aOther.languageName; this->name = aOther.name; this->presetId = aOther.presetId; - this->index = aOther.index; this->type = aOther.type; this->iChannelUrlCount = aOther.iChannelUrlCount; this->uniqID = aOther.uniqID; @@ -87,7 +85,7 @@ EXPORT_C void IRQPreset::internalize(QDataStream &aStream) { - aStream>>uniqID>>presetId>>index>>type>>iChannelUrlCount; + aStream>>uniqID>>presetId>>type>>iChannelUrlCount; aStream>>languageCode>>languageName >>countryCode>>countryName @@ -108,7 +106,7 @@ EXPORT_C void IRQPreset::externalize(QDataStream &aStream) const { - aStream<iUid) ) { appIsHidden = capability().iAppIsHidden; } if(!appIsHidden) { - if(songRecognitionAppUid == appInfo.iUid) + if(songRecognitionAppUid == appInfo->iUid) { ret = true; break; } } } - + delete appInfo; lsSession.Close(); return ret; } diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqfavoritesdb/irqfavoritesdb.pro --- a/qtinternetradio/irqfavoritesdb/irqfavoritesdb.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqfavoritesdb/irqfavoritesdb.pro Wed Jun 23 18:04:00 2010 +0300 @@ -19,6 +19,7 @@ QT -= gui CONFIG += dll DEFINES += BUILD_IRQFAVORITES_DLL +defFilePath = .. MOC_DIR = moc DEPENDPATH = src diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqisdsclient/irqisdsclient.pro --- a/qtinternetradio/irqisdsclient/irqisdsclient.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqisdsclient/irqisdsclient.pro Wed Jun 23 18:04:00 2010 +0300 @@ -17,6 +17,7 @@ TARGET = irqisdsclient TARGET.CAPABILITY += CAP_GENERAL_DLL +defFilePath = .. MOC_DIR = moc DEPENDPATH = src diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqlogger/irqlogger.pro --- a/qtinternetradio/irqlogger/irqlogger.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqlogger/irqlogger.pro Wed Jun 23 18:04:00 2010 +0300 @@ -19,7 +19,7 @@ TARGET = irqlogger CONFIG += dll DEFINES += BUILD_IRQLOGGER_DLL - +defFilePath = .. MOC_DIR = moc diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqmediaplayer/irqmediaplayer.pro --- a/qtinternetradio/irqmediaplayer/irqmediaplayer.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqmediaplayer/irqmediaplayer.pro Wed Jun 23 18:04:00 2010 +0300 @@ -16,6 +16,7 @@ TARGET = irqmediaplayer TARGET.CAPABILITY = CAP_GENERAL_DLL +defFilePath = .. DEFINES += MMFADAPTER DEPENDPATH += src diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontroller.h --- a/qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontroller.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontroller.h Wed Jun 23 18:04:00 2010 +0300 @@ -60,30 +60,6 @@ * @return int Error code */ IMPORT_C IRQError getIAPId(unsigned long& aIapId) const; - - /** - * Returns the list of available access points - * @return QStringList &aList specifying the access point names - */ - IMPORT_C void getAccessPointList(QStringList &aList); - - /** - * Returns the list of iap ids for available access points - * @return QList &aList specifying the iap ids - */ - IMPORT_C void getApIdList(QList &aList); - - /** - * Returns the list of bearer ids for available access points - * @return QList &aList specifying the bearer ids - */ - IMPORT_C void getBearerList(QList &aList); - - /** - * Returns the list of network ids for available access points - * @return QList &aList specifying the network ids - */ - IMPORT_C void getNetworkList(QList &aList); /** * Configure the Access Point which is used by all the components for network connectivity diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontrollerbody.h --- a/qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontrollerbody.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqnetworkcontroller/inc/irqnetworkcontrollerbody.h Wed Jun 23 18:04:00 2010 +0300 @@ -53,30 +53,6 @@ * @return int Error code */ IRQError getIAPId(unsigned long& aIapId) const; - - /** - * Returns the list of available access points - * @return QStringList &aList specifying the access point names - */ - void getAccessPointList(QStringList &aList); - - /** - * Returns the list of iap ids for available access points - * @return QList &aList specifying the iap ids - */ - void getApIdList(QList &aList); - - /** - * Returns the list of bearer ids for available access points - * @return QList &aList specifying the bearer ids - */ - void getBearerList(QList &aList); - - /** - * Returns the list of network ids for available access points - * @return QList &aList specifying the network ids - */ - void getNetworkList(QList &aList); /** * Configure the Access Point which is used by all the components for network connectivity diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqnetworkcontroller/irqnetworkcontroller.pro --- a/qtinternetradio/irqnetworkcontroller/irqnetworkcontroller.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqnetworkcontroller/irqnetworkcontroller.pro Wed Jun 23 18:04:00 2010 +0300 @@ -19,6 +19,7 @@ MOC_DIR = moc DEPENDPATH += src +defFilePath = .. INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE INCLUDEPATH += $${OS_LAYER_PUBLIC_EXPORT_PATH(http)} diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqnetworkcontroller/src/irqnetworkcontroller.cpp --- a/qtinternetradio/irqnetworkcontroller/src/irqnetworkcontroller.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqnetworkcontroller/src/irqnetworkcontroller.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -88,50 +88,6 @@ } // --------------------------------------------------------------------------- -// IRQNetworkController::getAccessPointList() -// Returns the list of available access points -// @return QStringList &aList specifying the access point names -// --------------------------------------------------------------------------- -// -EXPORT_C void IRQNetworkController::getAccessPointList(QStringList &aList) -{ - iBody->getAccessPointList(aList); -} - -// --------------------------------------------------------------------------- -// IRQNetworkController::getApIdList() -// Returns the list of iap ids for available access points -// @return QList &aList specifying the iap ids -// --------------------------------------------------------------------------- -// -EXPORT_C void IRQNetworkController::getApIdList(QList &aList) -{ - iBody->getApIdList(aList); -} - -// --------------------------------------------------------------------------- -// IRQNetworkController::getBearerList() -// Returns the list of bearer ids for available access points -// @return QList &aList specifying the bearer ids -// --------------------------------------------------------------------------- -// -EXPORT_C void IRQNetworkController::getBearerList(QList &aList) -{ - iBody->getBearerList(aList); -} - -// --------------------------------------------------------------------------- -// IRQNetworkController::getNetworkList() -// Returns the list of network ids for available access points -// @return QList &aList specifying the network ids -// --------------------------------------------------------------------------- -// -EXPORT_C void IRQNetworkController::getNetworkList(QList &aList) -{ - iBody->getNetworkList(aList); -} - -// --------------------------------------------------------------------------- // IRQNetworkController::chooseAccessPoint() // Configures the Access Point which is used by all the components for network // connectivity diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqnetworkcontroller/src/irqnetworkcontrollerbody.cpp --- a/qtinternetradio/irqnetworkcontroller/src/irqnetworkcontrollerbody.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqnetworkcontroller/src/irqnetworkcontrollerbody.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -61,68 +61,6 @@ } // --------------------------------------------------------------------------- -// IRQNetworkControllerBody::getAccessPointList() -// Returns the list of available access points -// @return QStringList &aList specifying the access point names -// --------------------------------------------------------------------------- -// -void IRQNetworkControllerBody::getAccessPointList(QStringList &aList) -{ - const CDesCArray *apArray = iNetworkController->GetAccessPointList(); - int count = apArray->MdcaCount(); - for (int i = 0; i < count; ++i) - { - QString str = QString::fromUtf16(apArray->MdcaPoint(i).Ptr(), apArray->MdcaPoint(i).Length()); - aList.append(str); - } -} - -// --------------------------------------------------------------------------- -// IRQNetworkControllerBody::getApIdList() -// Returns the list of iap ids for available access points -// @return QList &aList specifying the iap ids -// --------------------------------------------------------------------------- -// -void IRQNetworkControllerBody::getApIdList(QList &aList) -{ - const RArray& accessPointIDArray = iNetworkController->GetApList(); - for (int i = 0; i < accessPointIDArray.Count(); ++i) - { - aList.append(accessPointIDArray[i]); - } -} - -// --------------------------------------------------------------------------- -// IRQNetworkControllerBody::getBearerList() -// Returns the list of bearer ids for available access points -// @return QList &aList specifying the bearer ids -// --------------------------------------------------------------------------- -// -void IRQNetworkControllerBody::getBearerList(QList &aList) -{ - const RArray& bearerIDArray = iNetworkController->GetBearerList(); - for (int i = 0; i < bearerIDArray.Count(); ++i) - { - aList.append(bearerIDArray[i]); - } -} - -// --------------------------------------------------------------------------- -// IRQNetworkControllerBody::getNetworkList() -// Returns the list of network ids for available access points -// @return QList &aList specifying the network ids -// --------------------------------------------------------------------------- -// -void IRQNetworkControllerBody::getNetworkList(QList &aList) -{ - const RArray& networkIDArray = iNetworkController->GetNetworkList(); - for (int i = 0; i < networkIDArray.Count(); ++i) - { - aList.append(networkIDArray[i]); - } -} - -// --------------------------------------------------------------------------- // IRQNetworkControllerBody::chooseAccessPoint() // Configures the Access Point which is used by all the components for network // connectivity diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqnwkinfoobserver/irqnwkinfoobserver.pro --- a/qtinternetradio/irqnwkinfoobserver/irqnwkinfoobserver.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqnwkinfoobserver/irqnwkinfoobserver.pro Wed Jun 23 18:04:00 2010 +0300 @@ -19,6 +19,7 @@ MOC_DIR = moc DEPENDPATH += src +defFilePath = .. INCLUDEPATH += inc diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqsettings/inc/irqsettings.h --- a/qtinternetradio/irqsettings/inc/irqsettings.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqsettings/inc/irqsettings.h Wed Jun 23 18:04:00 2010 +0300 @@ -101,7 +101,8 @@ /** * Creates IRQSettings instance */ - static IRQSettings* createInstanceL(); + static IRQSettings* createInstance(); + static void doCreateInstanceL(IRQSettings * aQsettings); void constructL(); diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqsettings/irqsettings.pro --- a/qtinternetradio/irqsettings/irqsettings.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqsettings/irqsettings.pro Wed Jun 23 18:04:00 2010 +0300 @@ -19,6 +19,7 @@ MOC_DIR = moc DEPENDPATH += src +defFilePath = .. INCLUDEPATH += inc \ ..\irqcommon\inc \ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqsettings/src/irqsettings.cpp --- a/qtinternetradio/irqsettings/src/irqsettings.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqsettings/src/irqsettings.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -31,13 +31,7 @@ if (NULL == irqsettings) { - TRAPD(error, irqsettings = createInstanceL()); - if (KErrNone != error) - { - delete irqsettings; - irqsettings = NULL; - Dll::SetTls(NULL); - } + irqsettings = createInstance(); } else { @@ -366,17 +360,37 @@ // @return IRQSettings* // --------------------------------------------------------------------------- // -IRQSettings* IRQSettings::createInstanceL() +IRQSettings* IRQSettings::createInstance() { - IRQSettings* irqsettings = new (ELeave) IRQSettings(); - irqsettings->constructL(); - User::LeaveIfError(Dll::SetTls(irqsettings)); - irqsettings->iSingletonInstances = 1; - - return irqsettings; + IRQSettings* irqsettings = new IRQSettings(); + + TRAPD(leaveCode, doCreateInstanceL(irqsettings)); + if (KErrNone != leaveCode) + { + delete irqsettings; + irqsettings = NULL; + return NULL; + } + else + { + irqsettings->iSingletonInstances = 1; + return irqsettings; + } } // --------------------------------------------------------------------------- +// IRQSettings::doCreateInstanceL() +// Creates IRQSettings instance +// @return IRQSettings* +// --------------------------------------------------------------------------- +// +void IRQSettings::doCreateInstanceL(IRQSettings * aQsettings) +{ + aQsettings->constructL(); + Dll::SetTls(aQsettings); + +} +// --------------------------------------------------------------------------- // IRQSettings::constructL() // Two-Phase Constructor. // --------------------------------------------------------------------------- diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqsonghistory/irqsonghistory.pro --- a/qtinternetradio/irqsonghistory/irqsonghistory.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqsonghistory/irqsonghistory.pro Wed Jun 23 18:04:00 2010 +0300 @@ -16,6 +16,8 @@ TARGET = irqsonghistory TARGET.CAPABILITY = CAP_GENERAL_DLL +defFilePath = .. + DEPENDPATH += src ..\..\internetradio2.0\songhistorysrc LIBS += -lbafl -ledbms -lefsrv -lirsettings -lflogger diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqstatisticsreporter/irqstatisticsreporter.pro --- a/qtinternetradio/irqstatisticsreporter/irqstatisticsreporter.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqstatisticsreporter/irqstatisticsreporter.pro Wed Jun 23 18:04:00 2010 +0300 @@ -17,6 +17,7 @@ QT -= gui CONFIG += dll DEFINES += BUILD_IRQSTATISTICSREPORTER_DLL +defFilePath = .. symbian{ TARGET.UID3 = 0xe3801560 @@ -28,7 +29,8 @@ ########## Dependency Path ############################## MOC_DIR = moc DEPENDPATH += src -INCLUDEPATH += inc \ +INCLUDEPATH += /epoc32/include/platform \ + inc \ ../irqcommon\inc \ ../irqisdsclient/inc \ ../irqnetworkcontroller/inc \ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/irqsystemeventhandler/irqsystemeventhandler.pro --- a/qtinternetradio/irqsystemeventhandler/irqsystemeventhandler.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/irqsystemeventhandler/irqsystemeventhandler.pro Wed Jun 23 18:04:00 2010 +0300 @@ -11,6 +11,8 @@ DEPENDPATH += . inc src INCLUDEPATH += . +defFilePath = .. + DEFINES += BUILD_IRQSYSTEMEVENTHANDLEREXPORTS_DLL INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE \ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/irapplication.h --- a/qtinternetradio/ui/inc/irapplication.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/inc/irapplication.h Wed Jun 23 18:04:00 2010 +0300 @@ -17,9 +17,9 @@ #ifndef IRAPPLICATION_H #define IRAPPLICATION_H +#include #include #include -#include #include #include "irqevent.h" @@ -40,15 +40,15 @@ class IRQAdvClient; class HbProgressDialog; class IRQSystemEventHandler; -class XQSharableFile; class IRPlayList; class HbIconItem; +class IRFileViewService; #ifdef LOCALIZATION class QTranslator; #endif -class IRApplication : public XQServiceProvider +class IRApplication : public QObject { Q_OBJECT @@ -74,6 +74,8 @@ IRQAdvClient* getAdvClient(); IRPlayList* getPlayList() const; + void launchStartingView(TIRViewId aViewId); + #ifdef LOCALIZATION /* * this function will take ownership of the translator @@ -88,10 +90,6 @@ public: bool iTestPreferredBitrate; #endif - -public slots: - void view(const QString &aFileName); - void view(const XQSharableFile &aSharableFile); signals: void quit(); @@ -114,7 +112,6 @@ void destroyComponents(); void setupConnection(); void setLaunchView(); - void launchStartingView(TIRViewId aViewId); void startSystemEventMonitor(); void initApp(); void setExitingView(); @@ -170,8 +167,8 @@ IRQSystemEventHandler *iSystemEventHandler; - IRPlayList *iPlayList; HbIconItem *iLoadingAnimation; + IRFileViewService *iFileViewService; }; #endif diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/irchannelmodel.h --- a/qtinternetradio/ui/inc/irchannelmodel.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/inc/irchannelmodel.h Wed Jun 23 18:04:00 2010 +0300 @@ -39,8 +39,8 @@ void initWithCache(); void save2Cache(); //not take ownership - IRQChannelItem * getChannelItemByIndex(int aIndex); - + IRQChannelItem * getChannelItemByIndex(int aIndex); + void cleanupDatabase(); void clearAndDestroyLogos(); public slots: diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/irfileviewservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/ui/inc/irfileviewservice.h Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef IRFILEVIEWSERVICE_H_ +#define IRFILEVIEWSERVICE_H_ + +#include + +class XQSharableFile; +class IRPlayList; +class IRApplication; + +class IRFileViewService : public XQServiceProvider +{ + Q_OBJECT + +public: + IRFileViewService(IRApplication *aApplication); + ~IRFileViewService(); + IRPlayList* getPlayList() const; + +public slots: + void view(const QString &aFileName); + void view(const XQSharableFile &aSharableFile); + +private: + IRApplication *iApplication; + IRPlayList *iPlayList; + + Q_DISABLE_COPY(IRFileViewService) +}; + +#endif /* IRFILEVIEWSERVICE_H_ */ diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/irnowplayingview.h --- a/qtinternetradio/ui/inc/irnowplayingview.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/inc/irnowplayingview.h Wed Jun 23 18:04:00 2010 +0300 @@ -23,7 +23,6 @@ class HbAction; class IRQPreset; class IRQStatisticsReporter; -class IRQNetworkController; class IRQMetaData; class IRStationShare; class HbLabel; @@ -107,7 +106,6 @@ private: IRQStatisticsReporter *iStatisticsReporter; - IRQNetworkController *iNetworkController; IRStationShare *iStationShare; // tool bar actions diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/irsearchchannelsview.h --- a/qtinternetradio/ui/inc/irsearchchannelsview.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/inc/irsearchchannelsview.h Wed Jun 23 18:04:00 2010 +0300 @@ -21,7 +21,7 @@ #include "irbaseview.h" #include "irqenums.h" - +class HbGroupBox; class HbListView; class HbSearchPanel; class HbAction; @@ -59,7 +59,8 @@ void lazyInit(); void startConvert(int aIndex); void initTimer(); - + //set the subtitle and counter; + void setHeadingText(const QString &aText); private slots: //slots void cancelRequest(); @@ -84,7 +85,7 @@ ESearch_init = 0, ESearch_Loading //loading means searching or buffering. }; - + HbGroupBox *iHeadingLabel; HbListView *iListView; QString iKeyText; diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/irsearchresultdb.h --- a/qtinternetradio/ui/inc/irsearchresultdb.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/inc/irsearchresultdb.h Wed Jun 23 18:04:00 2010 +0300 @@ -34,10 +34,10 @@ IRQError cacheChannelList(QList *aChannelList); //caller needs to release the memory QList * getCahcedChannelList(); + IRQError clearCache(); private: - void createDBConnection(); - IRQError clearCache(); + void createDBConnection(); private: QSqlDatabase *iDB; diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/inc/iruidefines.h --- a/qtinternetradio/ui/inc/iruidefines.h Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/inc/iruidefines.h Wed Jun 23 18:04:00 2010 +0300 @@ -70,6 +70,7 @@ static const char* SEARCH_CHANNELS_VIEW_OBJECT_VIEW = "ext-IRSearchChannelsView"; static const char* SEARCH_CHANNELS_VIEW_SEARCHPANEL_WIDGET = "search_panel"; static const char* SEARCH_CHANNELS_VIEW_SEARCHLISTVIEW_WIDGET = "search_listview"; +static const char* SEARCH_CHANNELS_VIEW_HEADINGTEXT_WIDGET = "headingText"; // IRNowplayingView -- Object Name static const char* NOW_PLAYING_VIEW_OBJECT_NAME = "ext-nowplayingview"; diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/resources/layout/abstractlistviewbase.docml --- a/qtinternetradio/ui/resources/layout/abstractlistviewbase.docml Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/resources/layout/abstractlistviewbase.docml Wed Jun 23 18:04:00 2010 +0300 @@ -4,7 +4,7 @@ - + @@ -93,9 +93,6 @@
- - - diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/resources/layout/nowplayingview.docml --- a/qtinternetradio/ui/resources/layout/nowplayingview.docml Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/resources/layout/nowplayingview.docml Wed Jun 23 18:04:00 2010 +0300 @@ -1,5 +1,5 @@ - + @@ -61,28 +61,27 @@ - - +
- - - - - + + + + +
- - - - + + + +
@@ -91,7 +90,9 @@ - + + + @@ -101,10 +102,10 @@ - + - +
@@ -113,26 +114,28 @@ - - + + + + - - - - - - - - - + + + + + + + + +
- + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/resources/layout/openwebaddressview.docml --- a/qtinternetradio/ui/resources/layout/openwebaddressview.docml Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/resources/layout/openwebaddressview.docml Wed Jun 23 18:04:00 2010 +0300 @@ -1,7 +1,7 @@ - + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/resources/layout/searchchannelsview.docml --- a/qtinternetradio/ui/resources/layout/searchchannelsview.docml Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/resources/layout/searchchannelsview.docml Wed Jun 23 18:04:00 2010 +0300 @@ -1,5 +1,8 @@ + + + @@ -27,6 +30,9 @@ + + + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/resources/layout/termsconsview.docml --- a/qtinternetradio/ui/resources/layout/termsconsview.docml Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/resources/layout/termsconsview.docml Wed Jun 23 18:04:00 2010 +0300 @@ -1,5 +1,5 @@ - + @@ -10,65 +10,87 @@ - + - + + - - - - - - - - - - - - - + + + + + - + +
- - - + + + + + - - - - - - + + + + + + + + + + + + + + +
- - - + + + + + + + + + + + + - - - - + + + + + + + + + + + +
- + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/service_conf.xml --- a/qtinternetradio/ui/service_conf.xml Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/service_conf.xml Wed Jun 23 18:04:00 2010 +0300 @@ -1,11 +1,21 @@ - internet_radio_10_1 - No path - InternetRadio can play .pls file and .m3u file - - com.nokia.symbian.IFileView - 1.0 - Interface for viewing and playing .pls file and .m3u file - + internet_radio_10_1 + No path + InternetRadio Services + + com.nokia.symbian.IFileView + 1.0 + Interface for viewing .pls file and .m3u file + + + com.nokia.symbian.IInternetRadioControl + 1.0 + Interface to control internet radio playback + + + com.nokia.symbian.IInternetRadioMonitor + 1.0 + Interface to monitor internet radio status changes + diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irabstractlistviewbase.cpp --- a/qtinternetradio/ui/src/irabstractlistviewbase.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irabstractlistviewbase.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -121,7 +121,8 @@ iArtistSongName->setLoopCount(KAnimationLoopTimes); iListView = qobject_cast(iLoader.findObject(ABSTRACT_LIST_VIEW_BASE_OBJECT_LISTVIEW)); - + iListView->listItemPrototype()->setGraphicsSize(HbListViewItem::LargeIcon); + // draw background for now playing banner HbFrameDrawer* drawer = new HbFrameDrawer(NOW_PLAYING_BANNER_FRAME, HbFrameDrawer::NinePieces); HbFrameItem* backgroundItem = new HbFrameItem(drawer, iPlayingBanner); diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irapplication.cpp --- a/qtinternetradio/ui/src/irapplication.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irapplication.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include -#include + #include #include #include @@ -49,17 +49,14 @@ #include "irqlogger.h" #include "iruidefines.h" #include "irqsystemeventhandler.h" -#include "irplaylist.h" #include "irabstractlistviewbase.h" - -#define INTERNETRADIO_SERVICE_NAME "internet_radio_10_1.com.nokia.symbian.IFileView" +#include "irfileviewservice.h" /* * Description : constructor, initialize all data members * Parameters : aViewManager : pointer to the view manager object * Return : None */ IRApplication::IRApplication(IRViewManager* aViewManager, IRQSystemEventHandler* aSystemEventHandler): - XQServiceProvider(INTERNETRADIO_SERVICE_NAME), #ifdef _DEBUG iTestPreferredBitrate(false), #endif @@ -82,16 +79,11 @@ iTranslator(NULL), #endif iSystemEventHandler(aSystemEventHandler), - iPlayList(NULL), - iLoadingAnimation(NULL) + iLoadingAnimation(NULL), + iFileViewService(NULL) { LOG_METHOD; - if (XQServiceUtil::isService()) - { - //Publishes all public slots on this object - publishAll(); - } iViewManager->setApplication(this); iInitEvent = static_cast(QEvent::registerEventType()); @@ -105,6 +97,12 @@ iSettings->getGlobalAdvFlag(iEnableGlobalAdv); setupConnection(); setLaunchView(); + + QString name = XQServiceUtil::interfaceName(); + if (name == QString("com.nokia.symbian.IFileView")) + { + iFileViewService = new IRFileViewService(this); + } } /* @@ -131,8 +129,6 @@ delete iSystemEventHandler; - delete iPlayList; - #ifdef LOCALIZATION if( iTranslator ) { @@ -141,6 +137,9 @@ iTranslator = NULL; } #endif + + delete iFileViewService; + iFileViewService = NULL; } @@ -298,6 +297,8 @@ if(NULL == iNetworkController) { iNetworkController = IRQNetworkController::openInstance(); + connect(iNetworkController, SIGNAL(networkEventNotified(IRQNetworkEvent)), + this, SLOT(networkEventNotified(IRQNetworkEvent))); } return iNetworkController; } @@ -379,7 +380,12 @@ IRPlayList* IRApplication::getPlayList() const { - return iPlayList; + if (NULL == iFileViewService) + { + return NULL; + } + + return iFileViewService->getPlayList(); } #ifdef LOCALIZATION @@ -392,37 +398,6 @@ } #endif -void IRApplication::view(const QString &aFileName) -{ - if (NULL == iPlayList) - { - iPlayList = new IRPlayList; - } - - iPlayList->parseFile(aFileName); - - if (1 == iPlayList->getNumberOfEntries()) - { - launchStartingView(EIRView_PlayingView); - } - else if (iPlayList->getNumberOfEntries() > 1) - { - launchStartingView(EIRView_PlsView); - } - else - { - //normal launch, launch starting view - TIRViewId viewId = EIRView_CategoryView; - iSettings->getStartingViewId(viewId); - launchStartingView(viewId); - } -} - -void IRApplication::view(const XQSharableFile &/*aSharableFile*/) -{ - -} - /* * Description : create all the application level components, including network controller, * favorites db, isds client, play controller, etc @@ -611,9 +586,6 @@ { getNetworkController(); - connect(iNetworkController, SIGNAL(networkEventNotified(IRQNetworkEvent)), - this, SLOT(networkEventNotified(IRQNetworkEvent))); - IRBaseView *view = static_cast (iViewManager->currentView()); if (view) { diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/ircategorymodel.cpp --- a/qtinternetradio/ui/src/ircategorymodel.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/ircategorymodel.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -53,13 +53,20 @@ if (aRole == Qt::DisplayRole) { int row = aIndex.row(); + QVariantList list; - QString catNum; - catNum.sprintf(" (%d)", iItems->at(row)->size); - QString category = iItems->at(row)->catName + catNum; + QString category = iItems->at(row)->catName; + if (category.contains('(') && category.contains('-') && category.contains(')')) + { + list.append(category); + } + else + { + QString catNum; + catNum.sprintf(" (%d)", iItems->at(row)->size); + list.append(category + catNum); + } - QVariantList list; - list.append(category); return list; } diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/ircategoryview.cpp --- a/qtinternetradio/ui/src/ircategoryview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/ircategoryview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -88,6 +88,7 @@ { iLoader.load(ABSTRACT_LIST_VIEW_BASE_LAYOUT_FILENAME, ABSTRACT_LIST_VIEW_BASE_NO_TOOLBAR_SECTION); iLoadedSection = ABSTRACT_LIST_VIEW_BASE_NO_TOOLBAR_SECTION; + setToolBar(NULL); } } } @@ -471,8 +472,10 @@ { //add HbActions to the toolbar, the HbActions have been created in IrAbstractListViewBase HbToolBar *viewToolBar = toolBar(); + viewToolBar->clearActions(); viewToolBar->addAction(iGenresAction); viewToolBar->addAction(iCollectionsAction); viewToolBar->addAction(iFavoritesAction); viewToolBar->addAction(iSearchAction); + viewToolBar->setVisible(true); } diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irchannelmodel.cpp --- a/qtinternetradio/ui/src/irchannelmodel.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irchannelmodel.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -173,6 +173,15 @@ return iChannelList->at(aIndex); } +void IrChannelModel::cleanupDatabase() +{ + clearAndDestroyItems(); + clearAndDestroyLogos(); + iDB->clearCache(); + + emit dataAvailable(); +} + void IrChannelModel::clearAndDestroyLogos() { for (QMap::iterator it = iLogos.begin(); it != iLogos.end(); ++it) diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irfavoritesview.cpp --- a/qtinternetradio/ui/src/irfavoritesview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irfavoritesview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -45,6 +45,7 @@ const QString KActionRenameName("Rename"); const QString KActionDetailsName("Details"); + // public functions /* @@ -336,7 +337,11 @@ void IRFavoritesView::modelChanged() { - QString headingStr = QString::number(iModel->rowCount()) + QString(" ") + hbTrId("txt_irad_subtitle_stations"); +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_favorites") + " (" + QString::number(iModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Favorites") + " (" + QString::number(iModel->rowCount()) + ")"; +#endif setHeadingText(headingStr); updateIconIndexArray(); @@ -363,7 +368,11 @@ } updateIconIndexArray(); - QString headingStr = QString::number(iModel->rowCount()) + QString(" ") + hbTrId("txt_irad_subtitle_stations"); +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_favorites") + " (" + QString::number(iModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Favorites") + " (" + QString::number(iModel->rowCount()) + ")"; +#endif setHeadingText(headingStr); if (!iIconIndexArray.empty()) @@ -486,7 +495,11 @@ if (iModel->deleteOneFavorite(current)) { updateIconIndexArray(); - QString headingStr = QString::number(iModel->rowCount()) + QString(" ") + hbTrId("txt_irad_subtitle_stations"); +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_favorites") + " (" + QString::number(iModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Favorites") + " (" + QString::number(iModel->rowCount()) + ")"; +#endif setHeadingText(headingStr); } else diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irfileviewservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtinternetradio/ui/src/irfileviewservice.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +#include "irfileviewservice.h" +#include "irplaylist.h" +#include "irapplication.h" +#include "irqsettings.h" + +#define INTERNETRADIO_SERVICE_NAME "internet_radio_10_1.com.nokia.symbian.IFileView" + +IRFileViewService::IRFileViewService(IRApplication *aApplication) : XQServiceProvider(INTERNETRADIO_SERVICE_NAME), +iApplication(aApplication), iPlayList(NULL) +{ + if (XQServiceUtil::isService()) + { + //Publishes all public slots on this object + publishAll(); + } +} + +IRFileViewService::~IRFileViewService() +{ + delete iPlayList; +} + +IRPlayList* IRFileViewService::getPlayList() const +{ + return iPlayList; +} + +void IRFileViewService::view(const QString &aFileName) +{ + if (NULL == iPlayList) + { + iPlayList = new IRPlayList; + } + + iPlayList->parseFile(aFileName); + + if (1 == iPlayList->getNumberOfEntries()) + { + iApplication->launchStartingView(EIRView_PlayingView); + } + else if (iPlayList->getNumberOfEntries() > 1) + { + iApplication->launchStartingView(EIRView_PlsView); + } + else + { + //normal launch, launch starting view + TIRViewId viewId = EIRView_CategoryView; + iApplication->getSettings()->getStartingViewId(viewId); + iApplication->launchStartingView(viewId); + } +} + +void IRFileViewService::view(const XQSharableFile &/*aSharableFile*/) +{ + +} diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irhistoryview.cpp --- a/qtinternetradio/ui/src/irhistoryview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irhistoryview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -322,7 +322,12 @@ void IRHistoryView::modelChanged() { - QString headingStr = hbTrId("Station History") + " (" + QString::number(iModel->rowCount()) + ")"; +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_recently_played_stations") + " (" + QString::number(iModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Recently played stations") + " (" + QString::number(iModel->rowCount()) + ")"; +#endif + setHeadingText(headingStr); } diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irnowplayingview.cpp --- a/qtinternetradio/ui/src/irnowplayingview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irnowplayingview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -67,7 +67,6 @@ IRNowPlayingView::IRNowPlayingView(IRApplication* aApplication, TIRViewId aViewId) : IRBaseView(aApplication, aViewId), iStatisticsReporter(NULL), - iNetworkController(NULL), iStationShare(NULL), iPlayStopAction(NULL), iLaunchActionNeeded(false), @@ -101,11 +100,6 @@ */ IRNowPlayingView::~IRNowPlayingView() { - if(iNetworkController) - { - iNetworkController->closeInstance(); - } - if (iStatisticsReporter) { iStatisticsReporter->closeInstance(); @@ -386,7 +380,6 @@ IRBaseView::lazyInit(); iStatisticsReporter = IRQStatisticsReporter::openInstance(); - iNetworkController = IRQNetworkController::openInstance(); connect(iPlayController, SIGNAL(metaDataAvailable(IRQMetaData*)), this, SLOT(updateMetaData(IRQMetaData*))); connect(iPlayController, SIGNAL(playingStarted()), this, SLOT(handlePlayStarted())); diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/iropenwebaddressview.cpp --- a/qtinternetradio/ui/src/iropenwebaddressview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/iropenwebaddressview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -198,13 +198,17 @@ */ void IROpenWebAddressView::initDataForm() { - iUrl = new HbDataFormModelItem( - HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_url")); +#ifdef SUBTITLE_STR_BY_LOCID + iUrl = new HbDataFormModelItem(HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_address")); +#else + iUrl = new HbDataFormModelItem(HbDataFormModelItem::TextItem, hbTrId("Station address")); +#endif iUrl->setContentWidgetData("maxLength",MAX_URL_CHARACTOR_NUMBER); iModel->appendDataFormItem(iUrl); iName = new HbDataFormModelItem( HbDataFormModelItem::TextItem, hbTrId("txt_irad_formlabel_station_name")); + iName->setContentWidgetData("maxLength", MAX_URL_CHARACTOR_NUMBER); iModel->appendDataFormItem(iName); iForm->addConnection(iUrl, SIGNAL(textChanged(const QString&)), diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irsearchchannelsview.cpp --- a/qtinternetradio/ui/src/irsearchchannelsview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irsearchchannelsview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -25,6 +25,7 @@ #include #include #include +#include #include "irsearchchannelsview.h" #include "iruidefines.h" @@ -40,7 +41,7 @@ IRSearchChannelsView::IRSearchChannelsView(IRApplication* aApplication, TIRViewId aViewId): IRBaseView(aApplication, aViewId), - iListView(NULL),iSearchPanelWidget(NULL),iSearchState(ESearch_init), + iHeadingLabel(NULL),iListView(NULL),iSearchPanelWidget(NULL),iSearchState(ESearch_init), iChannelModel(NULL),iPreset(NULL),iLogoPreset(NULL), iConvertTimer(NULL) { @@ -78,7 +79,9 @@ void IRSearchChannelsView::initMenu() { - + HbMenu *viewMenu = menu(); + QObject *exitAction = iLoader.findObject(EXIT_ACTION); + connect(exitAction, SIGNAL(triggered()), iApplication, SIGNAL(quit())); } void IRSearchChannelsView::initTimer() @@ -123,6 +126,9 @@ iLoader.setObjectTree( roots ); iLoader.load(SEARCH_CHANNELS_VIEW_LAYOUT_FILENAME); + iHeadingLabel = qobject_cast(iLoader.findWidget(SEARCH_CHANNELS_VIEW_HEADINGTEXT_WIDGET)); + + iSearchPanelWidget = qobject_cast(iLoader.findWidget(SEARCH_CHANNELS_VIEW_SEARCHPANEL_WIDGET)); iListView = qobject_cast(iLoader.findWidget(SEARCH_CHANNELS_VIEW_SEARCHLISTVIEW_WIDGET)); @@ -135,6 +141,14 @@ iChannelModel = new IrChannelModel(this); iChannelModel->initWithCache(); iListView->setModel(iChannelModel); + //anywhere, before show the count, updated it ahead. +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_search_results") + " (" + QString::number(iChannelModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Search results") + " (" + QString::number(iChannelModel->rowCount()) + ")"; +#endif + + setHeadingText(headingStr); } void IRSearchChannelsView::connectWidget() @@ -293,6 +307,7 @@ } popupNote(errStr, HbMessageBox::MessageTypeWarning); + iChannelModel->cleanupDatabase(); } void IRSearchChannelsView::clickItem(const QModelIndex&) @@ -332,13 +347,31 @@ } } +//set the subtitle and counter; +void IRSearchChannelsView::setHeadingText(const QString &aText) +{ + if (iHeadingLabel) + { + iHeadingLabel->setHeading(aText); + } +} void IRSearchChannelsView::dataChanged() { switch2InitState(); + //here update count in subtitle +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_search_results") + " (" + QString::number(iChannelModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Search results") + " (" + QString::number(iChannelModel->rowCount()) + ")"; +#endif + setHeadingText(headingStr); iListView->reset(); - iListView->setCurrentIndex(iChannelModel->index(0)); - iListView->scrollTo(iChannelModel->index(0)); - + if( iChannelModel->rowCount() ) + { + iListView->setCurrentIndex(iChannelModel->index(0)); + iListView->scrollTo(iChannelModel->index(0)); + } + //we move the focus to the listview and the search panel will //hide the virtual keyboard at the same time iListView->setFocus(); @@ -356,9 +389,7 @@ if( iIconIndexArray.count() > 0 ) { iConvertTimer->start(); - } - - iSearchPanelWidget->setPlaceholderText(iKeyText); + } } void IRSearchChannelsView::startConvert(int aIndex) diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irsearchresultdb.cpp --- a/qtinternetradio/ui/src/irsearchresultdb.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irsearchresultdb.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -62,7 +62,14 @@ QString name = insertItem->channelName; int channelID = insertItem->channelID; QString imageURL = insertItem->imageURL; - QString description = insertItem->shortDescription; + QString description = insertItem->shortDescription; + + //if some data overflows, we just skip it.note that + //the VARCHAR is word-based, so here we use the real size + if( name.size()>= 256 || imageURL.size() >= 256 || description.size() >= 256 ) + { + continue; + } QSqlQuery query; bool result; @@ -156,6 +163,8 @@ { bool dbResult = false; QSqlQuery query; + //note: the VARCHAR is word-based but not byte-based. and 255 + //means 255 unicode words. dbResult = query.exec("CREATE TABLE searchresult (" "id INTEGER PRIMARY KEY AUTOINCREMENT, " "name VARCHAR(255) NOT NULL, " diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irsettingsview.cpp --- a/qtinternetradio/ui/src/irsettingsview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irsettingsview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -48,7 +48,7 @@ setLayout(layout); HbGroupBox * titleText = new HbGroupBox(); - titleText->setHeading( hbTrId("txt_irad_subtitle_network_setting") ); + titleText->setHeading( hbTrId("txt_common_opt_settings") ); layout->addItem(titleText); iForm = new HbDataForm(); diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irsonghistoryview.cpp --- a/qtinternetradio/ui/src/irsonghistoryview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irsonghistoryview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -176,7 +176,13 @@ void IRSongHistoryView::modelChanged() { iListView->reset(); - QString headingStr = hbTrId("txt_irad_list_recently_played_songs") + " (" + QString::number(iModel->rowCount()) + ")"; + +#ifdef SUBTITLE_STR_BY_LOCID + QString headingStr = hbTrId("txt_irad_subtitle_recently_played_songs") + " (" + QString::number(iModel->rowCount()) + ")"; +#else + QString headingStr = hbTrId("Recently played songs") + " (" + QString::number(iModel->rowCount()) + ")"; +#endif + setHeadingText(headingStr); } diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/src/irstationdetailsview.cpp --- a/qtinternetradio/ui/src/irstationdetailsview.cpp Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/src/irstationdetailsview.cpp Wed Jun 23 18:04:00 2010 +0300 @@ -67,7 +67,13 @@ iBitRate->setPlainText(QString::number(bitrate) + QString("kbps")); iDescription->setPlainText(aPreset->description); - iNowPlayingUrl->setPlainText(aPreset->getURLsForBitrate(bitrate)->at(KChannelURLIndex)); + + QList *urlList = aPreset->getURLsForBitrate(bitrate); + if (urlList != NULL) + { + iNowPlayingUrl->setPlainText(urlList->at(KChannelURLIndex)); + } + delete urlList; } /* diff -r 3b03c28289e6 -r f683e24efca3 qtinternetradio/ui/ui.pro --- a/qtinternetradio/ui/ui.pro Fri Jun 11 13:30:40 2010 +0300 +++ b/qtinternetradio/ui/ui.pro Wed Jun 23 18:04:00 2010 +0300 @@ -70,7 +70,7 @@ TARGET.UID3 = 0xE28364bb TARGET.EPOCHEAPSIZE = 0x020000 0x2000000 TARGET.VID = VID_DEFAULT - ICON = resources/qtg_large_internet_radio.svg + SKINICON = qtg_large_internet_radio datatype_list = "datatype_list={DATATYPE{priority=EDataTypePriorityHigh;type=\"audio/x-scpls\";}};" RSS_RULES += datatype_list } @@ -108,7 +108,8 @@ inc\irstationdetailsview.h \ inc\irtermsconsview.h \ inc\irplaylist.h \ - inc\irsearchresultdb.h + inc\irsearchresultdb.h \ + inc\irfileviewservice.h #source files list SOURCES += main.cpp \ @@ -143,7 +144,8 @@ irstationdetailsview.cpp \ irtermsconsview.cpp \ irplaylist.cpp \ - irsearchresultdb.cpp + irsearchresultdb.cpp \ + irfileviewservice.cpp #resource RESOURCES += resources/irui.qrc