videofeeds/vcnsuiengine/inc/vcxnscontent.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 
       
    19 
       
    20 
       
    21 #ifndef C_VCXNSVODCONTENT_H
       
    22 #define C_VCXNSVODCONTENT_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32std.h>
       
    26 #include <e32base.h>
       
    27 
       
    28 #include <vcxmyvideosdefs.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CMPXMedia;
       
    32 class CVcxNsContentAccess;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  *  CVcxNsContent
       
    38  * 
       
    39  * @lib vcxnsuiengine.lib
       
    40  */
       
    41 class CVcxNsContent : public CBase
       
    42     {
       
    43 
       
    44 public:
       
    45 
       
    46     /**
       
    47      * TVcxContentDlStatus
       
    48      * Typedef that links the content dl status to mpx dl status
       
    49      */ 
       
    50     typedef enum
       
    51         {
       
    52         EVcxContentDlStateNone         =   EVcxMyVideosDlStateNone,
       
    53         EVcxContentDlStateDownloading  =   EVcxMyVideosDlStateDownloading,
       
    54         EVcxContentDlStateFailed       =   EVcxMyVideosDlStateFailed,
       
    55         EVcxContentDlStatePaused       =   EVcxMyVideosDlStatePaused,
       
    56         EVcxContentDlStateDownloaded   =   EVcxMyVideosDlStateDownloaded,
       
    57         EVcxContentDlStateNotFound     =   1000,  // Mpx item not found
       
    58         EVcxContentDlStateNotDownloadable,        // Content has no downloadable media content
       
    59         EVcxContentDlStateCanceling // Dl cancel command has been sent to collection, dl start cmd is not offered for user
       
    60         }  TVcxContentDlStatus;
       
    61 
       
    62     /**
       
    63      * TVcxNsContentAccessType
       
    64      * 
       
    65      * Defines the mime / handling type of given content media acess.
       
    66      */ 
       
    67     typedef enum
       
    68         {
       
    69         EVcxContentTypeNoType          = 0x00,
       
    70         EVcxContentTypeVideo           = 0x01,
       
    71         EVcxContentTypeStream          = 0x02,
       
    72         EVcxContentTypePreviewVideo    = 0x04,
       
    73         EVcxContentTypePreviewStream   = 0x08
       
    74         } TVcxNsContentAccessType;
       
    75 
       
    76     /**
       
    77      * TVcxNsMpxContentCommand
       
    78      */    
       
    79     typedef enum 
       
    80         {
       
    81         EVcxNsMpxContentCommandNone = 0,
       
    82         EVcxNsMpxContentCommandStartDownload,
       
    83         EVcxNsMpxContentCommandCancelDownload,
       
    84         EVcxNsMpxContentCommandPauseDownload,
       
    85         EVcxNsMpxContentCommandResumeDownload,
       
    86         EVcxNsMpxContentCommandWaitingForMpxItem
       
    87         } TVcxNsMpxContentCommand;
       
    88 
       
    89     static CVcxNsContent* NewL();
       
    90 
       
    91 	/**
       
    92 	 * Copy ctor
       
    93 	 *
       
    94 	 * @param aContent Content to be made a copy
       
    95 	 */
       
    96     static CVcxNsContent* NewL( CVcxNsContent& aContent );
       
    97 
       
    98     virtual ~CVcxNsContent();
       
    99 
       
   100     /**
       
   101      * GetName
       
   102      * @return Name
       
   103      */
       
   104     IMPORT_C const TDesC& GetName();
       
   105 
       
   106     /**
       
   107      * GetLanguage
       
   108      * @return Language
       
   109      */
       
   110     IMPORT_C const TDesC& GetLanguage();
       
   111     
       
   112     /**
       
   113      * GetDescription
       
   114      * @return Description
       
   115      */
       
   116     IMPORT_C const TDesC& GetDescription();
       
   117     
       
   118     /**
       
   119      * GetAuthor
       
   120      * @return Author
       
   121      */
       
   122     IMPORT_C const TDesC& GetAuthor();  
       
   123   
       
   124     /**
       
   125      * GetCopyright
       
   126      * @return GetCopyright
       
   127      */
       
   128     IMPORT_C const TDesC& GetCopyright();  
       
   129   
       
   130      /**
       
   131      * GetIconPath
       
   132      * @return IconPath
       
   133      */
       
   134     IMPORT_C const TDesC& GetIconPath();
       
   135     
       
   136     /**
       
   137      * GetServiceId
       
   138      * @return ServiceId
       
   139      */
       
   140     IMPORT_C TUint32 GetServiceId();
       
   141      
       
   142     /**
       
   143      * GetContentId
       
   144      * @return ContentId
       
   145      */
       
   146     IMPORT_C TUint32 GetContentId();
       
   147     
       
   148     /**
       
   149      * Get size
       
   150      * @return Size
       
   151      */
       
   152     IMPORT_C TUint32 GetSize();
       
   153     
       
   154     /**
       
   155      * Get length in time
       
   156      * @return Length
       
   157      */
       
   158     IMPORT_C TUint32 GetLength();
       
   159     
       
   160     /**
       
   161      * Get browser url
       
   162      * @return Browser url
       
   163      */
       
   164     IMPORT_C const TDesC& GetBrowserUrl();
       
   165     
       
   166     /**
       
   167      * Get DlStatus
       
   168      * @return Dl Status
       
   169      */
       
   170     IMPORT_C TVcxContentDlStatus GetDlStatus();
       
   171     
       
   172     /**
       
   173      * Get DlProgress in time
       
   174      * @return Dl Progress
       
   175      */
       
   176     IMPORT_C TInt8 GetDlProgress();    
       
   177 
       
   178     /**
       
   179      * Get content access types found from this content.
       
   180      * Content type flag values are masked to return value.
       
   181      * @return  Content types
       
   182      */
       
   183     IMPORT_C TUint32 GetContentTypes();
       
   184    
       
   185     /**
       
   186      * GetUrl
       
   187      * @return Url
       
   188      */
       
   189     IMPORT_C const TDesC& GetUrl( TVcxNsContentAccessType aContentType );
       
   190     
       
   191     /**
       
   192      * Get age profile for this content.
       
   193      * @return Age profile.
       
   194      */
       
   195     IMPORT_C TUint16 GetAgeProfile();
       
   196 
       
   197     /**
       
   198      * Set user name
       
   199      * @param aUsername
       
   200      */
       
   201     IMPORT_C void SetUsernameL( const TDesC& aUsername );
       
   202     
       
   203     /**
       
   204      * Set password
       
   205      * @param aPassword
       
   206      */
       
   207     IMPORT_C void SetPasswordL( const TDesC& aPassword );
       
   208     
       
   209     /**
       
   210      * Get user name
       
   211      * @return Username
       
   212      */
       
   213     const TDesC& GetUsername();
       
   214     
       
   215     /**
       
   216      * Get password
       
   217      * @return Password
       
   218      */
       
   219     const TDesC& GetPassword();
       
   220     
       
   221     /**
       
   222      * Get local filepath
       
   223      * @param aType Type of the content access, which path to get
       
   224      * @return path
       
   225      */
       
   226     const TDesC& GetLocalFilepath( TVcxNsContentAccessType aType );
       
   227     
       
   228     /**
       
   229      * Get Last Playback Position
       
   230      * 
       
   231      * @param aType Type of the content access, which position to get
       
   232      * @return Last playback position
       
   233      */
       
   234     TInt32 GetLastPlaybackPosition( TVcxNsContentAccessType aType );
       
   235     
       
   236     /**
       
   237      * Set Last Playback Position
       
   238      * @param aPos Last playback position
       
   239      * @param aType Type of the content access, which position to get
       
   240      */
       
   241     void SetLastPlaybackPosition( const TReal32 aPos, TVcxNsContentAccessType aType );
       
   242 
       
   243     /**
       
   244      * SetNameL
       
   245      * @param aName Name
       
   246      */
       
   247     void SetNameL( const TDesC& aName );
       
   248     
       
   249     /**
       
   250      * SetLanguageL
       
   251      * @param aLanguage Language
       
   252      */
       
   253     void SetLanguageL( const TDesC& aLanguage );
       
   254     
       
   255     /**
       
   256      * SetDescriptionL
       
   257      * @param aDescription Description
       
   258      */
       
   259     void SetDescriptionL( const TDesC& aDescription );
       
   260     
       
   261     /**
       
   262      * SetAuthorL
       
   263      * @param aAuthor Author
       
   264      */
       
   265     void SetAuthorL( const TDesC& aAuthor );    
       
   266 
       
   267     /**
       
   268      * SetCopyrightL
       
   269      * @param aCopyright Copyright
       
   270      */
       
   271     void SetCopyrightL( const TDesC& aCopyright );
       
   272     
       
   273     /**
       
   274      * SetIconPathL
       
   275      * @param aPath Path
       
   276      */
       
   277     void SetIconPathL( const TDesC& aPath );
       
   278 
       
   279     /**
       
   280      * SetServiceId
       
   281      * @param aServiceId ServiceId
       
   282      */
       
   283     void SetServiceId( const TUint32 aServiceId );
       
   284     
       
   285     /**
       
   286      * SetContentId
       
   287      * @param aContentId ContentId
       
   288      */
       
   289     void SetContentId( const TUint32 aContentId );
       
   290 
       
   291     /**
       
   292      * Set size
       
   293      * @param aSize Size
       
   294      */
       
   295     void SetSize( const TUint32 aSize );
       
   296     
       
   297     /**
       
   298      * Set length
       
   299      * @param aLength Length
       
   300      */
       
   301     void SetLength( const TUint32 aLength );
       
   302 
       
   303     /**
       
   304      * Set browser url
       
   305      * @param aBrowserUrl Browser Url
       
   306      */
       
   307     void SetBrowserUrlL( const TDesC& aBrowserUrl );
       
   308 
       
   309     /**
       
   310      * Set age profile.
       
   311      * @param aAgeProfile Age profile.
       
   312      */
       
   313     void SetAgeProfile( const TUint16 aAgeProfile );
       
   314 
       
   315     /**
       
   316      * Set mpx media
       
   317      * @param aMpxMedia Mpx Media object
       
   318      * @param aType Content access type
       
   319      */
       
   320     void SetMpxMediaL( CMPXMedia* aMpxMedia,
       
   321                        TVcxNsContentAccessType aType = EVcxContentTypeVideo );
       
   322     
       
   323     /**
       
   324      * Get mpx media
       
   325      * @param aType Content access type
       
   326      * @return Media object
       
   327      */
       
   328     CMPXMedia* GetMpxMedia( TVcxNsContentAccessType aType = EVcxContentTypeVideo );
       
   329     
       
   330     /**
       
   331      * Get mpx id
       
   332      * @param aType Content access type
       
   333      * @return 
       
   334      */    
       
   335     TUint32 GetMpxId( TVcxNsContentAccessType aType = EVcxContentTypeVideo );
       
   336     
       
   337      /**
       
   338       * Set mpx id
       
   339       * @param aMpxId Mpx Media id
       
   340       * @param aType Content access type
       
   341       */   
       
   342     void SetMpxId( const TUint32 aMpxId, TVcxNsContentAccessType aType = EVcxContentTypeVideo );
       
   343 
       
   344     /**
       
   345      * Adds content access. Transfers ownership to this class.
       
   346      * @param aContentAccess Media content access
       
   347      */    
       
   348     void AddContentAccess( CVcxNsContentAccess* aContentAccess );
       
   349 
       
   350      /**
       
   351       * Get media content.
       
   352       * @param aType Content access type
       
   353       * @return Media content access
       
   354       */   
       
   355     CVcxNsContentAccess* GetContentAccess( TVcxNsContentAccessType aType );
       
   356 
       
   357     /**
       
   358      * Pending collection command. Cmd has been sent, but not yet processed.
       
   359      * see TVcxNsMpxContentCommand
       
   360      * @param aCmd Issued command
       
   361      */
       
   362     void SetPendingCommand( TVcxNsMpxContentCommand aCmd );
       
   363 
       
   364     /**
       
   365      * Pending collection command. Cmd has been sent, but not yet processed.
       
   366      * see TVcxNsMpxContentCommand
       
   367      * @return Pending command
       
   368      */
       
   369     TVcxNsMpxContentCommand PendingCommand();
       
   370 
       
   371     /**
       
   372      * Pending collection command's transaction id.
       
   373      * Needed to identify when the command is completed.
       
   374      * @param aTrId Current command's transaction id
       
   375      */
       
   376     void SetCmdTransactionId( TUint32 aTrId );
       
   377 
       
   378     /**
       
   379      * Pending collection command's transaction id.
       
   380      * Needed to identify when the command is completed.
       
   381      * @return Current command's transaction id
       
   382      */
       
   383     TUint32 CmdTransactionId();
       
   384 
       
   385     /**
       
   386      * DlFailNotified
       
   387      * @return Is the dl failure notified to ui engine observers.
       
   388      */
       
   389     TBool DlFailNotified();
       
   390     
       
   391     /**
       
   392      * SetDlFailNotified
       
   393      * @param aDlFailNotified Is the dl fail notified.
       
   394      */
       
   395     void SetDlFailNotified( TBool aDlFailNotified );
       
   396 
       
   397     /**
       
   398      * FullDetailsFetched
       
   399      * @return Has the full details been fetched to the content item.
       
   400      */
       
   401     TBool FullDetailsFetched();
       
   402     
       
   403     /**
       
   404      * SetFullDetailsFetched
       
   405      * @param aFullDetailsFetched Is the full details fetched.
       
   406      */
       
   407     void SetFullDetailsFetched( TBool aFullDetailsFetched );
       
   408     
       
   409 private:
       
   410 
       
   411     CVcxNsContent( );
       
   412     
       
   413 // Data
       
   414 
       
   415     /**
       
   416      * Content name
       
   417      * Own.
       
   418      */
       
   419     HBufC* iName;
       
   420 
       
   421     /**
       
   422      * iLanguage.
       
   423      * Own.
       
   424      */
       
   425     HBufC* iLanguage;
       
   426     
       
   427     /**
       
   428      * iDescription.
       
   429      * Own.
       
   430      */
       
   431     HBufC* iDescription;
       
   432     
       
   433     /**
       
   434      * iAuthor.
       
   435      * Own.
       
   436      */
       
   437     HBufC* iAuthor;
       
   438     
       
   439     /**
       
   440      * iCopyright.
       
   441      * Own.
       
   442      */
       
   443     HBufC* iCopyright;
       
   444     
       
   445     /**
       
   446      * Icon path
       
   447      * Own.
       
   448      */
       
   449     HBufC* iIconPath;
       
   450 
       
   451     /**
       
   452      * Service Id
       
   453      */
       
   454     TUint32 iServiceId;
       
   455     
       
   456     /**
       
   457      * Content Id
       
   458      */
       
   459     TUint32 iContentId;
       
   460     
       
   461     /**
       
   462      * Size
       
   463      */
       
   464     TUint32 iSize; 
       
   465     
       
   466     /**        
       
   467     * Length in time
       
   468     */
       
   469     TUint32 iLength;
       
   470     
       
   471     /**        
       
   472     * Browser url
       
   473     * Own.
       
   474     */
       
   475     HBufC* iBrowserUrl;
       
   476     
       
   477     /**        
       
   478     * Video age profile.
       
   479     */
       
   480     TUint16 iAgeProfile;
       
   481     
       
   482     /**        
       
   483     * Username
       
   484     * Own.
       
   485     */
       
   486     HBufC* iUserName;
       
   487     
       
   488     /**        
       
   489     * Password
       
   490     * Own.
       
   491     */
       
   492     HBufC* iPasswd;
       
   493     
       
   494     /**        
       
   495     * Content acess array.
       
   496     */
       
   497     RPointerArray<CVcxNsContentAccess> iContentAccesses;
       
   498 
       
   499     /**
       
   500      * Pending collection command. Cmd has been sent, but not yet processed.
       
   501      * 
       
   502      * see typedef TVcxNsMpxContentCommand
       
   503      */
       
   504     TVcxNsMpxContentCommand iPendingCommand;
       
   505 
       
   506     /**
       
   507      * Pending collection command's transaction id.
       
   508      * 
       
   509      * Needed to identify when the command is completed.
       
   510      */
       
   511     TUint32 iCmdTransactionId;
       
   512 
       
   513     /**
       
   514      * Is error note show to user.
       
   515      */
       
   516     TBool iDlFailNotified;
       
   517 
       
   518     /**
       
   519      * Has the full details been fetched to the content item.
       
   520      */
       
   521     TBool iFullDetailsFetched;
       
   522     
       
   523     };
       
   524 
       
   525 #endif // C_VCXNSVODCONTENT_H