emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 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:  PointSec monitor header.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef _IMS_POINTSEC_MONITOR_H__
       
    19 #define _IMS_POINTSEC_MONITOR_H__
       
    20 
       
    21 // INCLUDES
       
    22 //#include "MSyncEngineMonitor.h"
       
    23 //#include "MSyncEngineMonitorIf.h"
       
    24 
       
    25 #include <e32base.h>
       
    26 #include <e32property.h>
       
    27 
       
    28 //<cmail>
       
    29 #include "DebugLogMacros.h"
       
    30 //</cmail>
       
    31 
       
    32 class MImsPointsecObserver;
       
    33 
       
    34 class CImsPointsecMonitor : public CActive
       
    35     {
       
    36     public:
       
    37         IMPORT_C static CImsPointsecMonitor* NewL( MImsPointsecObserver&  aObserver );
       
    38         ~CImsPointsecMonitor();
       
    39 
       
    40         // from MSyncEngineMonitor
       
    41         //This is made public to allow caller to check the status immediatelly after constructing this object
       
    42         IMPORT_C TBool IsServiceAllowed() const;
       
    43 
       
    44     private:    // from CActive
       
    45         void RunL();
       
    46         void DoCancel();
       
    47 
       
    48     private:
       
    49 
       
    50         enum TPointsecStatus
       
    51             {
       
    52             EPointsecRecognizerStarted = 1,
       
    53             EPointsecInitializing,
       
    54             EPointsecLocked,
       
    55             EPointsecUnlocked,
       
    56             EPointSecUnknown,              //Do not know what 5 means, ignore it for now
       
    57             EPointSecEncryptionStarting,   //We received this while PointSec says "Encrypting Files"
       
    58                                            //encryption is done, we received EPointSecUnlocked
       
    59             EPointsecNotStarted = -1
       
    60             };
       
    61 
       
    62     private:
       
    63 	    CImsPointsecMonitor( MImsPointsecObserver& aObserver );
       
    64         void ConstructL();
       
    65         void HandleEvent( TPointsecStatus aStatus );
       
    66         void SetServiceAllowed( TBool aValue );
       
    67         void NotifyObserverIfNeeded( TBool aOldServiceAllowes );
       
    68         void UpdateStatus();
       
    69 
       
    70     private:
       
    71 
       
    72         MImsPointsecObserver*  iObserver;
       
    73         RProperty iProperty;
       
    74         TBool iServiceAllowed;
       
    75         
       
    76         __LOG_DECLARATION
       
    77     };
       
    78 
       
    79 #endif  // _IMS_POINTSEC_MONITOR_H__
       
    80