qtinternetradio/irqisdsclient/src/irqisdsclientimpl.cpp
changeset 5 0930554dc389
child 8 3b03c28289e6
equal deleted inserted replaced
3:ee64f059b8e1 5:0930554dc389
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 #ifdef USER_DEFINED_ISDSURL
       
    18 #include <QFile>
       
    19 #include <QTextStream>
       
    20 #include <QStringList>
       
    21 #endif // USER_DEFINED_ISDSURL
       
    22 #include "irqisdsclientimpl.h"
       
    23 #include "irqenums.h"
       
    24 #include "irqfavoritesdb.h"
       
    25 #include "irlogodownloadengine.h"
       
    26 #include "irdataprovider.h"
       
    27 #include "irhttpdataprovider.h"
       
    28 #include "irqutility.h"
       
    29 #include "irbrowsecatagoryitems.h"
       
    30 #include "irbrowsechannelitems.h"
       
    31 #include "isdsclientdll.h"
       
    32 #include "irqisdsdatastructure.h"
       
    33 #include "irqlogger.h"
       
    34 
       
    35 #ifdef USER_DEFINED_ISDSURL
       
    36 static const char* KDefaultIsdsUrl = "http://88.114.146.238/isds";
       
    37 void getIsdsUrlFromConfiguration(QString & aUrl);
       
    38 #endif // USER_DEFINED_ISDSURL
       
    39 
       
    40 IRQIsdsClientImpl::IRQIsdsClientImpl() : iISDSClient(NULL), iFavPresets(NULL),
       
    41                                                                     iLogoDownloadEngine(NULL)
       
    42 {
       
    43 #ifdef USER_DEFINED_ISDSURL
       
    44     QString userDefinedIsdsUrl(KDefaultIsdsUrl);
       
    45     getIsdsUrlFromConfiguration(userDefinedIsdsUrl);
       
    46     TPtrC irqissbaseurl(reinterpret_cast<const TUint16*>(userDefinedIsdsUrl.utf16()));
       
    47 #else    
       
    48     _LIT( irqissbaseurl, "http://idirectory.xgns.net/isds" );
       
    49 #endif    
       
    50     TRAPD(error, iISDSClient = CIRIsdsClient::NewL(*this, irqissbaseurl));
       
    51     if(KErrNone != error)
       
    52     {
       
    53         return;
       
    54     }
       
    55     
       
    56     iLogoDownloadEngine
       
    57             = iISDSClient->GetDataProvider()->GetHttpDataProvider()->GetLogoDownloadEngine();
       
    58 }
       
    59 
       
    60 IRQIsdsClientImpl::~IRQIsdsClientImpl()
       
    61 {
       
    62     delete iISDSClient;
       
    63 }
       
    64 
       
    65 //used to indicate errors in retrieving data from isds server
       
    66 //@param int, the error code sent by the http receiver 
       
    67 //
       
    68 void IRQIsdsClientImpl::IsdsErrorL(int aErrCode)
       
    69 {
       
    70     LOG_FORMAT( "This is a QString %d", aErrCode);
       
    71     if (KNotFound == aErrCode)
       
    72     {
       
    73         emit operationExceptionImpl(EIRQErrorNotFound);
       
    74     }
       
    75     else if (KErrCouldNotConnect == aErrCode)
       
    76     {
       
    77         emit operationExceptionImpl(EIRQErrorCouldNotConnect);
       
    78     }
       
    79     else if (KDndTimedOut == aErrCode)
       
    80     {
       
    81         emit operationExceptionImpl(EIRQErrorTimeOut);
       
    82     }
       
    83     else if (KServiceUnavailable == aErrCode)
       
    84     {
       
    85         emit operationExceptionImpl(EIRQErrorServiceUnavailable);
       
    86     }
       
    87     else if (KErrCorrupt == aErrCode)
       
    88     {
       
    89         emit operationExceptionImpl(EIRQErrorCorrupt);
       
    90     }
       
    91     else if (KDataProviderTimeout == aErrCode)
       
    92     {
       
    93         emit operationExceptionImpl(EIRQErrorTimeOut);
       
    94     }
       
    95     else
       
    96         emit operationExceptionImpl(EIRQErrorGeneral);
       
    97 }
       
    98 
       
    99 void IRQIsdsClientImpl::isdsSearchRequestImpl(const QString& aIsdsSearchString)
       
   100 {
       
   101 
       
   102     TPtrC16 searchDes(
       
   103             reinterpret_cast<const TUint16*> (aIsdsSearchString.utf16()));
       
   104    
       
   105     TRAPD( err, iISDSClient->IRISDSSearchL(searchDes));
       
   106     if (KErrNone != err)
       
   107     {
       
   108         emit operationExceptionImpl(EIRQErrorGeneral);
       
   109     }
       
   110 }
       
   111 
       
   112  
       
   113 
       
   114 //Send the category request by the category type
       
   115 // 
       
   116 void IRQIsdsClientImpl::isdsCategoryRequestImpl(
       
   117         IRQIsdsClient::IRQIsdsClientInterfaceIDs aIDType, bool& aCache)
       
   118 {
       
   119     iCatBannerTag = false;
       
   120     TRAPD( err, aCache = !(iISDSClient->IRIsdsClientIntefaceL((CIRIsdsClient::TIRIsdsclientInterfaceIDs)aIDType)));
       
   121     if (err != KErrNone)
       
   122     {
       
   123         emit operationExceptionImpl(EIRQErrorGeneral);
       
   124     }
       
   125 }
       
   126 
       
   127 bool IRQIsdsClientImpl::isdsIsCategoryCachedImpl(IRQIsdsClient::IRQIsdsClientInterfaceIDs aIDType)
       
   128 {
       
   129     bool cache = false;
       
   130     TRAP_IGNORE(cache = iISDSClient->IRIsdsIsCategoryCachedL((CIRIsdsClient::TIRIsdsclientInterfaceIDs)aIDType));    
       
   131     return cache;
       
   132 }
       
   133 
       
   134 bool IRQIsdsClientImpl::isdsIsChannelCachedImpl(int aIndex)
       
   135 {
       
   136     bool cache = false;
       
   137     TRAP_IGNORE(cache = iISDSClient->IRIsdsIsChannelCachedL(aIndex)); 
       
   138     return cache;
       
   139 }
       
   140 
       
   141 //Send the channels request by the channel index in the specify category
       
   142 //
       
   143 void IRQIsdsClientImpl::isdsChannelRequestImpl(int aIndex, bool& aCache)
       
   144 {
       
   145     iChannelBannerTag = false;
       
   146     TRAPD( err, aCache = !(iISDSClient->IRIsdsClientIntefaceL(aIndex, CIRIsdsClient::ECatagory)));
       
   147     if (err != KErrNone)
       
   148     {
       
   149         emit operationExceptionImpl(EIRQErrorGeneral);
       
   150     }
       
   151 }
       
   152 
       
   153 //issue a listen request to the isds client
       
   154 //@param int,bool, the current index of channel, the history tag  
       
   155 //
       
   156 void IRQIsdsClientImpl::isdsListenRequestImpl(int aCurrentIndex,
       
   157         bool aHistoryBool)
       
   158 {
       
   159     if (aHistoryBool)
       
   160     {
       
   161         TRAPD( err, iISDSClient->IRIsdsClientIntefaceL(aCurrentIndex, CIRIsdsClient::EChannels, ETrue));
       
   162         if (err != KErrNone)
       
   163         {
       
   164             emit operationExceptionImpl(EIRQErrorGeneral);
       
   165         }
       
   166     }
       
   167     else
       
   168     {
       
   169          
       
   170         TRAPD( err, iISDSClient->IRIsdsClientIntefaceL(aCurrentIndex, CIRIsdsClient::EChannels));
       
   171         if (err != KErrNone)
       
   172         {
       
   173             emit operationExceptionImpl(EIRQErrorGeneral);
       
   174         }
       
   175     }
       
   176 }
       
   177 
       
   178 //to syncronize presets
       
   179 //@param int,QString, the preset id and the last modified tag for the preset   
       
   180 //
       
   181 int IRQIsdsClientImpl::isdsSyncPresetImpl(int aPresetId,
       
   182         const QString& aIfModifySince, IRQFavoritesDB *aFavPresets)
       
   183 {
       
   184     iFavPresets = aFavPresets;
       
   185     TPtrC16 modifySinceDes(
       
   186             reinterpret_cast<const TUint16*> (aIfModifySince.utf16()));
       
   187     TInt result = 0;
       
   188     TRAP_IGNORE(result = iISDSClient->SyncPresetL(aPresetId,modifySinceDes));     
       
   189     return result;
       
   190 }
       
   191 
       
   192 //Cacel the request sent by the UI.
       
   193 //@param None
       
   194 //
       
   195 void IRQIsdsClientImpl::isdsCancelRequestImpl()
       
   196 {
       
   197     TRAPD( err, iISDSClient->IRISDSCancelRequest());
       
   198     if (err != KErrNone)
       
   199     {
       
   200         emit operationExceptionImpl(EIRQErrorGeneral);
       
   201     }
       
   202 }
       
   203 
       
   204 //to see wether category view has a banner.
       
   205 //@param None
       
   206 //
       
   207 bool IRQIsdsClientImpl::isdsIsCategoryBannerImpl()
       
   208 {
       
   209     return iCatBannerTag;
       
   210 }
       
   211 
       
   212 //
       
   213 //to see wether channel view has a banner.
       
   214 //@param None
       
   215 bool IRQIsdsClientImpl::isdsIsChannelBannerImpl()
       
   216 {
       
   217     return iChannelBannerTag;
       
   218 }
       
   219 
       
   220  
       
   221 //the api is called from the UI(nowplaying view) to download logo.
       
   222 //@param None
       
   223 //
       
   224 void IRQIsdsClientImpl::isdsLogoDownSendRequestImpl(IRQPreset* aPreset,
       
   225         int aNPVReq, int aXValue, int aYValue)
       
   226 {
       
   227     if (NULL == aPreset)
       
   228         return;
       
   229 
       
   230     CIRIsdsPreset *cirPreset = NULL;
       
   231     TRAP_IGNORE(cirPreset = CIRIsdsPreset::NewL());
       
   232     IRQUtility::convertIRQPreset2CIRIsdsPreset(*aPreset, *cirPreset);
       
   233     
       
   234     aXValue = aXValue % 1000;
       
   235     aYValue = aYValue % 1000;
       
   236     
       
   237     TRAPD( err, iLogoDownloadEngine->SendRequestL(cirPreset,this, aNPVReq, aXValue, aYValue));//0 0 
       
   238     delete cirPreset;
       
   239     if (err != KErrNone)
       
   240     {
       
   241         emit operationExceptionImpl(EIRQErrorGeneral);
       
   242     }
       
   243 }
       
   244 
       
   245 bool IRQIsdsClientImpl::isdsIsLogoCachedImpl(IRQPreset* aPreset, int aXValue, int aYValue)
       
   246 {
       
   247     if( NULL == aPreset )
       
   248         return false;
       
   249     
       
   250     bool cached = false;
       
   251     CIRIsdsPreset *cirPreset = NULL;
       
   252     TRAP_IGNORE(cirPreset = CIRIsdsPreset::NewL());
       
   253     IRQUtility::convertIRQPreset2CIRIsdsPreset(*aPreset, *cirPreset);
       
   254     aXValue = aXValue % 1000;
       
   255     aYValue = aYValue % 1000;
       
   256     
       
   257     TRAP_IGNORE(cached = iLogoDownloadEngine->isLogoCachedL(cirPreset,aXValue, aYValue));
       
   258 	  delete cirPreset;
       
   259 	  cirPreset = NULL;
       
   260 	
       
   261     return cached;
       
   262 }
       
   263 
       
   264 //
       
   265 //the api is called to cancel the current transaction
       
   266 //@param None
       
   267 //
       
   268 void IRQIsdsClientImpl::isdsLogoDownCancelTransactionImpl()
       
   269 {
       
   270     iLogoDownloadEngine->CancelTransaction();
       
   271 }
       
   272 
       
   273 //
       
   274 //To know the status of downloading logo
       
   275 bool IRQIsdsClientImpl::isdsLogoDownIsRunningImpl() const
       
   276 {
       
   277     return iLogoDownloadEngine->IsRunning();
       
   278 }
       
   279 
       
   280 //takes the url as a parameter and returns the logo data which is in cache
       
   281 //this API is called form the search results for to display logo on the view
       
   282 //@param QString: the url of the img, int: the status for getting
       
   283 //
       
   284 void IRQIsdsClientImpl::isdsLogoDownCheckCacheLogoImpl(
       
   285         const QString& aURL, int& aStatus)
       
   286 {
       
   287     TInt status = 0;
       
   288     TPtrC16 url(reinterpret_cast<const TUint16*> (aURL.utf16()));
       
   289     TRAP_IGNORE(iLogoDownloadEngine->GetCacheLogoL(url, status));       
       
   290     aStatus = status;
       
   291     
       
   292 }
       
   293 
       
   294 //get the cache logo from the logodown engine. The "send" is the point from a logodown engine
       
   295 //@param None
       
   296 //
       
   297 TDesC8& IRQIsdsClientImpl::isdsLogoDownSendCacheLogoImpl()
       
   298 {
       
   299     return iLogoDownloadEngine->SendCacheLogo();
       
   300 }
       
   301 
       
   302 void IRQIsdsClientImpl::isdsPostLogImpl(const QString &aFileName)
       
   303 {
       
   304     TPtrC16 fileName(
       
   305                 reinterpret_cast<const TUint16*> (aFileName.utf16()));
       
   306     TBuf<256> fileBuf = fileName;
       
   307     TRAP_IGNORE(iISDSClient->IRISDSPostL(fileBuf));     
       
   308 }
       
   309 
       
   310 void IRQIsdsClientImpl::isdsGetIRIDImpl()
       
   311 {
       
   312     TRAP_IGNORE(iISDSClient->IRGetIRIDL());
       
   313 }
       
   314 
       
   315 void IRQIsdsClientImpl::isdsGetBrowseBannerImpl(QString& aBannerUrl, QString& aClickThroughUrl)
       
   316 {
       
   317     aBannerUrl = iCatBannerUrl;
       
   318     aClickThroughUrl = iCatClickThroughUrl;
       
   319 }
       
   320 
       
   321 void IRQIsdsClientImpl::isdsMultSearchImpl(QString aGenreID, QString aCountryID, QString aLanguageID, QString aSearchText)
       
   322 {
       
   323     TPtrC16 genreID(reinterpret_cast<const TUint16*> (aGenreID.utf16()));
       
   324     TPtrC16 countryID(reinterpret_cast<const TUint16*> (aCountryID.utf16()));
       
   325     TPtrC16 languageID(reinterpret_cast<const TUint16*> (aLanguageID.utf16()));
       
   326     TPtrC16 searchText(reinterpret_cast<const TUint16*> (aSearchText.utf16()));
       
   327     TRAP_IGNORE(iISDSClient->IRISDSMultiSearchL(genreID, countryID, languageID, searchText));
       
   328 }
       
   329 //when we get the category data from low layer, the function is called and
       
   330 //we will generate the data pushed to UI, the IRQIsdsClientImpl will not free the 
       
   331 //memory.
       
   332 //
       
   333 void IRQIsdsClientImpl::IsdsCatogoryDataReceivedL(CArrayPtrFlat<
       
   334         CIRBrowseCatagoryItems> & aParsedStructure)
       
   335 {
       
   336     iCatBannerTag = false;
       
   337     iCatBannerUrl.clear();
       
   338     iCatClickThroughUrl.clear();
       
   339 
       
   340     /* the data is pushed to the UI and irqisds is not care when it's deleted */
       
   341     QList<IRQBrowseCategoryItem *> * pushBrowseCategoryItemList = new QList<
       
   342             IRQBrowseCategoryItem *> ;
       
   343     for (TInt i = 0; i < aParsedStructure.Count(); i++)
       
   344     {
       
   345         if (NULL != aParsedStructure[i]->iCatBannerUrl)
       
   346         {
       
   347             iCatBannerTag = true;
       
   348             if (0 != aParsedStructure[i]->iCatBannerUrl->Length())
       
   349             {
       
   350                 iCatBannerUrl = QString::fromUtf16(
       
   351                         aParsedStructure[i]->iCatBannerUrl->Des().Ptr(),
       
   352                         aParsedStructure[i]->iCatBannerUrl->Des().Length());
       
   353             }
       
   354 
       
   355             if (NULL != aParsedStructure[i]->iCatClickThroughUrl)
       
   356             {
       
   357                 if (0 != aParsedStructure[i]->iCatClickThroughUrl->Length())
       
   358                 {
       
   359                     iCatClickThroughUrl
       
   360                             = QString::fromUtf16(
       
   361                                     aParsedStructure[i]->iCatClickThroughUrl->Des().Ptr(),
       
   362                                     aParsedStructure[i]->iCatClickThroughUrl->Des().Length());
       
   363                 }
       
   364             }
       
   365         }// end if ( NULL != ) 
       
   366 
       
   367         if (NULL != aParsedStructure[i]->iCatName)
       
   368         {
       
   369             IRQBrowseCategoryItem * oneItem = new IRQBrowseCategoryItem();
       
   370             oneItem->catName = QString::fromUtf16(
       
   371                     aParsedStructure[i]->iCatName->Des().Ptr(),
       
   372                     aParsedStructure[i]->iCatName->Des().Length());
       
   373             oneItem->size = aParsedStructure[i]->iSize;
       
   374             pushBrowseCategoryItemList->append(oneItem);
       
   375         }
       
   376     }// end for
       
   377 
       
   378     /* now we get the data and we need to signal the ui to stop the 
       
   379      dialog and emit and call the setdata of model*/
       
   380     emit
       
   381     categoryItemsChangedImpl(pushBrowseCategoryItemList);
       
   382 
       
   383 }
       
   384 
       
   385 //when we get the channels data from low layer, the function is called and
       
   386 //we will generate the data pushed to UI
       
   387 //
       
   388 void IRQIsdsClientImpl::IsdsChannelDataReceivedL(CArrayPtrFlat<
       
   389         CIRBrowseChannelItems> & aParsedStructure)
       
   390 {
       
   391     iChannelBannerTag = false;
       
   392     iChannelBannerUrl.clear();
       
   393     iChannelClickThroughUrl.clear();
       
   394 
       
   395     QList<IRQChannelItem *> *pushBrowseChannelItemList = new QList<
       
   396             IRQChannelItem *> ;
       
   397 
       
   398     for (int i = 0; i < aParsedStructure.Count(); i++)
       
   399     {
       
   400         if (NULL != aParsedStructure[i]->iBannerUrl)
       
   401         {
       
   402             iChannelBannerTag = true;
       
   403 
       
   404             if (0 != aParsedStructure[i]->iBannerUrl->Length())
       
   405             {
       
   406                 iChannelBannerUrl = QString::fromUtf16(
       
   407                         aParsedStructure[i]->iBannerUrl->Des().Ptr(),
       
   408                         aParsedStructure[i]->iBannerUrl->Des().Length());
       
   409             }
       
   410 
       
   411             if (NULL != aParsedStructure[i]->iClickThroughUrl)
       
   412             {
       
   413                 if (0 != aParsedStructure[i]->iClickThroughUrl->Length())
       
   414                 {
       
   415                     iChannelClickThroughUrl
       
   416                             = QString::fromUtf16(
       
   417                                     aParsedStructure[i]->iClickThroughUrl->Des().Ptr(),
       
   418                                     aParsedStructure[i]->iClickThroughUrl->Des().Length());
       
   419                 }
       
   420             }
       
   421         } //end if aParsedStructure[i]->
       
   422 
       
   423         if (NULL != aParsedStructure[i]->iChannelName)
       
   424         {
       
   425             IRQChannelItem * oneChannelItem = new IRQChannelItem();
       
   426             oneChannelItem->channelName = QString::fromUtf16(
       
   427                     aParsedStructure[i]->iChannelName->Des().Ptr(),
       
   428                     aParsedStructure[i]->iChannelName->Des().Length());
       
   429             oneChannelItem->shortDescription = QString::fromUtf16(
       
   430                     aParsedStructure[i]->iShortDescription->Des().Ptr(),
       
   431                     aParsedStructure[i]->iShortDescription->Des().Length());
       
   432 
       
   433             if (0 != aParsedStructure[i]->iImgUrl.Length())
       
   434             {
       
   435 
       
   436                 oneChannelItem->imageURL = QString::fromUtf16(
       
   437                         aParsedStructure[i]->iImgUrl.Ptr(),
       
   438                         aParsedStructure[i]->iImgUrl.Length());;
       
   439             }
       
   440             else
       
   441                 oneChannelItem->imageURL = "";
       
   442 
       
   443             pushBrowseChannelItemList->append(oneChannelItem);
       
   444         }
       
   445     }
       
   446 
       
   447     /* after we get data, we push it to the UI to show*/
       
   448     emit
       
   449     channelItemsChangedImpl(pushBrowseChannelItemList);
       
   450     
       
   451 }
       
   452 
       
   453 //when we get the presets data from low layer, the function is called and
       
   454 //we will generate the data pushed to UI. 
       
   455 //
       
   456 void IRQIsdsClientImpl::IsdsPresetDataReceivedL(
       
   457         CArrayPtrFlat<CIRIsdsPreset> & aParsedStructure)
       
   458 {
       
   459     CIRIsdsPreset* preset = aParsedStructure[0];
       
   460     IRQPreset* qPreset = new IRQPreset();
       
   461     /* we need convert the CIR to QT */
       
   462     IRQUtility::convertCIRIsdsPreset2IRQPrest(*preset, *qPreset);
       
   463     qPreset->type = IRQPreset::EIsds;
       
   464     emit
       
   465     presetResponseImpl(qPreset);
       
   466     
       
   467 }
       
   468 
       
   469 //when we find that the preset to be syc is deleted from isds server, the function 
       
   470 //will be called to notify the UI. DISCUSSED FURTHER
       
   471 //
       
   472 void IRQIsdsClientImpl::IsdsPresetRemovedL(TInt aId)
       
   473 {
       
   474     if(iFavPresets)
       
   475     {
       
   476         iFavPresets->makePresetUserDefined(aId, 0);
       
   477     }
       
   478     emit
       
   479     syncPresetResultImpl(EIRQIsdsSycPresetRemoved, NULL);
       
   480 }
       
   481 
       
   482 //when we find that the preset to be syc is changed from isds server, the function 
       
   483 //will be called to notify the UI.
       
   484 //
       
   485 void IRQIsdsClientImpl::IsdsPresetChangedL(CIRIsdsPreset& aPreset)
       
   486 {
       
   487     IRQPreset* qPreset = new IRQPreset();
       
   488     IRQUtility::convertCIRIsdsPreset2IRQPrest(aPreset, *qPreset);
       
   489     qPreset->type = IRQPreset::EIsds;
       
   490     if(iFavPresets)
       
   491     {        
       
   492         iFavPresets->replacePreset(*qPreset);
       
   493     }
       
   494     emit syncPresetResultImpl(EIRQIsdsSycPresetChanged, qPreset);
       
   495 }
       
   496 
       
   497 //when we find that the preset to be syc is changed from isds server, the function 
       
   498 //will be called to notify the UI.
       
   499 //
       
   500 void IRQIsdsClientImpl::IsdsPresetNoChangeL()
       
   501 {
       
   502     emit syncPresetResultImpl(EIRQIsdsSycPresetNoChange, NULL);
       
   503 
       
   504 }
       
   505 
       
   506 //called back when a preset's logo has downloaded
       
   507 //@param CIRIsdsPreset*, preset with downloaded logo
       
   508 //
       
   509 void IRQIsdsClientImpl::PresetLogoDownloadedL(CIRIsdsPreset* aPreset)
       
   510 {
       
   511     if (NULL == aPreset)
       
   512         return;
       
   513 
       
   514     IRQPreset * irqPreset = new IRQPreset();
       
   515     IRQUtility::convertCIRIsdsPreset2IRQPrest(*aPreset, *irqPreset);
       
   516 
       
   517     emit presetLogoDownloadedImpl(irqPreset);
       
   518 }
       
   519 
       
   520 //called back when a preset's logo has not downloaded
       
   521 //@param CIRIsdsPreset*, preset with no logo data
       
   522 //
       
   523 void IRQIsdsClientImpl::PresetLogoDownloadError(CIRIsdsPreset* aPreset)
       
   524 {
       
   525     if (NULL == aPreset)
       
   526         return;
       
   527 
       
   528     emit presetLogoDownloadErrorImpl();
       
   529 }
       
   530 
       
   531 //receive the irid from isds server, not implementated
       
   532 //
       
   533 void IRQIsdsClientImpl::IsdsIRIDRecieved(const TDesC& aIRID)
       
   534 {
       
   535     //nothing now
       
   536     QString irid = QString::fromUtf16(aIRID.Ptr(),aIRID.Length());
       
   537     emit iridReceivedImpl(irid);     
       
   538 }
       
   539 
       
   540  
       
   541 
       
   542 
       
   543 //
       
   544 //receive the ota info from isds server, not implementated
       
   545 //
       
   546 void IRQIsdsClientImpl::IsdsOtaInfoRecieved(CIROTAUpdate &aOtaData)
       
   547 {
       
   548     //nothing now
       
   549     Q_UNUSED(aOtaData);    
       
   550 }
       
   551 
       
   552 bool IRQIsdsClientImpl::isdsIsConstructSucceed() const
       
   553 {
       
   554     return iISDSClient != NULL;
       
   555 }
       
   556 
       
   557 
       
   558 #ifdef USER_DEFINED_ISDSURL
       
   559 void getIsdsUrlFromConfiguration(QString & aUrl)
       
   560 {
       
   561     QFile file("C:\\data\\QTIRConfigure.txt");
       
   562     if (file.open(QIODevice::ReadOnly)) 
       
   563     {
       
   564         QTextStream stream( &file );
       
   565         QString line;
       
   566         QStringList parameter;
       
   567         while (!stream.atEnd())
       
   568         {
       
   569             line = stream.readLine();
       
   570             parameter = line.split("=");
       
   571             if (parameter.count() == 2)
       
   572             {
       
   573                 if (parameter.first() == "userDefinedIsdsUrl")
       
   574                 {
       
   575                     aUrl = parameter.last();
       
   576                     break;
       
   577                 }
       
   578             }
       
   579         }
       
   580         file.close();
       
   581     }
       
   582 }
       
   583 #endif  // USER_DEFINED_ISDSURL
       
   584