PECengine/PresenceManager2/SrcReactAuth/CPEngReactAuthStore.cpp
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:  Store API to retrieve reactive authorization models.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "CPEngReactAuthStore.h"
       
    20 #include "CPEngReactAuthStoreImp.h"
       
    21 #include "MPEngAuthorizationManager.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CPEngReactAuthStore::NewL()
       
    29 // Two-phased constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 EXPORT_C CPEngReactAuthStore* CPEngReactAuthStore::NewL(
       
    33     const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    34     TInt aPriority )
       
    35     {
       
    36     CPEngReactAuthStore* self = CPEngReactAuthStore::NewLC( aNWSessionSlotID,
       
    37                                                             aPriority );
       
    38     CleanupStack::Pop( self );
       
    39     return self;
       
    40     }
       
    41 
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CPEngReactAuthStore::NewLC()
       
    45 // Two-phased constructor.
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 EXPORT_C CPEngReactAuthStore* CPEngReactAuthStore::NewLC(
       
    49     const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    50     TInt aPriority )
       
    51     {
       
    52     CPEngReactAuthStore* self = new ( ELeave ) CPEngReactAuthStore;
       
    53     CleanupStack::PushL( self );
       
    54     self->iImp = CPEngReactAuthStoreImp::NewL( aNWSessionSlotID,
       
    55                                                aPriority );
       
    56     return self;
       
    57     }
       
    58 
       
    59 
       
    60 // Destructor
       
    61 CPEngReactAuthStore::~CPEngReactAuthStore()
       
    62     {
       
    63     delete iImp;
       
    64     }
       
    65 
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CPEngReactAuthStore::CPEngReactAuthStore
       
    69 // C++ default constructor can NOT contain any code, that
       
    70 // might leave.
       
    71 // -----------------------------------------------------------------------------
       
    72 //
       
    73 CPEngReactAuthStore::CPEngReactAuthStore()
       
    74     {
       
    75     }
       
    76 
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 // CPEngReactAuthStore::AuthorizationReqCount()
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 EXPORT_C TInt CPEngReactAuthStore::AuthorizationReqCount() const
       
    83     {
       
    84     return iImp->iAuthManager->AuthorizationsCount();
       
    85     }
       
    86 
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CPEngReactAuthStore::AuthorizationReq()
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 EXPORT_C MPEngAuthorizationRequest& CPEngReactAuthStore::AuthorizationReq( TInt aIndex )
       
    93     {
       
    94     return iImp->iAuthManager->Authorization( aIndex );
       
    95 
       
    96     }
       
    97 
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CPEngReactAuthStore::PendingAuthorizationReqCount()
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 EXPORT_C TInt CPEngReactAuthStore::PendingAuthorizationReqCount()  const
       
   104     {
       
   105     return iImp->iAuthManager->PendingAuthorizationsCount();
       
   106     }
       
   107 
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CPEngReactAuthStore::PendingAuthorizationReq()
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 EXPORT_C MPEngAuthorizationRequest& CPEngReactAuthStore::PendingAuthorizationReq( TInt aIndex )
       
   114     {
       
   115     return iImp->iAuthManager->PendingAuthorization( aIndex );
       
   116     }
       
   117 
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CPEngReactAuthStore::RespondedAuthorizationCount()
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 EXPORT_C TInt CPEngReactAuthStore::RespondedAuthorizationCount() const
       
   124     {
       
   125     return iImp->iAuthManager->RespondedAuthorizationsCount();
       
   126     }
       
   127 
       
   128 
       
   129 // -----------------------------------------------------------------------------
       
   130 // CPEngReactAuthStore::RespondedAuthorization()
       
   131 // -----------------------------------------------------------------------------
       
   132 //
       
   133 EXPORT_C const MPEngAuthorizationStatus& CPEngReactAuthStore::RespondedAuthorization(
       
   134     TInt aIndex ) const
       
   135     {
       
   136     return iImp->iAuthManager->RespondedAuthorization( aIndex );
       
   137     }
       
   138 
       
   139 
       
   140 // -----------------------------------------------------------------------------
       
   141 // CPEngReactAuthStore::ServerDeniedAuthorizationCount()
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 EXPORT_C TInt CPEngReactAuthStore::ServerDeniedAuthorizationCount() const
       
   145     {
       
   146     return iImp->iAuthManager->ServerDeniedAuthorizationsCount();
       
   147     }
       
   148 
       
   149 
       
   150 // -----------------------------------------------------------------------------
       
   151 // CPEngReactAuthStore::ServerDeniedAuthorization()
       
   152 // -----------------------------------------------------------------------------
       
   153 //
       
   154 EXPORT_C const MPEngAuthorizationStatus& CPEngReactAuthStore::ServerDeniedAuthorization(
       
   155     TInt aIndex ) const
       
   156     {
       
   157     return iImp->iAuthManager->ServerDeniedAuthorization( aIndex );
       
   158     }
       
   159 
       
   160 
       
   161 // -----------------------------------------------------------------------------
       
   162 // CPEngReactAuthStore::GetAndLockAuthorizationRespond()
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 EXPORT_C TInt CPEngReactAuthStore::GetAndLockAuthorizationRespond(
       
   166     MPEngAuthorizationRespond*& aRespond )
       
   167     {
       
   168     TRAPD( err,
       
   169            iImp->GetAndLockAuthorizationRespondL( aRespond ) );
       
   170 
       
   171     return err;
       
   172     }
       
   173 
       
   174 
       
   175 // End of File
       
   176