PECengine/PresenceManager2/SrcReactAuth/CPEngReactAuthNotifierImp.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Notifier API to listen presence reactive authorization changes.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPENGREACTAUTHNOTIFIERIMP_H
       
    19 #define CPENGREACTAUTHNOTIFIERIMP_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 #include "RGenericObserverArray.h"
       
    24 #include "MPEngAuthorizationObserver.h"
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 //FORWARD DECLARATIONS
       
    30 class CPEngReactAuthNotifier;
       
    31 class CPEngNWSessionSlotID2;
       
    32 class CPEngNWSessionSlotID2Imp;
       
    33 class CPEngNWSessionSlotStorageProxy;
       
    34 class MPEngReactAuthObserver;
       
    35 class MPEngAuthorizationManager;
       
    36 
       
    37 
       
    38 
       
    39 
       
    40 /**
       
    41  * Reactive authorization change notifier implementation.
       
    42  *
       
    43  * @since 3.0
       
    44  */
       
    45 NONSHARABLE_CLASS( CPEngReactAuthNotifierImp ) : public CBase,
       
    46         public MPEngAuthorizationObserver
       
    47 
       
    48     {
       
    49 public: /* Construction */
       
    50 
       
    51 
       
    52     /**
       
    53      * Instantiates CPEngReactAuthNotifierImp object.
       
    54      *
       
    55      * @return New CPEngReactAuthNotifierImp instance.
       
    56      */
       
    57     static CPEngReactAuthNotifierImp* NewL(
       
    58         CPEngReactAuthNotifier& aInterface,
       
    59         TInt aPriority,
       
    60         const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    61 
       
    62     /**
       
    63      * Destructor.
       
    64      */
       
    65     ~CPEngReactAuthNotifierImp();
       
    66 
       
    67 
       
    68 
       
    69 protected:
       
    70 
       
    71     /**
       
    72      * C++ constructor.
       
    73      */
       
    74     CPEngReactAuthNotifierImp( CPEngReactAuthNotifier& aInterface,
       
    75                                TInt aPriority );
       
    76 
       
    77 
       
    78     /**
       
    79      * Symbian OS constructor.
       
    80      */
       
    81     void ConstructL( const CPEngNWSessionSlotID2& aNWSessionSlotID );
       
    82 
       
    83 
       
    84 
       
    85 public: /* Reactive authorization notifier implementation */
       
    86 
       
    87     /**
       
    88      * Implementation.
       
    89      * @since 3.0
       
    90      */
       
    91     TBool IsActive() const;
       
    92     TInt Start( TInt aOptions );
       
    93     void Stop();
       
    94 
       
    95     TInt AddObserver( MPEngReactAuthObserver& aObserver );
       
    96     TInt RemoveObserver( MPEngReactAuthObserver& aObserver );
       
    97 
       
    98 
       
    99 private: /* From MPEngAuthorizationObserver */
       
   100 
       
   101 
       
   102     /**
       
   103      * Authorization handler.
       
   104      * @since 3.0
       
   105      */
       
   106     void HandleNewPendingAuthorization(
       
   107         MPEngAuthorizationRequest& aNewPendingAuthorization );
       
   108 
       
   109     /**
       
   110      * Authorization handler.
       
   111      * @since 3.0
       
   112      */
       
   113     void HandlerNewAuthorizationStatus(
       
   114         const MPEngAuthorizationStatus& aNewAuthorizationStatus );
       
   115 
       
   116     /**
       
   117      * Authorization engine update handler.
       
   118      */
       
   119     void HandleAuthorizationEngineUpdate();
       
   120 
       
   121 
       
   122     /**
       
   123      * Notification failure handler.
       
   124      */
       
   125     void HandleAuthorizationEngineError( TInt aError );
       
   126 
       
   127 
       
   128 
       
   129 private: //Data
       
   130 
       
   131     //REF: Implemented interface
       
   132     CPEngReactAuthNotifier& iInterface;
       
   133 
       
   134     //OWN: The notifier priority
       
   135     TInt    iCActivePriority;
       
   136 
       
   137     //OWN:
       
   138     CPEngNWSessionSlotStorageProxy* iUsedSlot;
       
   139 
       
   140     //OWN: Observer array
       
   141     RGenericObserverArray< MPEngReactAuthObserver >   iObsArray;
       
   142 
       
   143     //OWN: Flags describing the notifier state
       
   144     //     Flag contents are either EFalse or ETrue
       
   145     TInt8   iStarted;
       
   146     TInt8   iDying;
       
   147     TInt8   iReserved1;
       
   148     TInt8   iReserved2;
       
   149 
       
   150     MPEngAuthorizationManager*  iAuthManager;
       
   151 
       
   152     };
       
   153 
       
   154 #endif  //CPENGREACTAUTHNOTIFIERIMP_H
       
   155 
       
   156 // End of File