sysstatemgmt/systemstatereferenceplugins/clayer/inc/ssmsecurityeventobserver.h
changeset 0 4e1aa6a622a0
child 5 1a73e8f1b64d
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2008-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 * Name        : strtsecurityeventobserver.h
       
    16 * Part of     : System Startup / StrtSecObs
       
    17 * Declaration of CStrtSecurityEventObserver class
       
    18 * Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
       
    19 * This material, including documentation and any related computer
       
    20 * programs, is protected by copyright controlled by Nokia.  All
       
    21 * rights are reserved.  Copying, including reproducing, storing,
       
    22 * adapting or translating, any or all of this material requires the
       
    23 * prior written consent of Nokia.  This material also contains
       
    24 * confidential information which may not be disclosed to others
       
    25 * without the prior written consent of Nokia.
       
    26 * Template version: 4.2
       
    27 * Nokia Core OS *
       
    28 * File renamed from strtsecurityeventobserver.h to ssmsecurityeventobserver.h as part of Core OS transfer.
       
    29 *
       
    30 */
       
    31 
       
    32 
       
    33 
       
    34 #ifndef __SSMSECURITYEVENTOBSERVER_H__
       
    35 #define __SSMSECURITYEVENTOBSERVER_H__
       
    36 
       
    37 #include <e32base.h>
       
    38 #include <etelmm.h>
       
    39 #include <ssm/ssmutility.h>
       
    40 #include "strtsecuritynotetype.h"
       
    41 
       
    42 /* 
       
    43 * @publishedPartner
       
    44 * @released
       
    45 */
       
    46 
       
    47 class CStrtSecurityNoteController;
       
    48 class CStrtSecPhaseObserver;
       
    49 
       
    50 NONSHARABLE_CLASS( CStrtSecurityEventObserver ) : public CActive, public MSsmUtility
       
    51     {
       
    52 public:
       
    53 	//From MSsmUtility
       
    54 	void InitializeL();
       
    55 	void StartL();
       
    56 	void Release();
       
    57     
       
    58 public:
       
    59     /**
       
    60      * Two-phased constructor.
       
    61      */
       
    62     IMPORT_C static MSsmUtility* NewL();
       
    63 
       
    64 protected:
       
    65 // from base class CActive
       
    66 
       
    67     /**
       
    68      * Implements cancellation of an outstanding request.
       
    69      */
       
    70     void DoCancel();
       
    71 
       
    72     /**
       
    73      * Handles an active object’s request completion event.
       
    74      * This RunL will never leave, so RunError not needed.
       
    75      */
       
    76     void RunL();
       
    77 
       
    78 private:
       
    79     /**
       
    80     * Destructor.
       
    81     */
       
    82     ~CStrtSecurityEventObserver();
       
    83     
       
    84     /**
       
    85      * C++ default constructor.
       
    86      */
       
    87     CStrtSecurityEventObserver();
       
    88 
       
    89     /**
       
    90      * Second phase constructor.
       
    91      */
       
    92     void ConstructL();
       
    93 
       
    94     /**
       
    95      * Send notify security event to the ETel and set active.
       
    96      * Should not be called if already active.
       
    97      */
       
    98     void Activate();
       
    99 
       
   100     /**
       
   101      * Processes commands from the ETel.   
       
   102      */
       
   103     void ProcessSecurityEvent();
       
   104 
       
   105     /**
       
   106      * Sends SIM code request to the controller.
       
   107      *
       
   108      * @param aNoteType Identifies the security note to show.
       
   109      */
       
   110     void SimCodeRequest( const TStrtSecurityNoteType aNoteType );
       
   111 
       
   112     /**
       
   113      * Sends security code request to the controller.
       
   114      *
       
   115      * @param aNoteType Identifies the security note to show.
       
   116      */
       
   117     void SecCodeRequest( const TStrtSecurityNoteType aNoteType );
       
   118 
       
   119     /**
       
   120      * Sends other type (i.e. application PIN) 
       
   121      * code request to the controller.
       
   122      *
       
   123      * @param aNoteType Identifies the security note to show.
       
   124      */
       
   125     void OtherCodeRequest( const TStrtSecurityNoteType aNoteType );
       
   126 
       
   127     /**
       
   128      * Sends code verified command to the controller.
       
   129      *
       
   130      * @param aNoteType Identifies the security note which was shown.
       
   131      */
       
   132     void CodeVerifyIndication( const TStrtSecurityNoteType aNoteType );
       
   133 
       
   134 private: // data
       
   135     /**
       
   136      * Observes the startup security phase.
       
   137      */
       
   138     CStrtSecPhaseObserver* iSecPhaseObserver;
       
   139 
       
   140     /**
       
   141      * Controls showing security notifications.
       
   142      */    
       
   143     CStrtSecurityNoteController* iController;
       
   144 
       
   145     /**
       
   146      * TelServer client
       
   147      */
       
   148     RTelServer iTelServer;
       
   149     
       
   150     /**
       
   151      * Mobile phone network client
       
   152      */
       
   153     RMobilePhone iPhone;
       
   154         
       
   155     /**
       
   156      * Notify Security Event received from TSY.
       
   157      */
       
   158     RMobilePhone::TMobilePhoneSecurityEvent iEvent;
       
   159     HBufC* iTsyModuleName;
       
   160 
       
   161 #ifdef TEST_CLAYER_MACRO
       
   162 	friend class CLayerTestSsmEventObserver;
       
   163 #endif //TEST_CLAYER_MACRO
       
   164     };
       
   165 #endif // __SSMSECURITYEVENTOBSERVER_H__