videofeeds/clientapi/src/CIptvMyVideosFolder.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 "CIptvMyVideosFolder.h"
       
    24 
       
    25 // CONSTANTS
       
    26 const TInt KTUint16SizeInBytes = 2;
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // ---------------------------------------------------------
       
    31 // CIptvMyVideosFolder::CIptvMyVideosFolder
       
    32 // ---------------------------------------------------------
       
    33 //
       
    34 CIptvMyVideosFolder::CIptvMyVideosFolder()
       
    35     {
       
    36     }
       
    37 
       
    38 // ---------------------------------------------------------
       
    39 // CIptvMyVideosFolder::ConstructL
       
    40 // ---------------------------------------------------------
       
    41 //
       
    42 void CIptvMyVideosFolder::ConstructL()
       
    43     {
       
    44     iFolderId = CIptvMyVideosGlobalFolderId::NewL();
       
    45     }
       
    46 
       
    47 // ---------------------------------------------------------
       
    48 // CIptvMyVideosFolder::NewL
       
    49 // ---------------------------------------------------------
       
    50 //
       
    51 EXPORT_C CIptvMyVideosFolder* CIptvMyVideosFolder::NewL()
       
    52     {
       
    53     CIptvMyVideosFolder* self = CIptvMyVideosFolder::NewLC();
       
    54     CleanupStack::Pop(self);
       
    55     return self;
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------
       
    59 // CIptvMyVideosFolder::NewLC
       
    60 // ---------------------------------------------------------
       
    61 //
       
    62 EXPORT_C CIptvMyVideosFolder* CIptvMyVideosFolder::NewLC()
       
    63     {
       
    64     CIptvMyVideosFolder* self = new (ELeave) CIptvMyVideosFolder();
       
    65     CleanupStack::PushL(self);
       
    66     self->ConstructL();
       
    67     return self;
       
    68     }
       
    69 
       
    70 // ---------------------------------------------------------
       
    71 // CIptvMyVideosFolder::~CIptvMyVideosFolder
       
    72 // ---------------------------------------------------------
       
    73 //
       
    74 CIptvMyVideosFolder::~CIptvMyVideosFolder()
       
    75     {
       
    76     delete iFolderId;
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------
       
    80 // CIptvMyVideosFolder::ExternalizeL
       
    81 // ---------------------------------------------------------
       
    82 //
       
    83 EXPORT_C void CIptvMyVideosFolder::ExternalizeL(RWriteStream& aStream) const
       
    84     {
       
    85     // Global folder ID identifier.
       
    86     iFolderId->ExternalizeL(aStream);
       
    87 
       
    88     // Folder name.
       
    89     CIptvUtil::WriteDesToStreamL(iName, aStream);
       
    90     }
       
    91 
       
    92 // ---------------------------------------------------------
       
    93 // CIptvMyVideosFolder::InternalizeL
       
    94 // ---------------------------------------------------------
       
    95 //
       
    96 EXPORT_C void CIptvMyVideosFolder::InternalizeL(RReadStream& aStream)
       
    97     {
       
    98     // Global folder ID identifier.
       
    99     iFolderId->InternalizeL(aStream);
       
   100 
       
   101     // Folder name.
       
   102     CIptvUtil::ReadDesFromStreamL(iName, aStream);
       
   103     }
       
   104 
       
   105 // ---------------------------------------------------------
       
   106 // CIptvMyVideosFolder::CountExternalizeSize
       
   107 // ---------------------------------------------------------
       
   108 //
       
   109 EXPORT_C TUint32 CIptvMyVideosFolder::CountExternalizeSize()
       
   110     {
       
   111     TUint32 size = 0;
       
   112     
       
   113     // Global folder ID identifier.
       
   114     size = (iFolderId->CountExternalizeSize()) + 
       
   115 
       
   116     // Folder name.
       
   117     KTUint16SizeInBytes + (iName.Length() * 2);
       
   118     
       
   119     return size;    
       
   120     }
       
   121     
       
   122 // End of file.