videofeeds/vcnsuiengine/src/vcxnscontent.cpp
branchRCL_3
changeset 23 befca0ec475f
parent 0 96612d01cf9f
equal deleted inserted replaced
22:839377eedc2b 23:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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 
       
    18 // Version : %version: 38 %
       
    19 
       
    20 #include <mpxmedia.h>
       
    21 #include <mpxmediageneraldefs.h>
       
    22 #include <vcxmyvideosdefs.h>
       
    23 
       
    24 #include "CIptvUtil.h"
       
    25 #include "vcxnscontent.h"
       
    26 #include "vcxnscontentaccess.h"
       
    27 #include "vcxnsmpxcollectionclienthandler.h"
       
    28 
       
    29 // -----------------------------------------------------------------------------
       
    30 // CVcxNsContent::CVcxNsContent()
       
    31 // -----------------------------------------------------------------------------
       
    32 //
       
    33 CVcxNsContent::CVcxNsContent()
       
    34     {
       
    35     }
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 // CVcxNsContent::~CVcxNsContent()
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 CVcxNsContent::~CVcxNsContent( )
       
    42     {
       
    43     delete iUserName;
       
    44     delete iPasswd;
       
    45     delete iBrowserUrl;
       
    46     delete iIconPath;
       
    47     delete iName;
       
    48     delete iLanguage;
       
    49     delete iDescription;
       
    50     delete iAuthor;
       
    51     delete iCopyright;
       
    52     
       
    53     iContentAccesses.ResetAndDestroy();
       
    54     }
       
    55 
       
    56 // -----------------------------------------------------------------------------
       
    57 // CVcxNsContent::NewL()
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 CVcxNsContent* CVcxNsContent::NewL()
       
    61     {
       
    62     CVcxNsContent* self = new ( ELeave ) CVcxNsContent;
       
    63     
       
    64     return self;
       
    65     }
       
    66 
       
    67 
       
    68 // -----------------------------------------------------------------------------
       
    69 // CVcxNsContent::NewL
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 CVcxNsContent* CVcxNsContent::NewL( CVcxNsContent& aContent )
       
    73     {
       
    74     CVcxNsContent* self = new ( ELeave ) CVcxNsContent ();
       
    75     CleanupStack::PushL( self );
       
    76 
       
    77     self->iServiceId  = aContent.iServiceId;
       
    78     self->iContentId  = aContent.iContentId;
       
    79     self->iSize = aContent.iSize; 
       
    80     self->iLength = aContent.iLength;
       
    81     self->iAgeProfile = aContent.iAgeProfile;
       
    82     self->iPendingCommand = aContent.iPendingCommand;
       
    83     self->iCmdTransactionId = aContent.iCmdTransactionId;
       
    84     self->iDlFailNotified = aContent.iDlFailNotified;    
       
    85     self->iFullDetailsFetched = aContent.iFullDetailsFetched;
       
    86 	
       
    87     self->SetNameL( aContent.GetName() );
       
    88     self->SetLanguageL( aContent.GetLanguage() );
       
    89     self->SetDescriptionL( aContent.GetDescription() );
       
    90     self->SetAuthorL( aContent.GetAuthor() );
       
    91     self->SetCopyrightL( aContent.GetCopyright() ) ;
       
    92     self->SetUsernameL( aContent.GetUsername() );
       
    93     self->SetPasswordL( aContent.GetPassword() );
       
    94     self->SetIconPathL( aContent.GetIconPath() );
       
    95     
       
    96     for ( TInt i = 0; i < aContent.iContentAccesses.Count(); i++ )        
       
    97         {
       
    98         CVcxNsContentAccess* ca = CVcxNsContentAccess::NewL();
       
    99         CleanupStack::PushL( ca );
       
   100         CVcxNsContentAccess* cb = aContent.iContentAccesses[i];
       
   101         
       
   102         ca->SetMpxMediaL( cb->GetMpxMedia() );
       
   103         ca->SetUrlL( cb->GetUrl() );
       
   104         
       
   105         ca->iIndex = cb->iIndex;
       
   106         ca->iLastPosition = cb->iLastPosition;
       
   107         ca->iMpxId = cb->iMpxId;
       
   108         ca->iType = cb->iType;
       
   109         
       
   110         self->AddContentAccess( ca );
       
   111         CleanupStack::Pop( ca );
       
   112         }
       
   113     
       
   114     CleanupStack::Pop( self );
       
   115     
       
   116     return self;
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CVcxNsContent::GetName()
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 EXPORT_C const TDesC& CVcxNsContent::GetName()
       
   124     {
       
   125     if( iName && iName->Length() > 0 )
       
   126         {
       
   127         return *iName;
       
   128         }
       
   129     
       
   130     return KNullDesC;
       
   131     }
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134 // CVcxNsContent::GetLanguage()
       
   135 // -----------------------------------------------------------------------------
       
   136 //
       
   137 EXPORT_C const TDesC& CVcxNsContent::GetLanguage()
       
   138     {
       
   139     if( iLanguage && iLanguage->Length() > 0 )
       
   140         {
       
   141         return *iLanguage;
       
   142         }
       
   143     
       
   144     return KNullDesC;
       
   145     }
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // CVcxNsContent::GetDescription()
       
   149 // -----------------------------------------------------------------------------
       
   150 //
       
   151 EXPORT_C const TDesC& CVcxNsContent::GetDescription()
       
   152     {
       
   153     if( iDescription && iDescription->Length() > 0 )
       
   154         {
       
   155         return *iDescription;
       
   156         }
       
   157     
       
   158     return KNullDesC;
       
   159     }
       
   160 
       
   161 // -----------------------------------------------------------------------------
       
   162 // CVcxNsContent::GetAuthor()
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 EXPORT_C const TDesC& CVcxNsContent::GetAuthor()
       
   166     {
       
   167     if( iAuthor && iAuthor->Length() > 0 )
       
   168         {
       
   169         return *iAuthor;
       
   170         }
       
   171     
       
   172     return KNullDesC;
       
   173     }
       
   174 
       
   175 // -----------------------------------------------------------------------------
       
   176 // CVcxNsContent::GetCopyright()
       
   177 // -----------------------------------------------------------------------------
       
   178 //
       
   179 EXPORT_C const TDesC& CVcxNsContent::GetCopyright()
       
   180     {
       
   181     if( iCopyright && iCopyright->Length() > 0 )
       
   182         {
       
   183         return *iCopyright;
       
   184         }
       
   185     
       
   186     return KNullDesC;
       
   187     }
       
   188 
       
   189 // -----------------------------------------------------------------------------
       
   190 // CVcxNsContent::GetIconPath()
       
   191 // -----------------------------------------------------------------------------
       
   192 //
       
   193 EXPORT_C const TDesC& CVcxNsContent::GetIconPath()
       
   194     {
       
   195     if( iIconPath && iIconPath->Length() > 0 )
       
   196         {
       
   197         return *iIconPath;
       
   198         }
       
   199     
       
   200     return KNullDesC;
       
   201     }
       
   202 
       
   203 // -----------------------------------------------------------------------------
       
   204 // CVcxNsContent::GetServiceId()
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 EXPORT_C TUint32 CVcxNsContent::GetServiceId()
       
   208     {
       
   209     return iServiceId;
       
   210     }
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 // CVcxNsContent::GetContentId()
       
   214 // -----------------------------------------------------------------------------
       
   215 //
       
   216 EXPORT_C TUint32 CVcxNsContent::GetContentId()
       
   217     {
       
   218     return iContentId;
       
   219     }
       
   220 
       
   221 // -----------------------------------------------------------------------------
       
   222 // CVcxNsContent::GetSize()
       
   223 // -----------------------------------------------------------------------------
       
   224 //
       
   225 EXPORT_C TUint32 CVcxNsContent::GetSize()
       
   226     {
       
   227     return iSize;
       
   228     }
       
   229 
       
   230 // -----------------------------------------------------------------------------
       
   231 // CVcxNsContent::GetLength()
       
   232 // -----------------------------------------------------------------------------
       
   233 //
       
   234 EXPORT_C TUint32 CVcxNsContent::GetLength()
       
   235     {
       
   236     return iLength;
       
   237     }
       
   238 
       
   239 // -----------------------------------------------------------------------------
       
   240 // CVcxNsContent::GetBrowserUrl
       
   241 // -----------------------------------------------------------------------------
       
   242 //
       
   243 EXPORT_C const TDesC& CVcxNsContent::GetBrowserUrl()
       
   244     {
       
   245     if( iBrowserUrl && iBrowserUrl->Length() > 0 )
       
   246          {
       
   247          return *iBrowserUrl;
       
   248          }
       
   249      
       
   250      return KNullDesC;
       
   251     }
       
   252 
       
   253 // -----------------------------------------------------------------------------
       
   254 // 
       
   255 // -----------------------------------------------------------------------------
       
   256 //
       
   257 EXPORT_C TUint16 CVcxNsContent::GetAgeProfile()
       
   258     {
       
   259     return iAgeProfile;
       
   260     }
       
   261 
       
   262 // -----------------------------------------------------------------------------
       
   263 // CVcxNsContent::SetUsernameL
       
   264 // -----------------------------------------------------------------------------
       
   265 //
       
   266 EXPORT_C void CVcxNsContent::SetUsernameL( const TDesC& aUsername )
       
   267     {
       
   268     delete iUserName;
       
   269     iUserName = NULL;
       
   270     
       
   271     if( aUsername.Length() > 0 )
       
   272         {
       
   273         iUserName = aUsername.AllocL();
       
   274         }
       
   275     }
       
   276 
       
   277 // -----------------------------------------------------------------------------
       
   278 // CVcxNsContent::SetPasswordL
       
   279 // -----------------------------------------------------------------------------
       
   280 //
       
   281 EXPORT_C void CVcxNsContent::SetPasswordL( const TDesC& aPassword )
       
   282     {
       
   283     delete iPasswd;
       
   284     iPasswd = NULL;
       
   285     
       
   286     if( aPassword.Length() > 0 )
       
   287         {
       
   288         iPasswd = aPassword.AllocL();
       
   289         }
       
   290     }
       
   291 
       
   292 // -----------------------------------------------------------------------------
       
   293 // CVcxNsContent::GetUsername
       
   294 // -----------------------------------------------------------------------------
       
   295 //
       
   296 const TDesC& CVcxNsContent::GetUsername()
       
   297     {
       
   298     if( iUserName && iUserName->Length() > 0 )
       
   299          {
       
   300          return *iUserName;
       
   301          }
       
   302      
       
   303     return KNullDesC;
       
   304     }
       
   305 
       
   306 // -----------------------------------------------------------------------------
       
   307 // CVcxNsContent::GetPassword
       
   308 // -----------------------------------------------------------------------------
       
   309 //
       
   310 const TDesC& CVcxNsContent::GetPassword()
       
   311     {
       
   312     if( iPasswd && iPasswd->Length() > 0 )
       
   313          {
       
   314          return *iPasswd;
       
   315          }
       
   316      
       
   317     return KNullDesC;
       
   318     }
       
   319 
       
   320 // -----------------------------------------------------------------------------
       
   321 // 
       
   322 // -----------------------------------------------------------------------------
       
   323 //
       
   324 EXPORT_C CVcxNsContent::TVcxContentDlStatus CVcxNsContent::GetDlStatus()
       
   325     {
       
   326     CVcxNsContentAccess* ca = GetContentAccess( EVcxContentTypeVideo );
       
   327     
       
   328     if( !ca )
       
   329         {
       
   330         return EVcxContentDlStateNotDownloadable;
       
   331         }
       
   332     
       
   333     switch( iPendingCommand )
       
   334         {
       
   335         case EVcxNsMpxContentCommandWaitingForMpxItem:
       
   336         case EVcxNsMpxContentCommandStartDownload:
       
   337         case EVcxNsMpxContentCommandResumeDownload:
       
   338             {
       
   339             IPTVLOGSTRING_LOW_LEVEL("CVcxNsContent::GetDlStatus() iPendingCommand has value -> returning EVcxContentDlStateDownloading");
       
   340             
       
   341             return EVcxContentDlStateDownloading;
       
   342             }
       
   343         case EVcxNsMpxContentCommandCancelDownload:
       
   344             {
       
   345             if ( !GetMpxMedia(CVcxNsContent::EVcxContentTypeVideo) )
       
   346                 {
       
   347                 IPTVLOGSTRING_LOW_LEVEL("CVcxNsContent::GetDlStatus() iPendingCommand = EVcxNsMpxContentCommandCancelDownload -> returning EVcxContentDlStateNotFound");
       
   348                 return EVcxContentDlStateNotFound;
       
   349                 }
       
   350             else
       
   351                 {
       
   352                 return EVcxContentDlStateCanceling;
       
   353                 }
       
   354             }
       
   355         default:
       
   356             break;
       
   357         }
       
   358     
       
   359     if( ca->GetMpxMedia() )
       
   360         {
       
   361         TVcxContentDlStatus status = ( TVcxContentDlStatus ) ca->GetMpxMedia()->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadState );
       
   362 
       
   363         IPTVLOGSTRING2_LOW_LEVEL("CVcxNsContent::GetDlStatus() media object download state = %d", status);
       
   364         
       
   365         TUint32  dlId = ca->GetMpxMedia()->ValueTObjectL<TUint8>( KVcxMediaMyVideosDownloadId );
       
   366 
       
   367         if ( dlId == 0 ) 
       
   368             {
       
   369             // MPX item found and dl id = 0 -> item is downloaded.
       
   370             IPTVLOGSTRING_LOW_LEVEL("CVcxNsContent::GetDlStatus() dl id = 0 -> returning EVcxContentDlStateDownloaded");
       
   371             return EVcxContentDlStateDownloaded;
       
   372             }
       
   373         else 
       
   374             {
       
   375             return status;
       
   376             }
       
   377         }
       
   378 
       
   379     return EVcxContentDlStateNotFound;
       
   380     }
       
   381 
       
   382 // -----------------------------------------------------------------------------
       
   383 // 
       
   384 // -----------------------------------------------------------------------------
       
   385 //
       
   386 EXPORT_C TInt8 CVcxNsContent::GetDlProgress()
       
   387     {
       
   388     CVcxNsContentAccess* ca = GetContentAccess( EVcxContentTypeVideo );
       
   389     
       
   390     if( ca && ca->GetMpxMedia() )
       
   391         {
       
   392         TInt8 progress = ca->GetMpxMedia()->ValueTObjectL<TInt8>( KVcxMediaMyVideosDownloadProgress );
       
   393 
       
   394         const TInt KFullPercents = 100;
       
   395 
       
   396         if( progress > 0 && progress <= KFullPercents )
       
   397             {
       
   398             return progress;
       
   399             }
       
   400         }
       
   401 
       
   402     return 0;
       
   403     }
       
   404 
       
   405 // -----------------------------------------------------------------------------
       
   406 // CVcxNsMpx::GetContentTypes()
       
   407 // -----------------------------------------------------------------------------
       
   408 //
       
   409 EXPORT_C TUint32 CVcxNsContent::GetContentTypes()
       
   410     {
       
   411     TUint32 flags( 0 );
       
   412     
       
   413     for( TInt idx = iContentAccesses.Count()-1; idx >= 0; idx-- )
       
   414         {
       
   415         flags |= ( TUint32 ) (iContentAccesses[idx])->iType;
       
   416         }
       
   417     
       
   418     return flags;
       
   419     }
       
   420 
       
   421 
       
   422 // -----------------------------------------------------------------------------
       
   423 // CVcxNsContent::GetUrl()
       
   424 // -----------------------------------------------------------------------------
       
   425 //
       
   426 EXPORT_C const TDesC& CVcxNsContent::GetUrl( TVcxNsContentAccessType aType )
       
   427     {
       
   428     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   429     
       
   430     if( ca )
       
   431         {
       
   432         return ca->GetUrl();
       
   433         }
       
   434 
       
   435     return KNullDesC;        
       
   436     }
       
   437 
       
   438 // -----------------------------------------------------------------------------
       
   439 // CVcxNsContent::GetLocalFilepath()
       
   440 // -----------------------------------------------------------------------------
       
   441 //
       
   442 const TDesC& CVcxNsContent::GetLocalFilepath( TVcxNsContentAccessType aType )
       
   443     {
       
   444     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   445     
       
   446     if( ca && ca->GetMpxMedia() )
       
   447         {
       
   448         return ca->GetMpxMedia()->ValueText( KMPXMediaGeneralUri );
       
   449         }
       
   450 
       
   451     return KNullDesC;
       
   452     }
       
   453 
       
   454 // -----------------------------------------------------------------------------
       
   455 // CVcxNsContent::GetLastPlaybackPosition()
       
   456 // -----------------------------------------------------------------------------
       
   457 //
       
   458 TInt32 CVcxNsContent::GetLastPlaybackPosition( TVcxNsContentAccessType aType )
       
   459     {
       
   460     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   461     
       
   462     if ( ca && CIptvUtil::LastPlaybackPositionFeatureSupported() )
       
   463         {
       
   464         if( aType == EVcxContentTypeVideo )
       
   465             {
       
   466             TInt position( 0 );
       
   467             CMPXMedia* media( ca->GetMpxMedia() );
       
   468             if ( media && media->IsSupported( KMPXMediaGeneralLastPlaybackPosition ) )
       
   469                 {
       
   470                 position = *media->Value<TInt>( KMPXMediaGeneralLastPlaybackPosition );
       
   471                 }
       
   472             return position > 0 ? position : 0;
       
   473             }
       
   474         else if ( aType == EVcxContentTypeStream )
       
   475             {
       
   476             return ca->iLastPosition;
       
   477             }
       
   478         }
       
   479 
       
   480     return 0;
       
   481     }
       
   482 
       
   483 // -----------------------------------------------------------------------------
       
   484 // CVcxNsContent::SetLastPlaybackPosition()
       
   485 // -----------------------------------------------------------------------------
       
   486 //
       
   487 void CVcxNsContent::SetLastPlaybackPosition( const TReal32 aPos, TVcxNsContentAccessType aType )
       
   488     {
       
   489     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   490 
       
   491     if ( ca && CIptvUtil::LastPlaybackPositionFeatureSupported() )
       
   492         {
       
   493         ca->iLastPosition = aPos;
       
   494         }
       
   495     }
       
   496 
       
   497 // -----------------------------------------------------------------------------
       
   498 // CVcxNsContent::SetNameL()
       
   499 // -----------------------------------------------------------------------------
       
   500 //
       
   501 void CVcxNsContent::SetNameL( const TDesC& aName )
       
   502     {
       
   503     delete iName;
       
   504     iName = NULL;
       
   505     
       
   506     if( aName.Length() > 0 )
       
   507         {
       
   508         iName = aName.AllocL();
       
   509         } 
       
   510     }
       
   511 
       
   512 // -----------------------------------------------------------------------------
       
   513 // CVcxNsContent::SetLanguageL()
       
   514 // -----------------------------------------------------------------------------
       
   515 //
       
   516 void CVcxNsContent::SetLanguageL( const TDesC& aLanguage )
       
   517     {
       
   518     delete iLanguage;
       
   519     iLanguage = NULL;
       
   520     
       
   521     if( aLanguage.Length() > 0 )
       
   522         {
       
   523         iLanguage = aLanguage.AllocL();
       
   524         } 
       
   525     }
       
   526 
       
   527 // -----------------------------------------------------------------------------
       
   528 // CVcxNsContent::SetDescriptionL()
       
   529 // -----------------------------------------------------------------------------
       
   530 //
       
   531 void CVcxNsContent::SetDescriptionL( const TDesC& aDescription )
       
   532     {
       
   533     delete iDescription;
       
   534     iDescription = NULL;
       
   535     
       
   536     if( aDescription.Length() > 0 )
       
   537         {
       
   538         iDescription = aDescription.AllocL();
       
   539         } 
       
   540     }
       
   541 
       
   542 // -----------------------------------------------------------------------------
       
   543 // CVcxNsContent::SetAuthorL()
       
   544 // -----------------------------------------------------------------------------
       
   545 //
       
   546 void CVcxNsContent::SetAuthorL( const TDesC& aAuthor )
       
   547     {
       
   548     delete iAuthor;
       
   549     iAuthor = NULL;
       
   550     
       
   551     if( aAuthor.Length() > 0 )
       
   552         {
       
   553         iAuthor = aAuthor.AllocL();
       
   554         } 
       
   555     }
       
   556 
       
   557 // -----------------------------------------------------------------------------
       
   558 // CVcxNsContent::SetCopyrightL()
       
   559 // -----------------------------------------------------------------------------
       
   560 //
       
   561 void CVcxNsContent::SetCopyrightL( const TDesC& aCopyright )
       
   562     {
       
   563     delete iCopyright;
       
   564     iCopyright = NULL;
       
   565     
       
   566     if( aCopyright.Length() > 0 )
       
   567         {
       
   568         iCopyright = aCopyright.AllocL();
       
   569         } 
       
   570     }
       
   571 
       
   572 // -----------------------------------------------------------------------------
       
   573 // CVcxNsContent::SetIconPathL()
       
   574 // -----------------------------------------------------------------------------
       
   575 //
       
   576 void CVcxNsContent::SetIconPathL( const TDesC& aPath )
       
   577     {
       
   578     delete iIconPath;
       
   579     iIconPath = NULL;
       
   580     
       
   581     if( aPath.Length() > 0 )
       
   582         {
       
   583         iIconPath = aPath.AllocL();
       
   584         } 
       
   585     }
       
   586 
       
   587 // -----------------------------------------------------------------------------
       
   588 // CVcxNsContent::SetServiceId()
       
   589 // -----------------------------------------------------------------------------
       
   590 //
       
   591 void CVcxNsContent::SetServiceId( const TUint32 aServiceId )
       
   592     {
       
   593     iServiceId = aServiceId;
       
   594     }
       
   595 // -----------------------------------------------------------------------------
       
   596 // CVcxNsContent::SetContentId()
       
   597 // -----------------------------------------------------------------------------
       
   598 //
       
   599 void CVcxNsContent::SetContentId( const TUint32 aContentId )
       
   600     {
       
   601     iContentId = aContentId;
       
   602     }
       
   603 // -----------------------------------------------------------------------------
       
   604 // CVcxNsContent::SetSize()
       
   605 // -----------------------------------------------------------------------------
       
   606 //
       
   607 void CVcxNsContent::SetSize( const TUint32 aSize )
       
   608     {
       
   609     iSize = aSize;
       
   610     }
       
   611 
       
   612 // -----------------------------------------------------------------------------
       
   613 // CVcxNsContent::SetLength()
       
   614 // -----------------------------------------------------------------------------
       
   615 //
       
   616 void CVcxNsContent::SetLength( const TUint32 aLength )
       
   617     {
       
   618     iLength = aLength;
       
   619     }
       
   620 
       
   621 // -----------------------------------------------------------------------------
       
   622 // CVcxNsContent::SetBrowserUrlL()
       
   623 // -----------------------------------------------------------------------------
       
   624 //
       
   625 void CVcxNsContent::SetBrowserUrlL( const TDesC& aBrowserUrl )
       
   626     {
       
   627     delete iBrowserUrl;
       
   628     iBrowserUrl = NULL;
       
   629     
       
   630     if( aBrowserUrl.Length() > 0 )
       
   631         {
       
   632         iBrowserUrl = aBrowserUrl.AllocL();
       
   633         }    
       
   634     }
       
   635 
       
   636 // -----------------------------------------------------------------------------
       
   637 // CVcxNsContent::SetAgeProfile()
       
   638 // -----------------------------------------------------------------------------
       
   639 //
       
   640 void CVcxNsContent::SetAgeProfile( const TUint16 aAgeProfile )
       
   641     {
       
   642     iAgeProfile = aAgeProfile;
       
   643     }
       
   644 
       
   645 // -----------------------------------------------------------------------------
       
   646 // CVcxNsContent::SetMpxMediaL()
       
   647 // -----------------------------------------------------------------------------
       
   648 //
       
   649 void CVcxNsContent::SetMpxMediaL( CMPXMedia* aMpxMedia, TVcxNsContentAccessType aType )
       
   650     {
       
   651     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   652 
       
   653     if ( iPendingCommand == EVcxNsMpxContentCommandWaitingForMpxItem ||
       
   654          iPendingCommand == EVcxNsMpxContentCommandStartDownload ||
       
   655          iPendingCommand == EVcxNsMpxContentCommandResumeDownload )
       
   656         {
       
   657         iPendingCommand = EVcxNsMpxContentCommandNone;
       
   658         }
       
   659     
       
   660     if( ca )
       
   661         {
       
   662         ca->SetMpxMediaL( aMpxMedia );
       
   663         }
       
   664     }
       
   665 
       
   666 // -----------------------------------------------------------------------------
       
   667 // CVcxNsContent::GetMpxMedia()
       
   668 // -----------------------------------------------------------------------------
       
   669 //
       
   670 CMPXMedia* CVcxNsContent::GetMpxMedia( TVcxNsContentAccessType aType )
       
   671     {
       
   672     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   673     
       
   674     if( ca )
       
   675         {
       
   676         return ca->GetMpxMedia();
       
   677         }
       
   678     return NULL;
       
   679     }
       
   680 
       
   681 // -----------------------------------------------------------------------------
       
   682 // CVcxNsContent::GetMpxId()
       
   683 // -----------------------------------------------------------------------------
       
   684 //
       
   685 TUint32 CVcxNsContent::GetMpxId( TVcxNsContentAccessType aType )
       
   686     {
       
   687     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   688     
       
   689     if( ca )
       
   690         {
       
   691         return ca->iMpxId;
       
   692         }
       
   693     
       
   694     return 0;
       
   695     }
       
   696 
       
   697 // -----------------------------------------------------------------------------
       
   698 // CVcxNsContent::SetMpxId()
       
   699 // -----------------------------------------------------------------------------
       
   700 //
       
   701 void CVcxNsContent::SetMpxId( const TUint32 aMpxId, TVcxNsContentAccessType aType )
       
   702     {
       
   703     CVcxNsContentAccess* ca = GetContentAccess( aType );
       
   704     
       
   705     if( ca )
       
   706         {
       
   707         ca->iMpxId = aMpxId;
       
   708         }
       
   709     }
       
   710 
       
   711 // -----------------------------------------------------------------------------
       
   712 // CVcxNsContent::AddContentAccess()
       
   713 // -----------------------------------------------------------------------------
       
   714 //
       
   715 void CVcxNsContent::AddContentAccess( CVcxNsContentAccess* aContentAccess )
       
   716     {
       
   717     iContentAccesses.Append( aContentAccess );
       
   718     }
       
   719 
       
   720 // -----------------------------------------------------------------------------
       
   721 // CVcxNsMpx::GetContentAccess()
       
   722 // -----------------------------------------------------------------------------
       
   723 //
       
   724 CVcxNsContentAccess* CVcxNsContent::GetContentAccess( TVcxNsContentAccessType aType )
       
   725     {
       
   726     for( TInt idx = iContentAccesses.Count()-1; idx >= 0; idx-- )
       
   727         {
       
   728         if ( (iContentAccesses[idx])->iType == aType )
       
   729             {
       
   730             return (iContentAccesses[idx]);
       
   731             }
       
   732         }
       
   733     
       
   734     return NULL;
       
   735     }
       
   736 
       
   737 // -----------------------------------------------------------------------------
       
   738 // CVcxNsMpx::SetPendingCommand()
       
   739 // -----------------------------------------------------------------------------
       
   740 //
       
   741 void CVcxNsContent::SetPendingCommand( TVcxNsMpxContentCommand aCmd )
       
   742     {
       
   743     iPendingCommand = aCmd;
       
   744     }
       
   745 
       
   746 // -----------------------------------------------------------------------------
       
   747 // CVcxNsMpx::PendingCommand()
       
   748 // -----------------------------------------------------------------------------
       
   749 //
       
   750 CVcxNsContent::TVcxNsMpxContentCommand CVcxNsContent::PendingCommand()
       
   751     {
       
   752     return iPendingCommand;
       
   753     }
       
   754 
       
   755 // -----------------------------------------------------------------------------
       
   756 // CVcxNsMpx::SetCmdTransactionId()
       
   757 // -----------------------------------------------------------------------------
       
   758 //
       
   759 void CVcxNsContent::SetCmdTransactionId( TUint32 aTrId )
       
   760     {
       
   761     iCmdTransactionId = aTrId;
       
   762     }
       
   763 
       
   764 // -----------------------------------------------------------------------------
       
   765 // CVcxNsMpx::CmdTransactionId()
       
   766 // -----------------------------------------------------------------------------
       
   767 //
       
   768 TUint32 CVcxNsContent::CmdTransactionId()
       
   769     {
       
   770     return iCmdTransactionId;
       
   771     }
       
   772 
       
   773 // -----------------------------------------------------------------------------
       
   774 // CVcxNsMpx::SetDlFailNotified()
       
   775 // -----------------------------------------------------------------------------
       
   776 //
       
   777 void CVcxNsContent::SetDlFailNotified( TBool aDlFailNotified )
       
   778     {
       
   779     iDlFailNotified = aDlFailNotified;
       
   780     }
       
   781 
       
   782 // -----------------------------------------------------------------------------
       
   783 // CVcxNsMpx::DlFailNotified()
       
   784 // -----------------------------------------------------------------------------
       
   785 //
       
   786 TBool CVcxNsContent::DlFailNotified()
       
   787     {
       
   788     return iDlFailNotified;
       
   789     }
       
   790 
       
   791 // -----------------------------------------------------------------------------
       
   792 // CVcxNsMpx::SetFullDetailsFetched()
       
   793 // -----------------------------------------------------------------------------
       
   794 //
       
   795 void CVcxNsContent::SetFullDetailsFetched( TBool aFullDetailsFetched )
       
   796     {
       
   797     iFullDetailsFetched = aFullDetailsFetched;
       
   798     }
       
   799 
       
   800 // -----------------------------------------------------------------------------
       
   801 // CVcxNsMpx::FullDetailsFetched()
       
   802 // -----------------------------------------------------------------------------
       
   803 //
       
   804 TBool CVcxNsContent::FullDetailsFetched()
       
   805     {
       
   806     return iFullDetailsFetched;
       
   807     }