vpnengine/sit/inc/extender.h
branchRCL_3
changeset 23 473321461bba
parent 22 9f4e37332ce5
child 24 e06095241a65
equal deleted inserted replaced
22:9f4e37332ce5 23:473321461bba
     1 /*
       
     2 * Copyright (c) 2010 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: Extended functinality for policy provision process.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef EXTENDER_H_
       
    19 #define EXTENDER_H_
       
    20 
       
    21 #include <e32base.h>
       
    22 #include "vpnextapi.h"
       
    23 #include "vpnnotifierdefs.h"
       
    24 
       
    25 
       
    26 const TInt KStateCheckPolicyUpdateAvailability      = 1;
       
    27 const TInt KStateAfterCheckPolicyUpdateAvailability = 2;
       
    28 const TInt KStateAskUpdateConfirmation              = 3;
       
    29 const TInt KStateAfterAskUpdateConfirmation         = 4;
       
    30 const TInt KStateUpdatePolicy                       = 5;
       
    31 const TInt KStateAfterUpdatePolicy                  = 6;
       
    32 const TInt KStateShowUpdateCompleteNote             = 8;
       
    33 const TInt KStateAfterShowUpdateCompleteNote        = 9;
       
    34 const TInt KStateShowApActFailureNote               = 10;
       
    35 const TInt KStateAfterShowApActFailureNote          = 11;
       
    36 const TInt KStateBeforeEnrollCertificates           = 12;
       
    37 
       
    38 
       
    39 static const TUid KDmMsrNotificationUid = {0x1020699E};
       
    40 
       
    41 class CVpnConnStarter;
       
    42 class CExtenderHelper;
       
    43 
       
    44 class CExtender : public CActive
       
    45     {
       
    46 public:
       
    47     static CExtender* NewL();
       
    48     ~CExtender();
       
    49 
       
    50 public:
       
    51     void OnVpnApActStart(CVpnConnStarter* aVpnConnStarter);
       
    52     void OnVpnApActCancel();
       
    53     
       
    54     void OnVpnApActEnd(const TVpnPolicyId* aPolicyId, TInt aStatus, TUint32 aRealIapId);
       
    55 
       
    56 private:
       
    57     CExtender();
       
    58     void ConstructL();
       
    59 
       
    60 private:
       
    61     void GotoState(TInt aState);
       
    62     void SetCurrState(TInt aState);
       
    63     void SetNextState(TInt aState);
       
    64     TInt CurrState();
       
    65     TInt NextState();
       
    66 
       
    67     void ChangeStateL();
       
    68     void CancelOngoingOperation();
       
    69     
       
    70     void StateShowApActFailureNote();
       
    71     void StateAfterShowApActFailureNote();
       
    72     void StateCheckPolicyUpdateAvailabilityL();
       
    73     void StateAfterCheckPolicyUpdateAvailability();
       
    74     void StateAskUpdateConfirmation();
       
    75     void StateAfterAskUpdateConfirmationL();
       
    76     void StateUpdatePolicyL();
       
    77     
       
    78     void StateAfterUpdatePolicyL();
       
    79     
       
    80     void StateShowUpdateCompleteNote();
       
    81     void StateAfterShowUpdateCompleteNote();
       
    82 
       
    83 
       
    84     void ProcessComplete(TInt aStatus);
       
    85     void EndTask();
       
    86 
       
    87     TCmSettingSelection GetPolicyServerSelectionL();
       
    88     void ReportFailure(TUint32 aVpnIapId);
       
    89     
       
    90 private: // From CActive
       
    91     void DoCancel();
       
    92     void RunL();
       
    93     TInt RunError(TInt aError);
       
    94 
       
    95 private:
       
    96     CVpnConnStarter* iVpnConnStarter;
       
    97     TVpnPolicyId iPolicyId;
       
    98     TUint32 iRealIapId;
       
    99 
       
   100     TBool iPolicyUpdateAvailable;
       
   101     TInt iStateAfterUpdateConfirmation;
       
   102 
       
   103     RVpnExtApi iVpnExtServ;
       
   104     RNotifier iNotifier;
       
   105 
       
   106     TInt iCurrState;
       
   107     TInt iNextState;
       
   108 
       
   109     TInt iVpnActStatus;
       
   110     TInt iFinalStatus;
       
   111     
       
   112     CExtenderHelper* iExtenderHelper;
       
   113 
       
   114     TBool iShowCompletionNote;
       
   115     
       
   116     TPckgBuf<TVpnDialogInfo>    iDialogInfoDes;
       
   117     TPckgBuf<TVpnDialogOutput>  iDialogResponseDes;
       
   118     };
       
   119 
       
   120 
       
   121 #endif // __EXTENDER__