ncdengine/inc/ncdpurchasedownloadinfo.h
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:   Definition of MNcdPurchaseDownloadInfo interface and
       
    15 *                implementation class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef M_NCDPURCHASEDOWNLOADINFO_H
       
    21 #define M_NCDPURCHASEDOWNLOADINFO_H
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 
       
    26 class RWriteStream;
       
    27 class RReadStream;
       
    28 
       
    29 
       
    30 /**
       
    31  *  Interface for purchase download information.
       
    32  *
       
    33  *  
       
    34  */
       
    35 class MNcdPurchaseDownloadInfo
       
    36     {
       
    37 public:
       
    38 
       
    39     /**
       
    40      * Type of the content.
       
    41      *
       
    42      * 
       
    43      */
       
    44     enum TContentUsage
       
    45         {
       
    46         /** Content is downloadable. */
       
    47         EDownloadable = 0,
       
    48 
       
    49         /** Content is consumable. */
       
    50         EConsumable,
       
    51  
       
    52         /** Content is dependency. */
       
    53         EDependency,
       
    54  
       
    55         /** Content is upgrade. */
       
    56         EUpgrade,
       
    57         
       
    58         /** Content is launcher application */         
       
    59         ELauncher,
       
    60         
       
    61         /** Content is launcher application that opens a content file */
       
    62         ELauncherOpen
       
    63  
       
    64         };
       
    65 
       
    66 
       
    67     /**
       
    68      * Additional attributes
       
    69      *
       
    70      * These are retrieved with AttributeStringL and AttributeInt32L
       
    71      *
       
    72      * Adding new attributes does not cause a binary break but removing
       
    73      * does
       
    74      *
       
    75      * 
       
    76      */
       
    77     enum TDownloadAttribute
       
    78         {
       
    79         /**
       
    80          * Dependency name may be set for dependency and launcher content
       
    81          * Type: String
       
    82          */
       
    83         EDownloadAttributeDependencyName = 0,
       
    84         
       
    85         /**
       
    86          * If non-zero or not set, this download is required, 
       
    87          * otherwise it can be skipped
       
    88          *
       
    89          * Type: TInt32
       
    90          */
       
    91         EDownloadAttributeRequiredDownload,
       
    92         
       
    93         /**
       
    94          * Internal attribute value, DO NOT USE
       
    95          *
       
    96          * @note Add new attributes before this
       
    97          */
       
    98         EDownloadAttributeInternal
       
    99         };
       
   100         
       
   101     /**
       
   102      * Gets the content usage type.
       
   103      * 
       
   104      * 
       
   105      * @return Content usage.
       
   106      */
       
   107     virtual TContentUsage ContentUsage() const = 0;
       
   108 
       
   109     /**
       
   110      * Gets the content URI.
       
   111      * 
       
   112      * 
       
   113      * @return Content URI.
       
   114      */
       
   115     virtual const TDesC& ContentUri() const = 0;
       
   116 
       
   117     /**
       
   118      * Gets the content validity delta. This is in
       
   119      * minutes.
       
   120      * 
       
   121      * 
       
   122      * @return Content validity delta. -1 if not set.
       
   123      */
       
   124     virtual TInt ContentValidityDelta() const = 0;
       
   125 
       
   126     /**
       
   127      * Gets the content mime type.
       
   128      * 
       
   129      * 
       
   130      * @return Content mime type.
       
   131      */
       
   132     virtual const TDesC& ContentMimeType() const = 0;
       
   133 
       
   134     /**
       
   135      * Gets the content size.
       
   136      * 
       
   137      * 
       
   138      * @return Content size.
       
   139      */
       
   140     virtual TInt ContentSize() const = 0;
       
   141 
       
   142     /**
       
   143      * Is content launchable.
       
   144      * 
       
   145      * 
       
   146      * @return Launchable status.
       
   147      */
       
   148     virtual TBool IsLaunchable() const = 0;
       
   149 
       
   150     /**
       
   151      * Gets the descriptor type.
       
   152      * 
       
   153      * 
       
   154      * @return Descriptor type.
       
   155      */
       
   156     virtual const TDesC& DescriptorType() const = 0;
       
   157 
       
   158     /**
       
   159      * Gets the descriptor name.
       
   160      * 
       
   161      * 
       
   162      * @return Descriptor name.
       
   163      */
       
   164     virtual const TDesC& DescriptorName() const = 0;
       
   165 
       
   166     /**
       
   167      * Gets the descriptor URI.
       
   168      * 
       
   169      * 
       
   170      * @return Descriptor URI.
       
   171      */
       
   172     virtual const TDesC& DescriptorUri() const = 0;
       
   173 
       
   174     /**
       
   175      * Gets the descriptor data.
       
   176      * 
       
   177      * 
       
   178      * @return Descriptor data.
       
   179      */
       
   180     virtual const TDesC8& DescriptorData() const = 0;
       
   181 
       
   182     /**
       
   183      * Gets the rights URI.
       
   184      * 
       
   185      * 
       
   186      * @return Rights URI.
       
   187      */
       
   188     virtual const TDesC& RightsUri() const = 0;
       
   189 
       
   190     /**
       
   191      * Gets the rights type.
       
   192      * 
       
   193      * 
       
   194      * @return Rights type.
       
   195      */
       
   196     virtual const TDesC& RightsType() const = 0;
       
   197     
       
   198     /**
       
   199      * Gets the activation key.
       
   200      *
       
   201      * 
       
   202      * @return Activation key.
       
   203      */
       
   204     virtual const TDesC& ActivationKey() const = 0;
       
   205     
       
   206     /**
       
   207      * Gets the install notification URI.
       
   208      *
       
   209      * 
       
   210      * @return Install notification URI.
       
   211      */
       
   212     virtual const TDesC& InstallNotificationUri() const = 0;
       
   213     
       
   214     
       
   215     /**
       
   216      * String attribute getter
       
   217      *
       
   218      * @param aAttribute Attribute
       
   219      * @return Parameter string
       
   220      * @leave KErrNotFound if attribute is not set
       
   221      * @panic ENcdPanicIndexOutOfRange if aAttribute is invalid
       
   222      * @panic ENcdPanicInvalidArgument if the attribute type is not string
       
   223      */
       
   224     virtual const TDesC& AttributeStringL( 
       
   225         TDownloadAttribute aAttribute ) const = 0;
       
   226     
       
   227 
       
   228     /**
       
   229      * Integer attribute getter
       
   230      *
       
   231      * @param aAttribute Attribute
       
   232      * @return Parameter integer
       
   233      * @leave KErrNotFound if attribute is not set
       
   234      * @panic ENcdPanicIndexOutOfRange if aAttribute is invalid
       
   235      * @panic ENcdPanicInvalidArgument if the attribute type is not TInt32
       
   236      */
       
   237     virtual TInt32 AttributeInt32L( 
       
   238         TDownloadAttribute aAttribute ) const = 0;
       
   239     
       
   240 protected:
       
   241 
       
   242     /**
       
   243      * Destructor.
       
   244      *
       
   245      * @see MCatalogsBase::~MCatalogsBase
       
   246      */
       
   247     virtual ~MNcdPurchaseDownloadInfo() {}
       
   248 
       
   249     };
       
   250 
       
   251 
       
   252 #endif // M_NCDPURCHASEDOWNLOADINFO_H