os/persistentdata/featuremgmt/featuremgr/inc/featurecmn.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/featuremgmt/featuremgr/inc/featurecmn.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,195 @@
     1.4 +/*
     1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +
    1.24 +/**
    1.25 + @file
    1.26 + @publishedPartner
    1.27 + @released
    1.28 +*/
    1.29 +
    1.30 +#ifndef FEATURECMN_H
    1.31 +#define FEATURECMN_H
    1.32 +
    1.33 +#include <e32cmn.h>
    1.34 +#include <babitflags.h>
    1.35 +
    1.36 +const TInt KFeatureUnsupported( 0 );
    1.37 +const TInt KFeatureSupported( 1 );
    1.38 +
    1.39 +/** An enumeration for accessing feature status flags.
    1.40 + @see TBitFlagsT
    1.41 +*/
    1.42 +enum TFeatureFlags
    1.43 +    {
    1.44 +    /** If set, feature is supported and available for use;
    1.45 +     if not, feature is not supported.
    1.46 +    */
    1.47 +    EFeatureSupported      = 0,
    1.48 +    /** If set, feature is upgradeable. The feature is known to the device
    1.49 +     but it must be upgraded to enable it. If a feature s blacklisted,
    1.50 +     its upgradeable flag is unset.
    1.51 +    */
    1.52 +    EFeatureUpgradeable    = 1,
    1.53 +    /** If set, the feature is modifiable and may be enabled/disabled
    1.54 +     at run-time. The initial flag values for such a feature flag are
    1.55 +     defined in a ROM image obey file.
    1.56 +    */
    1.57 +    EFeatureModifiable     = 2,
    1.58 +    /** If set, the feature has been blacklisted, and may not be changed at
    1.59 +     run-time. This also prevents a feature from being upgraded.
    1.60 +    */
    1.61 +    EFeatureBlackListed    = 3,
    1.62 +    /** If set, this flag Supported state is unknown at build-time and is
    1.63 +     initialised at run-time by system software. The Feature Manager will
    1.64 +     ignore the Supported flag in the file. A run-time call to RFeatureControl
    1.65 +     will be needed to set the feature's supported flag. Look ups of
    1.66 +     uninitialised features result in a KErrNotReady error code.
    1.67 +    */
    1.68 +    EFeatureUninitialized  = 4,
    1.69 +    /** If set, this flag is saved to the system drive when modified
    1.70 +     preserving its value across reboots/power downs.
    1.71 +    */
    1.72 +    EFeaturePersisted      = 5,
    1.73 +
    1.74 +    // Bits 6..23 Reserved for Symbian to define for future use, always zero.
    1.75 +
    1.76 +    // High byte bits are undefined, reserved for internal use
    1.77 +    EFeatureReserved24     = 24,
    1.78 +    EFeatureReserved25     = 25,
    1.79 +    EFeatureReserved26     = 26,
    1.80 +    EFeatureReserved27     = 27,
    1.81 +    EFeatureReserved28     = 28,
    1.82 +    EFeatureReserved29     = 29,
    1.83 +    EFeatureReserved30     = 30,
    1.84 +    EFeatureReserved31     = 31
    1.85 +
    1.86 +    };
    1.87 +
    1.88 +/** An enumeration for checking feature change type.
    1.89 +*/
    1.90 +enum TFeatureChangeType
    1.91 +    {
    1.92 +    /** Feature status not changed.
    1.93 +    */
    1.94 +    EFeatureNoChange            = 0,
    1.95 +    /** Feature status changed to enabled or disabled.
    1.96 +    */
    1.97 +    EFeatureStatusUpdated       = 1,
    1.98 +    /** Feature data changed.
    1.99 +    */
   1.100 +    EFeatureDataUpdated         = 2,
   1.101 +    /** Feature status and data changed.
   1.102 +    */
   1.103 +    EFeatureStatusDataUpdated   = 3,
   1.104 +    /** Not used, future: complex change occurred, reload all features.
   1.105 +    */
   1.106 +    EFeatureRediscover          = 4,
   1.107 +    /** Not used, future: new feature has been added to system.
   1.108 +    */
   1.109 +    EFeatureFeatureCreated      = 5,
   1.110 +    /** Feature has been deleted.
   1.111 +    */
   1.112 +    EFeatureFeatureDeleted      = 6
   1.113 +    };
   1.114 +
   1.115 +/**
   1.116 + Feature entry class.
   1.117 + Used by Feature Manager and its clients.
   1.118 +
   1.119 +*/
   1.120 +
   1.121 +class TFeatureEntry
   1.122 +    {
   1.123 +    public:
   1.124 +
   1.125 +        /**
   1.126 +         Default constructor.
   1.127 +         Needed by clients using the method
   1.128 +         FeatureSupported( TFeatureEntry& aFeature ) of Feature Control API.
   1.129 +
   1.130 +         @param aFeature Feature UID.
   1.131 +        */
   1.132 +        IMPORT_C TFeatureEntry( TUid aFeature );
   1.133 +
   1.134 +        /**
   1.135 +         Default constructor.
   1.136 +         Needed by clients using the method
   1.137 +         AddFeature( TFeatureEntry& aFeature ) of Feature Control API.
   1.138 +
   1.139 +         @param aFeature Feature UID.
   1.140 +         @param aFlags Feature status flags.
   1.141 +         @param aData Feature data.
   1.142 +        */
   1.143 +        IMPORT_C TFeatureEntry( TUid aFeature, TBitFlags32 aFlags, TUint32 aData );
   1.144 +
   1.145 +        /**
   1.146 +         Returns feature UID.
   1.147 +        */
   1.148 +        IMPORT_C TUid FeatureUid() const;
   1.149 +
   1.150 +        /**
   1.151 +         Returns feature status flags.
   1.152 +        */
   1.153 +        IMPORT_C TBitFlags32 FeatureFlags() const;
   1.154 +
   1.155 +        /**
   1.156 +         Returns feature data.
   1.157 +        */
   1.158 +        IMPORT_C TUint32 FeatureData() const;
   1.159 +
   1.160 +    public:
   1.161 +        /**
   1.162 +         Default constructor.
   1.163 +         Used by Feature Manager.
   1.164 +        */
   1.165 +        IMPORT_C TFeatureEntry();
   1.166 +
   1.167 +    private:
   1.168 +
   1.169 +        /** UID of the feature. */
   1.170 +        TUid iFeatureID;
   1.171 +        /**
   1.172 +         Value of the feature status flags.
   1.173 +         @see TFeatureFlags
   1.174 +        */
   1.175 +        TBitFlags32 iFlags;
   1.176 +        /** Data associated with feature. */
   1.177 +        TUint32 iData;
   1.178 +        /**
   1.179 +	     Reserved for future use.
   1.180 +	     Initialised to 0 on construction.
   1.181 +	    */
   1.182 +        TUint32 iReserved;
   1.183 +    };
   1.184 +
   1.185 +
   1.186 +/**
   1.187 + Defines the feature UID array.
   1.188 +*/
   1.189 +typedef RArray<TUid> RFeatureUidArray;
   1.190 +
   1.191 +/**
   1.192 + Defines  the feature entry array.
   1.193 +*/
   1.194 +typedef RArray<TFeatureEntry> RFeatureArray;
   1.195 +
   1.196 +#endif  // FEATURECMN_H
   1.197 +
   1.198 +// End of File