meetingrequest/mrcommon/inc/cesmrfeaturesettings.h
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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:  Utility to access MRUI feature settings repository.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CESMRFEATURESETTINGS_H
       
    19 #define CESMRFEATURESETTINGS_H
       
    20 
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 /**
       
    25  *  CESMRFeatureSettings is utility to access MRUI Features repository.
       
    26  *  Usage:
       
    27  *
       
    28  *  @code
       
    29  *   // instantiate settings
       
    30  *   CESMRFeatureSettings* setting = CESMRFeatureSettings::NewL()
       
    31  *   // query feature
       
    32  *   TBool locationFeatures = setting->FeatureSupported( EESMRUILocationFeatures );
       
    33  *   if ( locationFeatures )
       
    34  *      {
       
    35  *      // Do something feature specific
       
    36  *      }
       
    37  *   // free resources
       
    38  *   delete settings;
       
    39  *  @endcode
       
    40  *
       
    41  *  @lib esmrcommon.lib
       
    42  */
       
    43 NONSHARABLE_CLASS( CESMRFeatureSettings ) : public CBase
       
    44     {
       
    45 
       
    46 public:
       
    47 
       
    48     /**  Feature setting flags. */
       
    49     enum TFeature
       
    50         {
       
    51         /** Map and Navigation Fw support */
       
    52         EESMRUIMnFwIntegration = 0x1,
       
    53         /** Contacts support */
       
    54         EESMRUIContactsIntegration = 0x2,
       
    55         /** Landmarks application support */
       
    56         EESMRUILandmarksIntegration = 0x4,
       
    57         /** Previous locations list */
       
    58         EESMRUIPreviousLocationsList = 0x8,
       
    59         /** Any of the previous location features */
       
    60         EESMRUILocationFeatures = 0xf,
       
    61         /** Meeting request viewer only for Cmail */
       
    62         EMRUIMeetingRequestViewerCmailOnly = 0x10,
       
    63         /** Any of the prevuious features */
       
    64         EMRUIAllFeatures
       
    65         };
       
    66 
       
    67     IMPORT_C static CESMRFeatureSettings* NewL();
       
    68     IMPORT_C static CESMRFeatureSettings* NewLC();
       
    69 
       
    70     /**
       
    71     * Destructor.
       
    72     */
       
    73     virtual ~CESMRFeatureSettings();
       
    74 
       
    75     /**
       
    76      * Gets feature setting. The setting must be enumerated in
       
    77      * CESMRFeatureSettings::TFeature enumeration.
       
    78      * Multiple features can be queried at the same time by
       
    79      * bitwise-oring the corresponding feature flags.
       
    80      *
       
    81      * @param aFeatures the features.
       
    82      * @return ETrue if feature is enabled
       
    83      */
       
    84     IMPORT_C TBool FeatureSupported( TUint aFeatures ) const;
       
    85 
       
    86 private:
       
    87     CESMRFeatureSettings();
       
    88 
       
    89     void ConstructL();
       
    90     
       
    91     TInt MapFeature( TUint aFeature ) const;
       
    92 
       
    93 private: // data
       
    94 
       
    95     /**
       
    96      * Feature index array for mapping features
       
    97      */
       
    98     enum TFeatureIndex
       
    99         {
       
   100         EESMRUIMnFwIntegrationIndex = 0,
       
   101         EESMRUIContactsIntegrationIndex,
       
   102         EESMRUILandmarksIntegrationIndex,
       
   103         EESMRUIPreviousLocationsListIndex,
       
   104         EMRUIMeetingRequestViewerCmailIndex,
       
   105         // Last item. Number of features
       
   106         EESMRUINumFeatures
       
   107         };
       
   108     
       
   109     /**
       
   110      * Feature status array
       
   111      */
       
   112     TInt iFeatures[ EESMRUINumFeatures ];
       
   113 
       
   114     };
       
   115 
       
   116 #endif // CESMRFEATURESETTINGS_H