featuremgmt/featuremgr/inc/featurecmn.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @publishedPartner
       
    24  @released
       
    25 */
       
    26 
       
    27 #ifndef FEATURECMN_H
       
    28 #define FEATURECMN_H
       
    29 
       
    30 #include <e32cmn.h>
       
    31 #include <babitflags.h>
       
    32 
       
    33 const TInt KFeatureUnsupported( 0 );
       
    34 const TInt KFeatureSupported( 1 );
       
    35 
       
    36 /** An enumeration for accessing feature status flags.
       
    37  @see TBitFlagsT
       
    38 */
       
    39 enum TFeatureFlags
       
    40     {
       
    41     /** If set, feature is supported and available for use;
       
    42      if not, feature is not supported.
       
    43     */
       
    44     EFeatureSupported      = 0,
       
    45     /** If set, feature is upgradeable. The feature is known to the device
       
    46      but it must be upgraded to enable it. If a feature s blacklisted,
       
    47      its upgradeable flag is unset.
       
    48     */
       
    49     EFeatureUpgradeable    = 1,
       
    50     /** If set, the feature is modifiable and may be enabled/disabled
       
    51      at run-time. The initial flag values for such a feature flag are
       
    52      defined in a ROM image obey file.
       
    53     */
       
    54     EFeatureModifiable     = 2,
       
    55     /** If set, the feature has been blacklisted, and may not be changed at
       
    56      run-time. This also prevents a feature from being upgraded.
       
    57     */
       
    58     EFeatureBlackListed    = 3,
       
    59     /** If set, this flag Supported state is unknown at build-time and is
       
    60      initialised at run-time by system software. The Feature Manager will
       
    61      ignore the Supported flag in the file. A run-time call to RFeatureControl
       
    62      will be needed to set the feature's supported flag. Look ups of
       
    63      uninitialised features result in a KErrNotReady error code.
       
    64     */
       
    65     EFeatureUninitialized  = 4,
       
    66     /** If set, this flag is saved to the system drive when modified
       
    67      preserving its value across reboots/power downs.
       
    68     */
       
    69     EFeaturePersisted      = 5,
       
    70 
       
    71     // Bits 6..23 Reserved for Symbian to define for future use, always zero.
       
    72 
       
    73     // High byte bits are undefined, reserved for internal use
       
    74     EFeatureReserved24     = 24,
       
    75     EFeatureReserved25     = 25,
       
    76     EFeatureReserved26     = 26,
       
    77     EFeatureReserved27     = 27,
       
    78     EFeatureReserved28     = 28,
       
    79     EFeatureReserved29     = 29,
       
    80     EFeatureReserved30     = 30,
       
    81     EFeatureReserved31     = 31
       
    82 
       
    83     };
       
    84 
       
    85 /** An enumeration for checking feature change type.
       
    86 */
       
    87 enum TFeatureChangeType
       
    88     {
       
    89     /** Feature status not changed.
       
    90     */
       
    91     EFeatureNoChange            = 0,
       
    92     /** Feature status changed to enabled or disabled.
       
    93     */
       
    94     EFeatureStatusUpdated       = 1,
       
    95     /** Feature data changed.
       
    96     */
       
    97     EFeatureDataUpdated         = 2,
       
    98     /** Feature status and data changed.
       
    99     */
       
   100     EFeatureStatusDataUpdated   = 3,
       
   101     /** Not used, future: complex change occurred, reload all features.
       
   102     */
       
   103     EFeatureRediscover          = 4,
       
   104     /** Not used, future: new feature has been added to system.
       
   105     */
       
   106     EFeatureFeatureCreated      = 5,
       
   107     /** Feature has been deleted.
       
   108     */
       
   109     EFeatureFeatureDeleted      = 6
       
   110     };
       
   111 
       
   112 /**
       
   113  Feature entry class.
       
   114  Used by Feature Manager and its clients.
       
   115 
       
   116 */
       
   117 
       
   118 class TFeatureEntry
       
   119     {
       
   120     public:
       
   121 
       
   122         /**
       
   123          Default constructor.
       
   124          Needed by clients using the method
       
   125          FeatureSupported( TFeatureEntry& aFeature ) of Feature Control API.
       
   126 
       
   127          @param aFeature Feature UID.
       
   128         */
       
   129         IMPORT_C TFeatureEntry( TUid aFeature );
       
   130 
       
   131         /**
       
   132          Default constructor.
       
   133          Needed by clients using the method
       
   134          AddFeature( TFeatureEntry& aFeature ) of Feature Control API.
       
   135 
       
   136          @param aFeature Feature UID.
       
   137          @param aFlags Feature status flags.
       
   138          @param aData Feature data.
       
   139         */
       
   140         IMPORT_C TFeatureEntry( TUid aFeature, TBitFlags32 aFlags, TUint32 aData );
       
   141 
       
   142         /**
       
   143          Returns feature UID.
       
   144         */
       
   145         IMPORT_C TUid FeatureUid() const;
       
   146 
       
   147         /**
       
   148          Returns feature status flags.
       
   149         */
       
   150         IMPORT_C TBitFlags32 FeatureFlags() const;
       
   151 
       
   152         /**
       
   153          Returns feature data.
       
   154         */
       
   155         IMPORT_C TUint32 FeatureData() const;
       
   156 
       
   157     public:
       
   158         /**
       
   159          Default constructor.
       
   160          Used by Feature Manager.
       
   161         */
       
   162         IMPORT_C TFeatureEntry();
       
   163 
       
   164     private:
       
   165 
       
   166         /** UID of the feature. */
       
   167         TUid iFeatureID;
       
   168         /**
       
   169          Value of the feature status flags.
       
   170          @see TFeatureFlags
       
   171         */
       
   172         TBitFlags32 iFlags;
       
   173         /** Data associated with feature. */
       
   174         TUint32 iData;
       
   175         /**
       
   176 	     Reserved for future use.
       
   177 	     Initialised to 0 on construction.
       
   178 	    */
       
   179         TUint32 iReserved;
       
   180     };
       
   181 
       
   182 
       
   183 /**
       
   184  Defines the feature UID array.
       
   185 */
       
   186 typedef RArray<TUid> RFeatureUidArray;
       
   187 
       
   188 /**
       
   189  Defines  the feature entry array.
       
   190 */
       
   191 typedef RArray<TFeatureEntry> RFeatureArray;
       
   192 
       
   193 #endif  // FEATURECMN_H
       
   194 
       
   195 // End of File