upnpharvester/common/cmlibrary/inc/cmsqlitemresource.h
branchIOP_Improvements
changeset 40 08b5eae9f9ff
parent 39 6369bfd1b60d
child 41 b4d83ea1d6e2
equal deleted inserted replaced
39:6369bfd1b60d 40:08b5eae9f9ff
     1 /*
       
     2 * Copyright (c) 2006-2007 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:      Capsulating sql items
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #ifndef __CMSQLITEMRESOURCE_H
       
    24 #define __CMSQLITEMRESOURCE_H
       
    25 
       
    26 // INCLUDES
       
    27 #include <e32base.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 /**
       
    32  *  CCmSqlItemResource class
       
    33  *  Capsulating sql items
       
    34  *  @lib cmcommon.lib
       
    35  *  @since S60 v3.0
       
    36  */
       
    37 NONSHARABLE_CLASS( CCmSqlItemResource ) : public CBase
       
    38     {
       
    39 
       
    40 public:
       
    41 
       
    42     /* Constructors and destructor. */
       
    43 
       
    44     /**
       
    45      * Creates new CCmSqlItemResource class.
       
    46      * @param None
       
    47      * @return  pointer to CCmSqlItemResource class
       
    48      */
       
    49     static CCmSqlItemResource* NewL();
       
    50     
       
    51     /**
       
    52      * Creates new CCmSqlItemResource class and 
       
    53      * leaves the instance in the cleanup stack.
       
    54      * @return  pointer to CCmSqlItemResource class
       
    55      */
       
    56     static CCmSqlItemResource* NewLC();
       
    57 
       
    58     /**
       
    59      * Creates new CCmSqlItemResource class and 
       
    60      * leaves the instance in the cleanup stack.
       
    61      * @param aUri
       
    62      * @param aSize
       
    63      * @param aDuration
       
    64      * @param aBitrate
       
    65      * @param aResolutionId
       
    66      * @return pointer to CCmSqlItemResource class
       
    67      */
       
    68     static CCmSqlItemResource* NewLC( const TDesC8& aUri, 
       
    69     const TInt aSize, const TInt aDuration, const TInt aBitrate,
       
    70     const TInt64 aResolutionId );
       
    71         
       
    72     /**
       
    73      * Destructor.
       
    74      */
       
    75     virtual ~CCmSqlItemResource();
       
    76 
       
    77 public:
       
    78 
       
    79     /**
       
    80     * Sets uri of the resource
       
    81     * @since Series 60 3.1
       
    82     * @param aUri, resource uri
       
    83     * @return None
       
    84     */ 
       
    85     void SetUriL( const TDesC8& aUri );
       
    86     
       
    87     /**
       
    88     * Sets size of resource
       
    89     * @since Series 60 3.1
       
    90     * @param aSize, size of the resource
       
    91     * @return None
       
    92     */     
       
    93     void SetSize( const TInt aSize );
       
    94     
       
    95     /**
       
    96     * Sets duration of resource
       
    97     * @since Series 60 3.1
       
    98     * @param aDuration, duration of the resource
       
    99     * @return None
       
   100     */     
       
   101     void SetDuration( const TInt aDuration );
       
   102     
       
   103     /**
       
   104     * Sets bitrate of resource
       
   105     * @since Series 60 3.1
       
   106     * @param aBitrate, bitrate of the resource
       
   107     * @return None
       
   108     */     
       
   109     void SetBitrate( const TInt aBitrate );
       
   110     
       
   111     /**
       
   112     * Sets resolution id of resource
       
   113     * @since Series 60 3.1
       
   114     * @param aResolutionId, id of resolution
       
   115     * @return None
       
   116     */     
       
   117     void SetResolutionId( const TInt64 aResolutionId );    
       
   118     
       
   119     /**
       
   120     * Gets Uri
       
   121     * @since Series 60 3.1
       
   122     * @param None
       
   123     * @return iUri
       
   124     */     
       
   125     TDesC8& Uri() const;
       
   126     
       
   127     /**
       
   128     * Gets size 
       
   129     * @since Series 60 3.1
       
   130     * @param None
       
   131     * @return iSize
       
   132     */     
       
   133     TInt Size() const;
       
   134     
       
   135     /**
       
   136     * Gets duration
       
   137     * @since Series 60 3.1
       
   138     * @param None
       
   139     * @return iDuration
       
   140     */     
       
   141     TInt Duration() const;
       
   142     
       
   143     /**
       
   144     * Gets bitrate
       
   145     * @since Series 60 3.1
       
   146     * @param None
       
   147     * @return iBitrate
       
   148     */ 
       
   149     TInt Bitrate() const;
       
   150     
       
   151     /**
       
   152     * Gets resolution id
       
   153     * @since Series 60 3.1
       
   154     * @param None
       
   155     * @return iResolutionId
       
   156     */ 
       
   157     TInt ResolutionId() const;    
       
   158     
       
   159 protected:
       
   160 
       
   161     /**
       
   162      * Constructor.
       
   163      */
       
   164     CCmSqlItemResource();
       
   165 
       
   166     /**
       
   167      * Second-phase constructor.
       
   168      */
       
   169     void ConstructL();
       
   170 
       
   171     /**
       
   172      * Second-phase constructor.
       
   173      */
       
   174     void ConstructL( const TDesC8& aUri, 
       
   175         const TInt aSize, const TInt aDuration, const TInt aBitrate,
       
   176         const TInt64 aResolutionId );    
       
   177 
       
   178 protected: // data  
       
   179     
       
   180     // Name
       
   181     HBufC8* iUri; // owned
       
   182     
       
   183     // Size of the resource
       
   184     TInt iSize;
       
   185 
       
   186     // Duration of the resource
       
   187     TInt iDuration;
       
   188         
       
   189     // Bitrate of the resource
       
   190     TInt iBitrate;
       
   191      
       
   192     // Id to resolution
       
   193     TInt64 iResolutionId;
       
   194     
       
   195     };
       
   196 
       
   197 #endif //  __CMSQLITEMRESOURCE_H