camappengine/Engine/Inc/CaeQualityLevels.h
branchRCL_3
changeset 34 27fe719c32e6
parent 0 9b3e960ffc8a
equal deleted inserted replaced
33:e3cdd00b5ae3 34:27fe719c32e6
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Camera Application Engine imaging quality level and container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CAEQUALITYLEVELS_H
       
    21 #define CAEQUALITYLEVELS_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <ecam.h>
       
    25 #include <e32base.h>
       
    26 #include <e32std.h>
       
    27 
       
    28 // CONSTANTS
       
    29 const TInt KCaeDefaultQltyLevelCount = 3;
       
    30 const TInt KCaeMaxSdKeyLength = 10;
       
    31 const TInt KCaeMaxQltyLevelStringLength = 256;
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CQualityLevel;
       
    35 class RSharedDataClient;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 * Camera Application Engine image/video quality levels container.
       
    41 *
       
    42 */
       
    43 NONSHARABLE_CLASS( CCaeQualityLevelsCont ) : public CBase
       
    44     {
       
    45 
       
    46     public: // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CCaeQualityLevelsCont();
       
    52 
       
    53         /**
       
    54         * Two-phased constructor.
       
    55         */
       
    56         static CCaeQualityLevelsCont* NewL();
       
    57 
       
    58         /**
       
    59         * Initialize quality levels from Shared Data ini-file.
       
    60         * @since 2.1
       
    61         * @param aSdUidQltyLevels Shared Data ini-file UID
       
    62         * @return Count of quality levels initialized
       
    63         */
       
    64         TInt InitFromSdL( 
       
    65             const TUid&  aSdUidQltyLevels );
       
    66 
       
    67         /**
       
    68         * Initializes quality levels to hardcoded default values.
       
    69         * @since 2.1
       
    70         * @return Count of quality levels initialized
       
    71         */
       
    72         virtual TInt InitDefaultsL() = 0;
       
    73         
       
    74         /**
       
    75         * Gets the quality level count.
       
    76         * @since 2.1
       
    77         * @return Quality level count
       
    78         */
       
    79         virtual TInt Count() const = 0;
       
    80 
       
    81         /**
       
    82         * Get the specified quality level Shared Data key.
       
    83         * @since 2.1
       
    84         * @param aIndex Quality level index
       
    85         * @return Quality level Shared Data key
       
    86         */
       
    87         virtual const TDes& Key( 
       
    88             TInt aIndex ) const = 0;
       
    89 
       
    90     protected:
       
    91 
       
    92         /**
       
    93         * C++ constructor.
       
    94         */
       
    95         CCaeQualityLevelsCont();
       
    96 
       
    97     private: // Private methods.
       
    98 
       
    99         /**
       
   100         * Fetches namebase setting from SharedData Camera ini file.
       
   101         * @since 2.1
       
   102         * @param aSdUidQltyLevels Shared Data ini-file UID
       
   103         * @param aIndex Quality level index
       
   104         * @return void
       
   105         */
       
   106         void FetchQualityLevelL(
       
   107             RSharedDataClient& aSharedData, 
       
   108             const TUid&        aSdUidQltyLevels, 
       
   109             TInt               aIndex );
       
   110 
       
   111     private: // Private pure virtual methods.
       
   112 
       
   113         /**
       
   114         * Resizes quality level array.
       
   115         * @since 2.1
       
   116         * @param aQualityLevelCount Quality level count for the new array
       
   117         * @return void
       
   118         */
       
   119         virtual void ResizeL( 
       
   120             TInt aQualityLevelCount ) = 0;
       
   121 
       
   122         /**
       
   123         * Gets the quality level count Shared Data key.
       
   124         * @since 2.1
       
   125         * @return Quality level count Shared Data key
       
   126         */
       
   127         virtual const TDesC& QltyLevelCountSdKey() const = 0;
       
   128 
       
   129         /**
       
   130         * Creates quality level string for SharedData Camera ini file.
       
   131         * @since 2.1
       
   132         * @param aIndex Quality level index
       
   133         * @param aDefaultQualityLevel Output quality level string
       
   134         * @return void
       
   135         */
       
   136         virtual void CreateQualityLevelString( 
       
   137             TInt  aIndex, 
       
   138             TDes& aDefaultQualityLevel ) = 0;
       
   139 
       
   140         /**
       
   141         * Parses quality level string to quality level object data.
       
   142         * @since 2.1
       
   143         * @param aQualityLevelString Quality level string to parse
       
   144         * @param aIndex Quality level index
       
   145         * @return void
       
   146         */
       
   147         virtual void ParseQualityLevelFromStringL( 
       
   148             const TDesC& qualityLevelString, 
       
   149             TInt         aIndex ) = 0;
       
   150     };
       
   151 
       
   152 
       
   153 
       
   154 // CLASS DECLARATION
       
   155 
       
   156 /**
       
   157 * Camera Application Engine image/video quality level.
       
   158 *
       
   159 */
       
   160 NONSHARABLE_CLASS( CQualityLevel ) : public CBase
       
   161     {
       
   162     public:
       
   163         
       
   164         /**
       
   165         * Constructor.
       
   166         */
       
   167         CQualityLevel();
       
   168 
       
   169         /**
       
   170         * Destructor.
       
   171         */
       
   172         virtual ~CQualityLevel();
       
   173 
       
   174     public:
       
   175 
       
   176         // Shared Data ini-file key.
       
   177         TBuf<KCaeMaxSdKeyLength> iKey;
       
   178 
       
   179     };
       
   180 
       
   181 #endif // CAEQUALITYLEVELS_H