vpnc_plat/vpnapi/inc/vpnapi.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2003-2007 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:  The VPN API allows Symbian OS applications and servers
       
    15 *                to perform VPN-specific operations.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**  
       
    21  @file
       
    22  @released
       
    23  @publishedPartner
       
    24  
       
    25  VPN API
       
    26  */
       
    27 
       
    28 #ifndef __VPNAPI_H__
       
    29 #define __VPNAPI_H__
       
    30 
       
    31 #include <e32std.h>
       
    32 #include <e32base.h>
       
    33 
       
    34 #include "vpnapidefs.h"
       
    35 
       
    36 /** 
       
    37  * @mainpage VPN API
       
    38  * 
       
    39  * @section intro Overview
       
    40  *
       
    41  * The VPN API allows Symbian OS applications and servers to perform
       
    42  * VPN-specific operations, especially those related to VPN policies.
       
    43  * The operations include:
       
    44  * <ul>
       
    45  * <li>Importing policies</li>
       
    46  * <li>Listing policies</li>
       
    47  * <li>Finding out detailed information about the policies</li>
       
    48  * <li>Deleting policies</li>
       
    49  * <li>(*Deprecated) Changing the password that is used to protect the private keys 
       
    50  *   associated with the policies</li>
       
    51  * </ul>
       
    52  * 
       
    53  * NOTE. Direct policy activation/deactivation is not possible through this API.
       
    54  * This is because the use of VPNs is based on the activation/deactivation
       
    55  * of VPN IAPs and policy activation/deactivation is a (hidden) part of this
       
    56  * process. The activation/deactivation of VPN IAPs is similar to the
       
    57  * activation/deactivation of any other IAPs and is thus performed via
       
    58  * standard Symbian OS interfaces.
       
    59  */
       
    60 
       
    61 class RVpnServ : public RSessionBase
       
    62 /**
       
    63  * An API that allows client applications to manage VPN policies and
       
    64  * the password that is used to protect private keys used for VPN
       
    65  * authentication.
       
    66  *
       
    67  * The API follows the standard Symbian OS client-server
       
    68  * programming patterns.
       
    69  *
       
    70  */
       
    71     {
       
    72 public:
       
    73     IMPORT_C RVpnServ(void);
       
    74 
       
    75     IMPORT_C TInt Connect();
       
    76     IMPORT_C void Close();
       
    77 
       
    78     IMPORT_C TVersion Version() const;
       
    79     
       
    80     IMPORT_C void ImportPolicy(const TDesC& aDir, TRequestStatus& aStatus);
       
    81     IMPORT_C void CancelImport();
       
    82 
       
    83     IMPORT_C TInt EnumeratePolicies(TInt& aCount);
       
    84     IMPORT_C TInt GetPolicyInfoList(
       
    85         CArrayFixFlat<TVpnPolicyInfo>* aPolicyInfoList);
       
    86 
       
    87     IMPORT_C TInt GetPolicyDetails(
       
    88         const TVpnPolicyId& aPolicyId, TVpnPolicyDetails& aPolicyDetails);
       
    89 
       
    90     IMPORT_C TInt DeletePolicy(const TVpnPolicyId& aPolicyId);
       
    91 
       
    92     /**
       
    93      * ChangePassword / CancelChange
       
    94      * *Deprecated!! -> To Be removed 
       
    95      *   (Completes immediately with KErrNotSupported)
       
    96      *
       
    97      * @since S60 3.0
       
    98      * @param aPolicyId Policy id
       
    99      * @param aStatus async operation status. 
       
   100      */
       
   101     IMPORT_C void ChangePassword(
       
   102         const TPckg<TVpnPolicyId>& aPolicyId, TRequestStatus& aStatus);
       
   103     IMPORT_C void CancelChange();
       
   104 
       
   105     IMPORT_C TInt GetPolicyData(
       
   106         const TVpnPolicyId& aPolicyId, HBufC8*& aPolicyData);
       
   107 
       
   108     // New methods to facilitate OMA DM based VPN policy management
       
   109     
       
   110     IMPORT_C TInt AddPolicy(
       
   111         TVpnPolicyDetails& aPolicyDetails, const TDesC8& aPolicyData);
       
   112 
       
   113     IMPORT_C TInt UpdatePolicyDetails(
       
   114         const TVpnPolicyDetails& aPolicyDetails);
       
   115     
       
   116     IMPORT_C TInt UpdatePolicyData(
       
   117         const TVpnPolicyId& aPolicyId, const TDesC8& aPolicyData);
       
   118 
       
   119     IMPORT_C TInt UpdatePolicyDetails(TVpnPolicyDetails& aPolicyDetails);
       
   120 
       
   121 private: // implementation
       
   122     void DoGetPolicyDataL(
       
   123         const TVpnPolicyId& aPolicyId, HBufC8*& aPolicyData);
       
   124     };
       
   125 
       
   126 /** Another name for the API class */
       
   127 typedef RVpnServ RVpnApi;
       
   128 
       
   129 #endif // __VPNAPI_H__