wim/WimPlugin/inc/WimTokenListener.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Listener class for Wim token removal event
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWIMTOKENLISTENER_H
       
    21 #define CWIMTOKENLISTENER_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include "WimSecModule.h"
       
    26 #include <e32base.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 *  CWimTokenListener listens removal event from WimServer
       
    35 *
       
    36 *  @lib   WimPlugin
       
    37 *  @since Series60 2.1
       
    38 */
       
    39 class CWimTokenListener : public CActive
       
    40     {
       
    41     public:  // Constructors and destructor
       
    42         
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         * @param aWimSecModule (IN) A pointer to current security module
       
    46         * @return An instance of this class
       
    47         */
       
    48         static CWimTokenListener* NewL( CWimSecModule* aWimSecModule );
       
    49         
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CWimTokenListener();
       
    54 
       
    55 
       
    56     public: // New functions
       
    57 
       
    58         /**
       
    59         * Starts system to listen token removal
       
    60         * @return void
       
    61         */
       
    62         void StartListening();
       
    63 
       
    64         /**
       
    65         * Set client status
       
    66         * @param aStatus (IN/OUT) Client status that wants to know if token 
       
    67         *        is removed
       
    68         * @return void
       
    69         */
       
    70         void SetClientStatus( TRequestStatus& aStatus );
       
    71 
       
    72         /**
       
    73         * Clear client status. This is done when framework's CancelNotify()
       
    74         * is called. The client won't get any message about token removal.
       
    75         * @return void
       
    76         */
       
    77         void ClearClientStatus();
       
    78 
       
    79         /**
       
    80         * Returns token status.
       
    81         * @return KRequestPending meaning that token is not removed, 
       
    82         *         KErrNone meaning that token has been removed, 
       
    83         */
       
    84         TInt TokenStatus();
       
    85 
       
    86     private: // From base class CActive
       
    87 
       
    88         void RunL();
       
    89         
       
    90         void DoCancel();
       
    91 
       
    92     private: // Constructors
       
    93     
       
    94         /**
       
    95         * Default constructor.
       
    96         * @param aWimSecModule (IN) A pointer to current security module
       
    97         */
       
    98         CWimTokenListener( CWimSecModule* aWimSecModule );
       
    99 
       
   100         // Second phase constructor
       
   101         void ConstructL();
       
   102 
       
   103     private:    
       
   104         
       
   105         // A pointer to current security module.
       
   106         // This class don't own the pointed object.
       
   107         CWimSecModule* iWimSecModule;
       
   108 
       
   109         // A pointer to UI's request status
       
   110         // This class don't own the pointed object.
       
   111         TRequestStatus* iClientStatus;
       
   112 
       
   113         // Status value of token
       
   114         TInt iTokenStatus;
       
   115 
       
   116     };
       
   117 
       
   118 #endif      // CWIMTOKENLISTENER_H   
       
   119             
       
   120 // End of File