videofeeds/clientapi/src/CIptvMyVideosGlobalFolderId.cpp
branchRCL_3
changeset 23 befca0ec475f
parent 0 96612d01cf9f
equal deleted inserted replaced
22:839377eedc2b 23:befca0ec475f
       
     1 /*
       
     2 * Copyright (c) 2006 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:    Defines data class structure for the API*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32base.h>
       
    22 #include <s32strm.h>
       
    23 #include <f32file.h>
       
    24 #include "CIptvMyVideosGlobalFolderId.h"
       
    25 
       
    26 // CONSTANTS
       
    27 const TInt KTUint32SizeInBytes = 4;
       
    28 
       
    29 // ============================ MEMBER FUNCTIONS ===============================
       
    30 
       
    31 // ---------------------------------------------------------
       
    32 // CIptvMyVideosGlobalFolderId::CIptvMyVideosGlobalFolderId
       
    33 // ---------------------------------------------------------
       
    34 //
       
    35 CIptvMyVideosGlobalFolderId::CIptvMyVideosGlobalFolderId()
       
    36  :  iDrive((TDriveNumber)0),
       
    37     iFolderId(0)    
       
    38     {
       
    39     }
       
    40 
       
    41 // ---------------------------------------------------------
       
    42 // CIptvMyVideosGlobalFolderId::ConstructL
       
    43 // ---------------------------------------------------------
       
    44 //
       
    45 void CIptvMyVideosGlobalFolderId::ConstructL()
       
    46     {    
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------
       
    50 // CIptvMyVideosGlobalFolderId::NewL
       
    51 // ---------------------------------------------------------
       
    52 //
       
    53 EXPORT_C CIptvMyVideosGlobalFolderId* CIptvMyVideosGlobalFolderId::NewL()
       
    54     {
       
    55     CIptvMyVideosGlobalFolderId* self = CIptvMyVideosGlobalFolderId::NewLC();
       
    56     CleanupStack::Pop(self);
       
    57     return self;
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------
       
    61 // CIptvMyVideosGlobalFolderId::NewLC
       
    62 // ---------------------------------------------------------
       
    63 //
       
    64 EXPORT_C CIptvMyVideosGlobalFolderId* CIptvMyVideosGlobalFolderId::NewLC()
       
    65     {
       
    66     CIptvMyVideosGlobalFolderId* self = new (ELeave) CIptvMyVideosGlobalFolderId();
       
    67     CleanupStack::PushL(self);
       
    68     self->ConstructL();
       
    69     return self;
       
    70     }
       
    71 
       
    72 // ---------------------------------------------------------
       
    73 // CIptvMyVideosGlobalFolderId::NewRootFolderL
       
    74 // ---------------------------------------------------------
       
    75 //
       
    76 EXPORT_C CIptvMyVideosGlobalFolderId* CIptvMyVideosGlobalFolderId::NewRootFolderL(TInt aDrive)
       
    77     {
       
    78     if ((aDrive != -1) && ((aDrive < EDriveA) || (aDrive > EDriveZ)))
       
    79         {
       
    80         User::Leave(KErrArgument);
       
    81         }
       
    82 
       
    83     CIptvMyVideosGlobalFolderId* self = CIptvMyVideosGlobalFolderId::NewL();
       
    84     if (aDrive != -1)
       
    85         {
       
    86         self->iDrive = aDrive;
       
    87         }
       
    88     else
       
    89         {
       
    90         self->iDrive = 0;
       
    91         }
       
    92     self->iFolderId = KIptvMyVideosFolderRootId;
       
    93     return self;
       
    94     }
       
    95 
       
    96 // ---------------------------------------------------------
       
    97 // CIptvMyVideosGlobalFolderId::~CIptvMyVideosGlobalFolderId
       
    98 // ---------------------------------------------------------
       
    99 //
       
   100 CIptvMyVideosGlobalFolderId::~CIptvMyVideosGlobalFolderId()
       
   101     {    
       
   102     }
       
   103 
       
   104 // ---------------------------------------------------------
       
   105 // CIptvMyVideosGlobalFolderId::ExternalizeL
       
   106 // ---------------------------------------------------------
       
   107 //
       
   108 EXPORT_C void CIptvMyVideosGlobalFolderId::ExternalizeL(RWriteStream& aStream) const
       
   109     {
       
   110     // See TDriveNumber, EDriveC and EDriveE allowed.
       
   111     aStream.WriteInt32L(iDrive);
       
   112 
       
   113     // Drive specific folder ID identifier.
       
   114     aStream.WriteUint32L(iFolderId);
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------
       
   118 // CIptvMyVideosGlobalFolderId::InternalizeL
       
   119 // ---------------------------------------------------------
       
   120 //
       
   121 EXPORT_C void CIptvMyVideosGlobalFolderId::InternalizeL(RReadStream& aStream)
       
   122     {
       
   123     // See TDriveNumber, EDriveC and EDriveE allowed.
       
   124     iDrive = aStream.ReadInt32L();
       
   125    
       
   126     // Drive specific folder ID identifier.
       
   127     iFolderId = aStream.ReadUint32L();
       
   128     }
       
   129 
       
   130 // ---------------------------------------------------------
       
   131 // CIptvMyVideosGlobalFolderId::CountExternalizeSize
       
   132 // ---------------------------------------------------------
       
   133 //
       
   134 EXPORT_C TUint32 CIptvMyVideosGlobalFolderId::CountExternalizeSize()
       
   135     {
       
   136     TUint32 size = 0;
       
   137 
       
   138     // See TDriveNumber, EDriveC and EDriveE allowed.
       
   139     size = KTUint32SizeInBytes +
       
   140 
       
   141     // Drive specific folder ID identifier.
       
   142     KTUint32SizeInBytes;
       
   143     
       
   144     return size;    
       
   145     }
       
   146 
       
   147 // End of file