commondrm/drmsettingsplugin/inc/drmsettingsmodel.h
changeset 23 493788a4a8a4
parent 0 95b198f216e5
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
    19 #define  DRMSETTINGSMODEL_H
    19 #define  DRMSETTINGSMODEL_H
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
    22 #include    <centralrepository.h>
    22 #include    <centralrepository.h>
    23 #include    <e32property.h>
    23 #include    <e32property.h>
    24 #include    "roapstorageclient.h"
    24 #include    "RoapStorageClient.h"
    25 
    25 
    26 // FORWARD DECLARATIONS
    26 // FORWARD DECLARATIONS
    27 class CDRMRIContext;
    27 class CDRMRIContext;
    28 
    28 
    29 // CONSTANTS
    29 // CONSTANTS
    30 const TInt KDRMTransactionTrackingDisabled = 0;
    30 const TInt KDRMTransactionTrackingDisabled = 0;
    31 const TInt KDRMTransactionTrackingEnabled = 1;
    31 const TInt KDRMTransactionTrackingEnabled = 1;
    32 
    32 
    33 const TInt KDRMAutomaticActivationNotAllowed = 0;
    33 const TInt KDRMAutomaticActivationNotAllowed = 0;
    34 const TInt KDRMAutomaticActivationAllowed = 1;
    34 const TInt KDRMAutomaticActivationAllowed = 1;
    35     
    35 
    36 
    36 
    37 // CLASS DEFINITIONS
    37 // CLASS DEFINITIONS
    38 
    38 
    39 /**
    39 /**
    40 *  CDRMSettingsModel is the model class of DRMSettingsPlugin.
    40 *  CDRMSettingsModel is the model class of DRMSettingsPlugin.
    41 *  It provides functions to get and set setting values.
    41 *  It provides functions to get and set setting values.
    42 */
    42 */
    43 class   CDRMSettingsModel : public CBase
    43 class   CDRMSettingsModel : public CBase
    44     {
    44     {
    45     
    45 
    46     public:  // Constructor and destructor
    46     public:  // Constructor and destructor
    47         /**
    47         /**
    48         * Two-phased constructor
    48         * Two-phased constructor
    49         */
    49         */
    50         static CDRMSettingsModel* NewL();
    50         static CDRMSettingsModel* NewL();
    52         /**
    52         /**
    53         * Destructor
    53         * Destructor
    54         */
    54         */
    55         ~CDRMSettingsModel();
    55         ~CDRMSettingsModel();
    56 
    56 
    57     public: // New 
    57     public: // New
    58          
    58 
    59         /**
    59         /**
    60         * Get transaction tracking state
    60         * Get transaction tracking state
    61         * @return KDRMTransactionTrackingDisabled
    61         * @return KDRMTransactionTrackingDisabled
    62         *         KDRMTransactionTrackingEnabled
    62         *         KDRMTransactionTrackingEnabled
    63         */
    63         */
    66         /**
    66         /**
    67         * Set transaction tracking state
    67         * Set transaction tracking state
    68         * @param aValue updated value
    68         * @param aValue updated value
    69         */
    69         */
    70         void SetTransactionTrackingStateL( TInt aValue );
    70         void SetTransactionTrackingStateL( TInt aValue );
    71        
    71 
    72         /**
    72         /**
    73         * Get automatic activation state
    73         * Get automatic activation state
    74         * @return KDRMAutomaticActivationNotAllowed
    74         * @return KDRMAutomaticActivationNotAllowed
    75         *         KDRMAutomaticActivationAllowed
    75         *         KDRMAutomaticActivationAllowed
    76         */
    76         */
    79         /**
    79         /**
    80         * Set automatic activation state
    80         * Set automatic activation state
    81         * @param aValue updated value
    81         * @param aValue updated value
    82         */
    82         */
    83         void SetAutomaticActivationStateL( TInt aValue );
    83         void SetAutomaticActivationStateL( TInt aValue );
    84         
    84 
    85         /**
    85         /**
    86         * Get usage reporting state
    86         * Get usage reporting state
    87         * @return count of services for which reporting is allowed
    87         * @return count of services for which reporting is allowed
    88         */
    88         */
    89         TInt UsageReportingCount();
    89         TInt UsageReportingCount();
    94         * @param aIndex : Index of the RI context
    94         * @param aIndex : Index of the RI context
    95         *
    95         *
    96         * @return RI alias name or RI url if no alias available
    96         * @return RI alias name or RI url if no alias available
    97         */
    97         */
    98         HBufC* GetSingleRIAliasL( TInt aIndex );
    98         HBufC* GetSingleRIAliasL( TInt aIndex );
    99         
    99 
   100         /**
   100         /**
   101         * Get the first RI alias, where metering is allowed 
   101         * Get the first RI alias, where metering is allowed
   102         * @return RI alias name or RI url if no alias available
   102         * @return RI alias name or RI url if no alias available
   103         */
   103         */
   104         HBufC* GetFirstAllowedMeteringRIAliasL();
   104         HBufC* GetFirstAllowedMeteringRIAliasL();
   105         
   105 
   106         /**
   106         /**
   107         * Get number of RI contexts 
   107         * Get number of RI contexts
   108         * @return number of RIContexts
   108         * @return number of RIContexts
   109         */
   109         */
   110         TInt GetRiContextCount();
   110         TInt GetRiContextCount();
   111         
   111 
   112         /**
   112         /**
   113         * Get metering status of RI Context
   113         * Get metering status of RI Context
   114         * 
   114         *
   115         * @param aIndex : Index of the RI context
   115         * @param aIndex : Index of the RI context
   116         *
   116         *
   117         * @return Status of metering
   117         * @return Status of metering
   118         */
   118         */
   119         TBool IsMeteringAllowed( TInt aIndex );
   119         TBool IsMeteringAllowed( TInt aIndex );
   120         
   120 
   121         /**
   121         /**
   122         * Find out if metering is allowed for all RI Contexts
   122         * Find out if metering is allowed for all RI Contexts
   123         * 
   123         *
   124         * @return Status of metering
   124         * @return Status of metering
   125         */
   125         */
   126         TBool IsMeteringAllowedForAll();
   126         TBool IsMeteringAllowedForAll();
   127         
   127 
   128         /**
   128         /**
   129         * Sets the value for metering to be enabled or disabled
   129         * Sets the value for metering to be enabled or disabled
   130         *
   130         *
   131         * @param aIndex : Index of the RI context
   131         * @param aIndex : Index of the RI context
   132         * @param aIsAllowed : ETrue if set to allowed, EFalse if not allowed
   132         * @param aIsAllowed : ETrue if set to allowed, EFalse if not allowed
   133         */        
   133         */
   134         void SetMeteringStatus( TInt aIndex, TBool aIsAllowed );
   134         void SetMeteringStatus( TInt aIndex, TBool aIsAllowed );
   135         
   135 
   136         /**
   136         /**
   137         * Save the changes done to RI Contexs
   137         * Save the changes done to RI Contexs
   138         */
   138         */
   139         void SaveMeteringChanges();
   139         void SaveMeteringChanges();
   140        
   140 
   141     private: // Private constructors
   141     private: // Private constructors
   142         
   142 
   143         /**
   143         /**
   144         * Default C++ contructor
   144         * Default C++ contructor
   145         */
   145         */
   146         CDRMSettingsModel();
   146         CDRMSettingsModel();
   147 
   147 
   148         /**
   148         /**
   149         * Symbian OS default constructor
   149         * Symbian OS default constructor
   150         * @return void
   150         * @return void
   151         */
   151         */
   152         void ConstructL();
   152         void ConstructL();
   153         
   153 
   154     private: // Data
   154     private: // Data
   155         
   155 
   156         // DRM Settings Central Repository.
   156         // DRM Settings Central Repository.
   157         CRepository* iDRMSettingsRepository;
   157         CRepository* iDRMSettingsRepository;
   158 
   158 
   159         // Roap storage client
   159         // Roap storage client
   160         Roap::RRoapStorageClient* iRoapStorageClient;
   160         Roap::RRoapStorageClient* iRoapStorageClient;
   161 
   161 
   162         // List of service providers with which device has been registered
   162         // List of service providers with which device has been registered
   163         RPointerArray<CDRMRIContext> iRIContextList;
   163         RPointerArray<CDRMRIContext> iRIContextList;
   164         
   164 
   165     };
   165     };
   166     
   166 
   167 #endif // DRMSETTINGSMODEL_H  
   167 #endif // DRMSETTINGSMODEL_H
   168 
   168 
   169 // End of File
   169 // End of File