meetingrequest/mrpolicy/inc/cesmrpolicymanager.h
branchRCL_3
changeset 12 4ce476e64c59
parent 0 8466d47a6819
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
    18 
    18 
    19 #ifndef CESMRPOLICYMANAGER_H
    19 #ifndef CESMRPOLICYMANAGER_H
    20 #define CESMRPOLICYMANAGER_H
    20 #define CESMRPOLICYMANAGER_H
    21 
    21 
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 //<cmail>
    23 
    24 #include "esmrutilsapiext.h"
    24 #include "esmrutilsapiext.h"
    25 #include <barsc.h>
       
    26 #include "esmrdef.h"
    25 #include "esmrdef.h"
    27 #include "tesmrscenariodata.h"
    26 #include "tesmrscenariodata.h"
       
    27 #include "mmrpolicyprovider.h"
       
    28 
       
    29 #include <barsc.h>
       
    30 
    28 
    31 
    29 class CESMRPolicy;
    32 class CESMRPolicy;
    30 class MESMRCalEntry;
    33 class MESMRCalEntry;
    31 class MESMRPolicyChecker;
    34 class MMRPolicyResolver;
    32 class CESMRPolicyChecker;
    35 class CMRPolicyResolver;
    33 class CESMRPolicyExtensionManager;
       
    34 class CCoeEnv;
       
    35 
    36 
    36 /**
    37 /**
    37  *  CESMRPolicyManager defines ESMR policymanager.
    38  *  CESMRPolicyManager defines ESMR policymanager.
    38  *  ES MR policies are relates to different roles and task scenarions.
    39  *  ES MR policies are relates to different roles and task scenarions.
    39  *  Policies are used by user interface views and tasks. CESMRPolicyManager
    40  *  Policies are used by user interface views and tasks. CESMRPolicyManager
    41  *  CESMRPolicyManager uses CCoeEnv.
    42  *  CESMRPolicyManager uses CCoeEnv.
    42  *
    43  *
    43  *  @see CESMRPolicy
    44  *  @see CESMRPolicy
    44  *  @lib esmrpolicy.lib
    45  *  @lib esmrpolicy.lib
    45  */
    46  */
    46 NONSHARABLE_CLASS(CESMRPolicyManager) :
    47 NONSHARABLE_CLASS(CESMRPolicyManager) : public CBase,
    47         public CBase
    48                                         public MMRPolicyProvider
    48     {
    49     {
    49 public: // Construction and destruction
    50 public: // Construction and destruction
    50     /**
    51     /**
    51      * Two-phased constructor. Creates new CESMRPolicyManager object.
    52      * Two-phased constructor. Creates new CESMRPolicyManager object.
    52      * Ownership is transferred to caller.
    53      * Ownership is transferred to caller.
    63 public: // Interface
    64 public: // Interface
    64     /**
    65     /**
    65      * Fetches current policy object.
    66      * Fetches current policy object.
    66      * @return Current policy object
    67      * @return Current policy object
    67      */
    68      */
    68     inline CESMRPolicy& CurrentPolicy();
    69     IMPORT_C CESMRPolicy& CurrentPolicy();
    69 
       
    70     /**
       
    71      * Fetches the extension UID for ES MR policy manager
       
    72      * @return Uid of extension
       
    73      */
       
    74     IMPORT_C static TUid ExtensionUid();
       
    75 
    70 
    76     /**
    71     /**
    77      * Resolves policy to be used.
    72      * Resolves policy to be used.
    78      * @param aScenarioData Scenario Data for resolving correct policy
    73      * @param aScenarioData Scenario Data for resolving correct policy
    79      * @param aESMREntry Reference to ES MR Entry.
    74      * @param aESMREntry Reference to ES MR Entry.
    80      * @param aPolicyChecker to be used. If NULL, default checker is used
    75      * @param aCustomResolver to be used. If NULL, resolver is determined by
       
    76      * policy manager
    81      */
    77      */
    82     IMPORT_C void ResolvePolicyL(
    78     IMPORT_C void ResolvePolicyL(
    83             const TESMRScenarioData& aScenarioData,
    79             const TESMRScenarioData& aScenarioData,
    84             MESMRCalEntry& aESMREntry,
    80             MESMRCalEntry& aESMREntry,
    85             MESMRPolicyChecker* aPolicyChecker );
    81             MMRPolicyResolver* aCustomResolver = NULL );
    86 
       
    87     /**
       
    88      * Reads policy from resource file. Policies are appended
       
    89      * @param aPolicyFile Policy resource filename.
       
    90      * @param aPolicyArrayResourceId Policy array resource id
       
    91      */
       
    92     IMPORT_C void ReadPolicyFromResourceL(
       
    93             const TDesC& aPolicyFile,
       
    94             TInt aPolicyArrayResourceId );
       
    95 
    82 
    96     /**
    83     /**
    97      * Adds the current policy on stack for preserving it if a new policy
    84      * Adds the current policy on stack for preserving it if a new policy
    98      * needs to be resolved and the current policy is still needed afterwards.
    85      * needs to be resolved and the current policy is still needed afterwards.
    99      */
    86      */
   102     /**
    89     /**
   103      * Restores the topmost policy from the stack as the current policy. 
    90      * Restores the topmost policy from the stack as the current policy. 
   104      * @return the policy from stack or NULL if stack is empty.
    91      * @return the policy from stack or NULL if stack is empty.
   105      */
    92      */
   106     IMPORT_C CESMRPolicy* PopPolicy();
    93     IMPORT_C CESMRPolicy* PopPolicy();
       
    94 
       
    95 public: // from MMRPolicyProvider
       
    96     
       
    97     const CESMRPolicy& CurrentPolicy() const;
   107     
    98     
   108 private: // Implementation
    99 private: // Implementation
   109 
   100 
   110     CESMRPolicyManager();
   101     CESMRPolicyManager();
   111     void ConstructL();
   102     void ConstructL();
   112     void ReadPolicyL(
   103     
   113             TInt aResourceId,
       
   114             MESMRCalEntry& aESMREntry );
       
   115 
       
   116 private: // data
   104 private: // data
   117 
   105 
       
   106     /**
       
   107      * Current policy resolver.
       
   108      * Own.
       
   109      */
       
   110     MMRPolicyResolver* iResolverPlugin;
       
   111     
   118     /**
   112     /**
   119     * Current policy object
   113     * Current policy object
   120     * Own.
   114     * Own.
   121     */
   115     */
   122     CESMRPolicy* iCurrentPolicy;
   116     CESMRPolicy* iCurrentPolicy;
   123 
   117 
   124     /**
   118     /**
   125     * Policy resource file
       
   126     * Own
       
   127     */
       
   128     RResourceFile iPolicyResourceFile;
       
   129 
       
   130     /**
       
   131     * ESMR policy resource ids
       
   132     * Own.
       
   133     */
       
   134     RArray<TInt> iPolicyResourceIds;
       
   135 
       
   136     /**
       
   137      * Default ESMR policy checker.
       
   138      * Own.
       
   139      */
       
   140     CESMRPolicyChecker* iDefaultPolicyChecker;
       
   141 
       
   142     // Own: Extension resource manager
       
   143     CESMRPolicyExtensionManager* iExtension;
       
   144 
       
   145     // Ref: Coe Env
       
   146     CCoeEnv* iCoeEnv;
       
   147     
       
   148     /**
       
   149      * Array for preserving policies
   119      * Array for preserving policies
   150      */
   120      */
   151     RPointerArray< CESMRPolicy > iPolicyStack;
   121     RPointerArray< CESMRPolicy > iPolicyStack;
   152     };
   122     };
   153 
   123 
   154 #include "cesmrpolicymanager.inl"
       
   155 //</cmail>
       
   156 
       
   157 #endif // CESMRPOLICYMANAGER_H
   124 #endif // CESMRPOLICYMANAGER_H