ncdengine/provider/src/ncdpurchaseinstallinfo.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006-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 "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:   Implementation of CNcdPurchaseInstallInfo
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <s32strm.h>
       
    20 
       
    21 #include "ncdutils.h"
       
    22 #include "catalogsutils.h"
       
    23 
       
    24 EXPORT_C CNcdPurchaseInstallInfo* CNcdPurchaseInstallInfo::NewL()
       
    25     {
       
    26     CNcdPurchaseInstallInfo* self = NewLC();
       
    27     CleanupStack::Pop( self );
       
    28     return self;
       
    29     }
       
    30 
       
    31 EXPORT_C CNcdPurchaseInstallInfo* CNcdPurchaseInstallInfo::NewLC()
       
    32     {
       
    33     CNcdPurchaseInstallInfo* self =
       
    34         new (ELeave) CNcdPurchaseInstallInfo;
       
    35     CleanupStack::PushL( self );
       
    36     self->BaseConstructL();
       
    37     return self;
       
    38     }
       
    39 
       
    40 EXPORT_C CNcdPurchaseInstallInfo* CNcdPurchaseInstallInfo::NewL( 
       
    41     const MNcdPurchaseInstallInfo& aSource )
       
    42     {
       
    43     CNcdPurchaseInstallInfo* self = NewLC( aSource );
       
    44     CleanupStack::Pop( self );
       
    45     return self;
       
    46     }
       
    47 
       
    48 EXPORT_C CNcdPurchaseInstallInfo* CNcdPurchaseInstallInfo::NewLC(
       
    49     const MNcdPurchaseInstallInfo& aSource )
       
    50     {
       
    51     CNcdPurchaseInstallInfo* self =
       
    52          new (ELeave) CNcdPurchaseInstallInfo;
       
    53     CleanupStack::PushL( self );
       
    54     self->BaseConstructL( aSource );
       
    55     return self;
       
    56     }
       
    57 
       
    58 EXPORT_C CNcdPurchaseInstallInfo::~CNcdPurchaseInstallInfo()
       
    59     {
       
    60     delete iFilename;
       
    61     delete iApplicationVersion;
       
    62     delete iThemeName;
       
    63     }
       
    64 
       
    65 EXPORT_C void CNcdPurchaseInstallInfo::ExternalizeL( RWriteStream& aStream ) const
       
    66     {
       
    67     ExternalizeDesL( *iFilename, aStream );
       
    68     aStream.WriteInt32L( iApplicationUid.iUid );
       
    69     ExternalizeDesL( *iApplicationVersion, aStream );
       
    70     ExternalizeDesL( *iThemeName, aStream );
       
    71     }
       
    72 
       
    73 EXPORT_C void CNcdPurchaseInstallInfo::InternalizeL( RReadStream& aStream )
       
    74     {
       
    75     InternalizeDesL( iFilename, aStream );
       
    76     iApplicationUid = TUid::Uid( aStream.ReadInt32L() );
       
    77     InternalizeDesL( iApplicationVersion, aStream );
       
    78     InternalizeDesL( iThemeName, aStream );
       
    79     }
       
    80 
       
    81 EXPORT_C const TDesC& CNcdPurchaseInstallInfo::Filename() const
       
    82     {
       
    83     return *iFilename;
       
    84     }
       
    85     
       
    86 EXPORT_C void CNcdPurchaseInstallInfo::SetFilenameL( const TDesC& aFilename )
       
    87     {
       
    88     AssignDesL( iFilename, aFilename );
       
    89     }
       
    90     
       
    91 EXPORT_C TUid CNcdPurchaseInstallInfo::ApplicationUid() const
       
    92     {
       
    93     return iApplicationUid;
       
    94     }
       
    95     
       
    96 EXPORT_C void CNcdPurchaseInstallInfo::SetApplicationUid( 
       
    97     const TUid aApplicationUid )
       
    98     {
       
    99     iApplicationUid = aApplicationUid;
       
   100     }
       
   101 
       
   102 EXPORT_C const TDesC& CNcdPurchaseInstallInfo::ApplicationVersion() const
       
   103     {
       
   104     return *iApplicationVersion;
       
   105     }
       
   106     
       
   107 EXPORT_C void CNcdPurchaseInstallInfo::SetApplicationVersionL( 
       
   108     const TDesC& aApplicationVersion )
       
   109     {
       
   110     AssignDesL( iApplicationVersion, aApplicationVersion );
       
   111     }
       
   112     
       
   113 EXPORT_C const TDesC& CNcdPurchaseInstallInfo::ThemeName() const
       
   114     {
       
   115     return *iThemeName;
       
   116     }
       
   117     
       
   118 EXPORT_C void CNcdPurchaseInstallInfo::SetThemeNameL( 
       
   119     const TDesC& aThemeName )
       
   120     {
       
   121     AssignDesL( iThemeName, aThemeName );
       
   122     }
       
   123 
       
   124 EXPORT_C void CNcdPurchaseInstallInfo::BaseConstructL()
       
   125     {
       
   126     iFilename = KNullDesC().AllocL();
       
   127     iApplicationUid = TUid::Uid( 0 );
       
   128     iApplicationVersion = KNullDesC().AllocL();
       
   129     iThemeName = KNullDesC().AllocL();
       
   130     }
       
   131 
       
   132 
       
   133 EXPORT_C void CNcdPurchaseInstallInfo::BaseConstructL(
       
   134     const MNcdPurchaseInstallInfo& aSource )
       
   135     {
       
   136     SetFilenameL( aSource.Filename() );
       
   137     SetApplicationUid( aSource.ApplicationUid() );
       
   138     SetApplicationVersionL( aSource.ApplicationVersion() );
       
   139     SetThemeNameL( aSource.ThemeName() );    
       
   140     }
       
   141 
       
   142 EXPORT_C CNcdPurchaseInstallInfo::CNcdPurchaseInstallInfo()
       
   143     {
       
   144     }