videofeeds/utils/inc/iptvlastwatcheddata.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2007-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:    Contains Video Center's last watched item's data.*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_IPTVLASTWATCHEDDATA_H
       
    21 #define C_IPTVLASTWATCHEDDATA_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include "CIptvUtil.h"
       
    25 
       
    26 // Consts
       
    27 const TInt KIptvLastWatchedStartparamMaxLength = 16384; // 16kB
       
    28 const TInt KIptvLastWatchedUriMaxLength = 2048;
       
    29 const TInt KIdUndefined = KMaxTInt32 - 1;
       
    30 
       
    31 /**
       
    32  *  Last watched data class
       
    33  *
       
    34  *  VideoCenter Main UI has the last watched item, data of that item can be set
       
    35  *  and get via the API by this class. This is used also when there is
       
    36  *  Space UI support available, this class contains MainUI's last watched
       
    37  *  item's launch data.
       
    38  *
       
    39  *  @lib IptvUtil.lib
       
    40  *  @since S60 v3.1
       
    41  */
       
    42 class CIptvLastWatchedData : public CBase
       
    43     {
       
    44 
       
    45 public: // structs
       
    46 
       
    47     /**
       
    48      * Type of the launch of last watched item.
       
    49      */
       
    50     enum TLaunchType
       
    51         {
       
    52         /**
       
    53          * Not defined.
       
    54          */
       
    55         EUndefined,
       
    56 
       
    57         /**
       
    58          * Activate VideoCenter's local view by view server id and pass parameters for the view.
       
    59          *
       
    60          * Last watched command handling uses CAknViewAppUi::ActivateLocalViewL()
       
    61          */
       
    62         EView,
       
    63 
       
    64         /**
       
    65          * Start application by app and view uid and pass parameters for the
       
    66          * application.
       
    67          *
       
    68          * Last watched command handling uses CCoeAppUi::ActivateViewL();
       
    69          */
       
    70         EApplication,
       
    71 
       
    72         /**
       
    73          * Send message to an application by app and view uid and pass
       
    74          * parameters for the application. Application should be running if
       
    75          * using this method.
       
    76          *
       
    77          * Last watched command handling uses TApaTask::SendMessageL
       
    78          */
       
    79         EHandleMessage,
       
    80 
       
    81         /**
       
    82          * Try to send a message to the application by app and view uid
       
    83          * and pass parameters for the application. If application is not
       
    84          * running it is started via apparc.
       
    85          *
       
    86          * Last watched command handling uses RApaLsSession::StartApp
       
    87          */
       
    88         EApaMsgWithTail
       
    89         };
       
    90 
       
    91 public: // member functions
       
    92 
       
    93     IMPORT_C static CIptvLastWatchedData* NewL();
       
    94     virtual ~CIptvLastWatchedData();
       
    95 
       
    96     /**
       
    97      * Read data stream and construct this class from it.
       
    98      * @param aStream Stream to read data from.
       
    99      */
       
   100     IMPORT_C void InternalizeL( RReadStream& aStream );
       
   101 
       
   102     /**
       
   103      * Write class data to binary format which can be stored in a file.
       
   104      * @param aStream The Stream where data is written.
       
   105      */
       
   106     IMPORT_C void ExternalizeL( RWriteStream& aStream );
       
   107 
       
   108     /**
       
   109      * Sets the last watched item's name
       
   110      * Max length = KIptvMyVideosVideoNameMaxLength = 100
       
   111      * @since S60 v3.1
       
   112      * @param aName item's name
       
   113      * @return System-wide error code
       
   114      */
       
   115     IMPORT_C TInt SetNameL( const TDesC& aName );
       
   116 
       
   117     /**
       
   118      * Sets the last watched item's URI
       
   119      * Max length = KIptvLastWatchedUriMaxLength = 2048
       
   120      * @since S60 v3.1
       
   121      * @param aUri Item's uri, works as unique identifier.
       
   122      * @return System-wide error code
       
   123      */
       
   124     IMPORT_C TInt SetUriL( const TDesC& aUri );
       
   125 
       
   126     /**
       
   127      * Sets the last watched item's icon path
       
   128      * Max length = KIptvMaxPath = 255
       
   129      * @since S60 v3.1
       
   130      * @param aIconPath item's icon path
       
   131      * @return System-wide error code
       
   132      */
       
   133     IMPORT_C TInt SetIconPathL( const TDesC& aIconPath );
       
   134 
       
   135     /**
       
   136      * Sets the last watched item's mime type
       
   137      * Max length = KIptvMyVideosVideoMaxMimeTypeLength
       
   138      * @since S60 v3.2
       
   139      * @param aMimeType item's mime type
       
   140      * @return System-wide error code
       
   141      */
       
   142     IMPORT_C TInt SetMimeTypeL( const TDesC& aMimeType );
       
   143 
       
   144     /**
       
   145      * Sets the last watched item's service id
       
   146      * @since S60 v3.2
       
   147      * @param aServiceId item's service id
       
   148      * @return System-wide error code
       
   149      */
       
   150     IMPORT_C TInt SetServiceId( const TInt32 aServiceId );
       
   151 
       
   152     /**
       
   153      * Sets the last watched item's content id
       
   154      * @since S60 v3.2
       
   155      * @param aContentId item's content id
       
   156      * @return System-wide error code
       
   157      */
       
   158     IMPORT_C TInt SetContentId( const TIptvContentId aContentId );
       
   159 
       
   160     /**
       
   161      * Sets the last watched item's content index
       
   162      * @since S60 v3.2
       
   163      * @param aContentIndex item's content index
       
   164      * @return System-wide error code
       
   165      */
       
   166     IMPORT_C TInt SetContentIndex( const TInt32 aContentIndex );
       
   167 
       
   168     /**
       
   169      * Sets the last watched item's last play point
       
   170      * @since S60 v3.2
       
   171      * @param aLastVideoPlayPoint item's last play point
       
   172      * @return System-wide error code
       
   173      */
       
   174     IMPORT_C TInt SetLastVideoPlayPoint( const TUint32 aLastVideoPlayPoint );
       
   175 
       
   176     /**
       
   177      * Sets the last watched item's parental control limit
       
   178      * @since S60 v3.2
       
   179      * @param aParentalControl item's parental control limit
       
   180      * @return System-wide error code
       
   181      */
       
   182     IMPORT_C TInt SetParentalControl( const TUint32 aParentalControl );
       
   183 
       
   184     /**
       
   185      * Sets the last watched item's launch parameters. This can be command
       
   186      * line, TPckg<?Datatype?>, or anything that the launched application
       
   187      * takes as start / activation parameter.
       
   188      * Max length = KIptvLastWatchedStartparamMaxLength = 16k
       
   189      * @since S60 v3.1
       
   190      * @param aParameters item's launch parameters
       
   191      * @return System-wide error code
       
   192      */
       
   193     IMPORT_C TInt SetParametersL( const TDesC8& aParameters );
       
   194 
       
   195     /**
       
   196      * Sets the last watched item's launched application's Uid.
       
   197      * Needed only if item's launch type is EApplication.
       
   198      * @since S60 v3.1
       
   199      * @param aAppUid launched application's Uid
       
   200      * @return System-wide error code
       
   201      */
       
   202     IMPORT_C void SetAppUid( const TUid& aAppUid );
       
   203 
       
   204     /**
       
   205      * Sets the last watched item's launched application view's Uid.
       
   206      * @since S60 v3.1
       
   207      * @param aViewUid activated window server view's uid.
       
   208      * @return System-wide error code
       
   209      */
       
   210     IMPORT_C void SetViewUid( const TUid& aViewUid );
       
   211 
       
   212     /**
       
   213      * Sets the last watched item's parameter uid.
       
   214      * @since S60 v3.1
       
   215      * @param aParameterId
       
   216      * @return System-wide error code
       
   217      */
       
   218     IMPORT_C void SetParameterId( const TUid& aParameterId );
       
   219 
       
   220     /**
       
   221      * Sets the last watched item's launch type, see TLaunchType enum.
       
   222      * Type of launching of the last watched item. Launcing can be handled
       
   223      * by activating VideoCenter's local view, send mssage to self or some
       
   224      * other application, or launch any application with any given parameters.
       
   225      *
       
   226      * @since S60 v3.1
       
   227      * @param aLaunchType last watched item's launch type
       
   228      * @return System-wide error code
       
   229      */
       
   230     IMPORT_C void SetLaunchType( TLaunchType aLaunchType );
       
   231 
       
   232     /**
       
   233      * Gets the last watched item's name
       
   234      * Max length = KIptvMyVideosVideoNameMaxLength = 100
       
   235      * @since S60 v3.1
       
   236      * @return aName item's name
       
   237      */
       
   238     IMPORT_C const TDesC& Name() const;
       
   239 
       
   240     /**
       
   241      * Gets the last watched item's URI
       
   242      * Max length = KIptvLastWatchedUriMaxLength = 2048
       
   243      * @since S60 v3.1
       
   244      * @return aUri item's uri
       
   245      */
       
   246     IMPORT_C const TDesC& Uri() const;
       
   247 
       
   248     /**
       
   249      * Gets the last watched item's icon path
       
   250      * Max length = KIptvMaxPath = 255
       
   251      * @since S60 v3.1
       
   252      * @return aIconPath item's icon path
       
   253      */
       
   254     IMPORT_C const TDesC& IconPath() const;
       
   255 
       
   256     /**
       
   257      * Gets the last watched item's mime type
       
   258      * Max length = KIptvMyVideosVideoMaxMimeTypeLength
       
   259      * @since S60 v3.2
       
   260      * @return aIconPath item's mine type
       
   261      */
       
   262     IMPORT_C const TDesC& MimeType() const;
       
   263 
       
   264     /**
       
   265      * Gets the last watched item's service id
       
   266      * @since S60 v3.2
       
   267      * @return item's service id
       
   268      */
       
   269     IMPORT_C TInt32 ServiceId() const;
       
   270 
       
   271     /**
       
   272      * Gets the last watched item's content id
       
   273      * @since S60 v3.2
       
   274      * @return item's content id
       
   275      */
       
   276     IMPORT_C TIptvContentId ContentId() const;
       
   277 
       
   278     /**
       
   279      * Gets the last watched item's content index
       
   280      * @since S60 v3.2
       
   281      * @return item's content index
       
   282      */
       
   283     IMPORT_C TInt32 ContentIndex() const;
       
   284 
       
   285     /**
       
   286      * Gets the last watched item's last play point
       
   287      * @since S60 v3.2
       
   288      * @return item's last play point
       
   289      */
       
   290     IMPORT_C TUint32 LastVideoPlayPoint() const;
       
   291 
       
   292     /**
       
   293      * Gets the last watched item's parental control limit
       
   294      * @since S60 v3.2
       
   295      * @return item's parental control limit.
       
   296      */
       
   297     IMPORT_C TUint32 ParentalControl() const;
       
   298 
       
   299     /**
       
   300      * Gets the last watched item's launch parameters. This can be command
       
   301      * line, TPckg<?Datatype?>, or anything that the launched application
       
   302      * takes as start / activation parameter.
       
   303      * Max length = KIptvLastWatchedStartparamMaxLength = 16k
       
   304      * @since S60 v3.1
       
   305      * @return item's launch parameters
       
   306      */
       
   307     IMPORT_C const TDesC8& Parameters() const;
       
   308 
       
   309     /**
       
   310      * Gets the last watched item's launched application's Uid.
       
   311      * Needed only if item's launch type is EApplication.
       
   312      * @since S60 v3.1
       
   313      * @return launched application's Uid
       
   314      */
       
   315     IMPORT_C TUid AppUid() const;
       
   316 
       
   317     /**
       
   318      * Gets the last watched item's launched application view's Uid.
       
   319      * @since S60 v3.1
       
   320      * @return activated window server view's uid.
       
   321      */
       
   322     IMPORT_C TUid ViewUid() const;
       
   323 
       
   324     /**
       
   325      * Gets the last watched item's parameter uid.
       
   326      * @since S60 v3.1
       
   327      * @return parameter id
       
   328      */
       
   329     IMPORT_C TUid ParameterId() const;
       
   330 
       
   331     /**
       
   332      * Sets the last watched item's launch type, see TLaunchType enum.
       
   333      * Type of launching of the last watched item. Launching can be handled
       
   334      * by activating VideoCenter's local view, send mssage to self or some
       
   335      * other application, or launch any application with any given parameters.
       
   336      *
       
   337      * @since S60 v3.1
       
   338      * @return last watched item's launch type
       
   339      */
       
   340     IMPORT_C TLaunchType LaunchType() const;
       
   341 
       
   342     /**
       
   343      * Counts size of the externalize result. User can call this to find out
       
   344      * how much data will be received from ExternalizeL.
       
   345      * @return Size in 8-bit bytes
       
   346      */
       
   347     IMPORT_C TUint32 CountExternalizeSize() const;
       
   348 
       
   349     /**
       
   350      * Gets the last watched item's content type.
       
   351      * 
       
   352      * @since S60 v5.0
       
   353      * @param aContentType Item's content type.
       
   354      * @return System-wide error code.
       
   355      */
       
   356     IMPORT_C TInt SetContentType( const TInt aContentType );    
       
   357     
       
   358     /**
       
   359      * Gets the last watched item's content type.
       
   360      * 
       
   361      * @since S60 v5.0
       
   362      * @return Item's content type.
       
   363      */
       
   364     IMPORT_C TInt ContentType() const;    
       
   365 
       
   366     /**
       
   367      * Gets the last watched item's mpx id.
       
   368      * 
       
   369      * @since S60 v5.0
       
   370      * @param aMpxId Item's mpx id.
       
   371      * @return System-wide error code.
       
   372      */
       
   373     IMPORT_C TInt SetMpxId( const TInt aMpxId );    
       
   374     
       
   375     /**
       
   376      * Gets the last watched item's mpx id.
       
   377      * 
       
   378      * @since S60 v5.0
       
   379      * @return Item's mpx id.
       
   380      */
       
   381     IMPORT_C TInt MpxId() const; 
       
   382     
       
   383 private:
       
   384 
       
   385     CIptvLastWatchedData();
       
   386 
       
   387 private: // Data
       
   388 
       
   389     /**
       
   390      * Name that is displayed in UI for the last watched item.
       
   391      * Own.
       
   392      */
       
   393     HBufC* iName;
       
   394 
       
   395     /**
       
   396      * Uri that identifies the last watched item.
       
   397      * Own.
       
   398      */
       
   399     HBufC* iUri;
       
   400 
       
   401     /**
       
   402      * Icon's path that is shown to user for the last watched item.
       
   403      * Own.
       
   404      */
       
   405     HBufC* iIconPath;
       
   406 
       
   407     /**
       
   408      * Mime type for the last watched item.
       
   409      * Own.
       
   410      */
       
   411     HBufC* iMimeType;
       
   412 
       
   413     /**
       
   414      * Service where from this video was started.
       
   415      */
       
   416     TInt32 iServiceId;
       
   417 
       
   418     /**
       
   419      * Content id of started video.
       
   420      */
       
   421     TIptvContentId iContentId;
       
   422 
       
   423     /**
       
   424      * Content index of started video to specify correct url.
       
   425      */
       
   426     TUint32 iContentIndex;
       
   427 
       
   428     /**
       
   429      * Position where play was stopped when finnished watching the clip.
       
   430      */
       
   431     TUint32 iLastVideoPlayPoint;
       
   432 
       
   433     /**
       
   434      * Parental control age limit for this video.
       
   435      */
       
   436     TUint32 iParentalControl;
       
   437 
       
   438     /**
       
   439      * Launch parameter descriptor for launching the last watched item's
       
   440      * associated application.
       
   441      * Own.
       
   442      */
       
   443     HBufC8* iParameters;
       
   444 
       
   445     /**
       
   446      * Last watched item's associated application's Uid.
       
   447      */
       
   448     TUid iAppUid;
       
   449 
       
   450     /**
       
   451      * Last watched item's associated view server view's Uid.
       
   452      */
       
   453     TUid iViewUid;
       
   454 
       
   455     /**
       
   456      * Launch parameter id of the last watched item's associated application.
       
   457      */
       
   458     TUid iParameterId;
       
   459 
       
   460     /**
       
   461      * Last watched item's launch type, see TLaunchType enum. Launching can
       
   462      * be handled by activating VideoCenter's local view, send mssage to self
       
   463      * or some other application, or launch any application with any given
       
   464      * parameters.
       
   465      */
       
   466     TLaunchType iLaunchType;
       
   467     
       
   468     /**
       
   469      * Content type when last watched is storing either stream or local clip.
       
   470      * Same values are used as in Via Player Default View's iContentType.
       
   471      */
       
   472     TInt iContentType;
       
   473     
       
   474     /**
       
   475      * iMpxId.
       
   476      */
       
   477     TInt iMpxId;
       
   478     
       
   479     };
       
   480 
       
   481 #endif // C_IPTVLASTWATCHEDDATA_H