ncdengine/provider/protocol/src/ncd_pp_entitydependencyimpl.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     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 "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:   CNcdPreminetProtocolEntityDependencyImpl implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32base.h>
       
    20 #include "ncd_pp_entitydependencyimpl.h"
       
    21 #include "ncd_pp_download.h"
       
    22 #include "ncdprotocoltypes.h"
       
    23 #include "ncdprotocolutils.h"
       
    24 
       
    25 CNcdPreminetProtocolEntityDependencyImpl* 
       
    26 CNcdPreminetProtocolEntityDependencyImpl::NewL() 
       
    27     {
       
    28     CNcdPreminetProtocolEntityDependencyImpl* self =
       
    29         new (ELeave) CNcdPreminetProtocolEntityDependencyImpl;
       
    30     CleanupStack::PushL( self );
       
    31     self->ConstructL();
       
    32     CleanupStack::Pop( self );
       
    33     return self;
       
    34     }
       
    35     
       
    36 CNcdPreminetProtocolEntityDependencyImpl* 
       
    37 CNcdPreminetProtocolEntityDependencyImpl::NewLC() 
       
    38     {
       
    39     CNcdPreminetProtocolEntityDependencyImpl* self =
       
    40         new (ELeave) CNcdPreminetProtocolEntityDependencyImpl;
       
    41     CleanupStack::PushL( self );
       
    42     self->ConstructL();
       
    43     return self;
       
    44     }
       
    45 
       
    46 CNcdPreminetProtocolEntityDependencyImpl::~CNcdPreminetProtocolEntityDependencyImpl()
       
    47     {
       
    48     delete iName;
       
    49     delete iTimestamp;
       
    50     delete iContentId;
       
    51     delete iContentVersion;
       
    52     delete iEntityId;
       
    53     delete iEntityTimestamp;
       
    54     delete iDownloadDetails;
       
    55     }
       
    56     
       
    57 CNcdPreminetProtocolEntityDependencyImpl::CNcdPreminetProtocolEntityDependencyImpl()
       
    58 : CBase(), iType(EDependency)
       
    59     {
       
    60     }
       
    61     
       
    62 void CNcdPreminetProtocolEntityDependencyImpl::ConstructL()
       
    63     {
       
    64     NcdProtocolUtils::AssignEmptyDesL( iName );
       
    65     NcdProtocolUtils::AssignEmptyDesL( iTimestamp );
       
    66     NcdProtocolUtils::AssignEmptyDesL( iContentId );
       
    67     NcdProtocolUtils::AssignEmptyDesL( iContentVersion );
       
    68     NcdProtocolUtils::AssignEmptyDesL( iEntityId );
       
    69     NcdProtocolUtils::AssignEmptyDesL( iEntityTimestamp );
       
    70     }
       
    71 
       
    72 /**
       
    73  * Returns the last modified date for this entity.
       
    74  * @return Last modified time, or KNullDesC if never modified.
       
    75  */
       
    76 const TDesC& 
       
    77 CNcdPreminetProtocolEntityDependencyImpl::Name() const 
       
    78     {
       
    79     DASSERT((iName));
       
    80     return *iName;
       
    81     }
       
    82 
       
    83 /**
       
    84  * Returns the size of this content.
       
    85  * @return Type
       
    86  */
       
    87 TNcdDependencyType 
       
    88 CNcdPreminetProtocolEntityDependencyImpl::Type() const
       
    89     {
       
    90     return iType;
       
    91     }
       
    92 
       
    93 /**
       
    94  * Returns the ID of this entity.
       
    95  * @return Id or KNullDesC
       
    96  */
       
    97 const TDesC& 
       
    98 CNcdPreminetProtocolEntityDependencyImpl::ContentId() const
       
    99     {
       
   100     DASSERT((iContentId));
       
   101     return *iContentId;
       
   102     }
       
   103 
       
   104 /**
       
   105  * Retuns the version of this entity.
       
   106  * @return Version or KNullDesC
       
   107  */
       
   108 const TDesC& 
       
   109 CNcdPreminetProtocolEntityDependencyImpl::ContentVersion() const
       
   110     {
       
   111     DASSERT((iContentVersion));
       
   112     return *iContentVersion;
       
   113     }
       
   114 
       
   115 /**
       
   116  * Returns the ID of this entity.
       
   117  * @return Id or KNullDesC
       
   118  */
       
   119 const TDesC& 
       
   120 CNcdPreminetProtocolEntityDependencyImpl::EntityId() const
       
   121     {
       
   122     DASSERT((iEntityId));
       
   123     return *iEntityId;
       
   124     }
       
   125 
       
   126 /**
       
   127  * Retuns the version of this entity.
       
   128  * @return Version or KNullDesC
       
   129  */
       
   130 const TDesC& 
       
   131 CNcdPreminetProtocolEntityDependencyImpl::EntityTimestamp() const
       
   132     {
       
   133     DASSERT((iEntityTimestamp));
       
   134     return *iEntityTimestamp;
       
   135     }
       
   136 
       
   137 /**
       
   138  * Returns the ID of this entity.
       
   139  * @return Id or KNullDesC
       
   140  */
       
   141 const MNcdPreminetProtocolDownload* 
       
   142 CNcdPreminetProtocolEntityDependencyImpl::DownloadDetails() const
       
   143     {
       
   144     return iDownloadDetails;
       
   145     }