ncdengine/provider/protocol/src/ncd_pp_downloadimpl.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:   CNcdPreminetProtocolDownloadImpl declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "ncd_pp_downloadimpl.h"
       
    20 #include "ncd_pp_rights.h"
       
    21 #include "ncd_pp_descriptor.h"
       
    22 #include "ncd_pp_descriptorimpl.h"
       
    23 #include "ncd_cp_query.h"
       
    24 #include "ncdprotocoltypes.h"
       
    25 #include "ncdprotocolutils.h"
       
    26 
       
    27 
       
    28 CNcdPreminetProtocolDownloadImpl* 
       
    29 CNcdPreminetProtocolDownloadImpl::NewL() 
       
    30     {
       
    31     CNcdPreminetProtocolDownloadImpl* self =
       
    32         new (ELeave) CNcdPreminetProtocolDownloadImpl;
       
    33     CleanupStack::PushL( self );
       
    34     self->ConstructL();
       
    35     CleanupStack::Pop( self );
       
    36     return self;
       
    37     }
       
    38     
       
    39 CNcdPreminetProtocolDownloadImpl* 
       
    40 CNcdPreminetProtocolDownloadImpl::NewLC() 
       
    41     {
       
    42     CNcdPreminetProtocolDownloadImpl* self =
       
    43         new (ELeave) CNcdPreminetProtocolDownloadImpl;
       
    44     CleanupStack::PushL( self );
       
    45     self->ConstructL();
       
    46     return self;
       
    47     }
       
    48     
       
    49   
       
    50 void CNcdPreminetProtocolDownloadImpl::ConstructL() 
       
    51     {
       
    52     NcdProtocolUtils::AssignEmptyDesL( iUri );
       
    53     NcdProtocolUtils::AssignEmptyDesL( iMime );
       
    54     NcdProtocolUtils::AssignEmptyDesL( iInstallNotificationUri );
       
    55     NcdProtocolUtils::AssignEmptyDesL( iFingerprint );
       
    56     NcdProtocolUtils::AssignEmptyDesL( iPreviewType );
       
    57     }
       
    58     
       
    59 /**
       
    60  * Destructor
       
    61  */
       
    62 CNcdPreminetProtocolDownloadImpl::~CNcdPreminetProtocolDownloadImpl() 
       
    63     {
       
    64     delete iUri;
       
    65     delete iMime;
       
    66     delete iInstallNotificationUri;
       
    67     delete iMessage;
       
    68     delete iFingerprint;
       
    69     delete iRights;
       
    70     
       
    71     delete iDescriptor;
       
    72     delete iPreviewType;
       
    73     }
       
    74 
       
    75 CNcdPreminetProtocolDownloadImpl::CNcdPreminetProtocolDownloadImpl() 
       
    76     : CBase(),
       
    77       iDeliveryMethod( EUriDeliveryNotSet ),
       
    78       iValidityDelta( -1 ), // -1 as a default means that element not found
       
    79       iTarget( EDownloadTargetDownloadable ),
       
    80       iLaunchable( ETrue ), // default for launchable is TRUE!
       
    81       iFingerprintAlgorithm( EAlgorithmNotSet )
       
    82     {
       
    83     }
       
    84 
       
    85 /**
       
    86  * Returns the ID of this entity.
       
    87  * @return Id
       
    88  */
       
    89 const TDesC& CNcdPreminetProtocolDownloadImpl::Uri() const 
       
    90     {
       
    91     return *iUri;
       
    92     }
       
    93 
       
    94 /**
       
    95  * Returns the ID of this entity.
       
    96  * @return Id
       
    97  */
       
    98 TBool CNcdPreminetProtocolDownloadImpl::AutoDownload() const
       
    99     {
       
   100     return iAutoDownload;
       
   101     }
       
   102 
       
   103 /**
       
   104  * Returns the last modified date for this entity.
       
   105  * @return Last modified time, or 0 if never modified.
       
   106  */
       
   107 TInt CNcdPreminetProtocolDownloadImpl::DelayDelta() const
       
   108     {
       
   109     return iDelayDelta;
       
   110     }
       
   111 
       
   112 /**
       
   113  * Returns the namespace for this entity
       
   114  * @return namespace or KNullDesC 
       
   115  */
       
   116 TNcdUriDeliveryMethod 
       
   117 CNcdPreminetProtocolDownloadImpl::DeliveryMethod() const
       
   118     {
       
   119     return iDeliveryMethod;
       
   120     }
       
   121 
       
   122 /**
       
   123  * Entity name, localized.
       
   124  * @return Name, never KNullDesC
       
   125  */
       
   126 TInt CNcdPreminetProtocolDownloadImpl::ValidityDelta() const
       
   127     {
       
   128     return iValidityDelta;
       
   129     }
       
   130 
       
   131 /**
       
   132  * Retuns the description for this entity, localized.
       
   133  * @return Description or KNullDesC
       
   134  */
       
   135 TNcdDownloadTargetType 
       
   136 CNcdPreminetProtocolDownloadImpl::Target() const
       
   137     {
       
   138     return iTarget;
       
   139     }
       
   140 
       
   141 /**
       
   142  * Returns icon information for the entity.
       
   143  * @return Icon info or null if icon not available.
       
   144  */
       
   145 TInt CNcdPreminetProtocolDownloadImpl::ChunkSize() const
       
   146     {
       
   147     return iChunkSize;
       
   148     }
       
   149 
       
   150 /**
       
   151  * Returns the disclaimer for the entity.
       
   152  * @return Disclaimer text or KNullDesC if no disclaimer.
       
   153  */
       
   154 TBool CNcdPreminetProtocolDownloadImpl::Launchable() const
       
   155     {
       
   156     return iLaunchable;
       
   157     }
       
   158 
       
   159 const TDesC& CNcdPreminetProtocolDownloadImpl::Mime() const
       
   160     {
       
   161     return *iMime;
       
   162     }
       
   163     
       
   164 const TDesC& CNcdPreminetProtocolDownloadImpl::InstallNotificationUri() const
       
   165     {
       
   166     return *iInstallNotificationUri;
       
   167     }
       
   168     
       
   169 TInt CNcdPreminetProtocolDownloadImpl::Size() const
       
   170     {
       
   171     return iSize;
       
   172     }
       
   173 
       
   174 const MNcdConfigurationProtocolQuery* 
       
   175 CNcdPreminetProtocolDownloadImpl::Message() const
       
   176     {
       
   177     return iMessage;
       
   178     }
       
   179 
       
   180 const TDesC& CNcdPreminetProtocolDownloadImpl::Fingerprint() const
       
   181     {
       
   182     return *iFingerprint;
       
   183     }
       
   184 
       
   185 TNcdUriFingerprintAlgorithm
       
   186 CNcdPreminetProtocolDownloadImpl::FingerprintAlgorithm() const
       
   187     {
       
   188     return iFingerprintAlgorithm;
       
   189     }
       
   190 
       
   191 const MNcdPreminetProtocolDescriptor* 
       
   192 CNcdPreminetProtocolDownloadImpl::Descriptor() const
       
   193     {
       
   194     return iDescriptor;
       
   195     }
       
   196 
       
   197 
       
   198 TBool CNcdPreminetProtocolDownloadImpl::ReDownloadable() const 
       
   199     {
       
   200     return iReDownloadable;
       
   201     }
       
   202 
       
   203 const MNcdPreminetProtocolRights*
       
   204 CNcdPreminetProtocolDownloadImpl::Rights() const
       
   205     {
       
   206     return iRights;
       
   207     }
       
   208 
       
   209 const TDesC& CNcdPreminetProtocolDownloadImpl::PreviewType() const
       
   210     {
       
   211     return *iPreviewType;
       
   212     }