ipcm_plat/access_point_engine_misc_api/inc/VpnAPItem.h
changeset 61 8b0c979bbe8c
parent 59 2709c04a4af5
child 70 ac5daea24fb0
equal deleted inserted replaced
59:2709c04a4af5 61:8b0c979bbe8c
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Declares the main handler, CVpnAPItem and the API for 
       
    16 *     the Vpn Access Point Engine.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef VPN_AP_ITEM_H
       
    22 #define VPN_AP_ITEM_H
       
    23 
       
    24 // Deprecation warning
       
    25 #warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details.
       
    26  
       
    27  
       
    28 // INCLUDES
       
    29 #include    <e32base.h>
       
    30 
       
    31 // CONSTANTS
       
    32 enum TVpnApMember
       
    33     {
       
    34     // WAP Access Point Table
       
    35     EApVpnWapAccessPointID,         ///< The Uid of the VPN access point.
       
    36                                     ///< READ ONLY, assigned by the database.
       
    37                                     ///< TUint32
       
    38     EApVpnWapAccessPointName,       ///< The name of the access point, TDesC16
       
    39 
       
    40     EApVpnRealWapID,                ///< WAP ID of the real IAP ap, TUint32
       
    41     EApVpnIapID,                    ///< IAP ID of the VPN IAP record, TUint32
       
    42     EApVpnRealIapID,                ///< IAP ID of the real IAP record used
       
    43                                     ///< to create connection, TUint32
       
    44     EApVpnRealIapName,              ///< IAP name of the real IAP record used
       
    45                                     ///< to create connection, Text
       
    46     EApVpnPolicy,                   ///< The VPN policy to be used, TDesC16
       
    47     EApVpnPolicyId,                 ///< The VPN policy to be used, TDesC16
       
    48     EApVpnProxyServerAddress,       ///< Proxy server address, long text
       
    49     EApVpnProxyPortNumber,          ///< Proxy port number,  TUint32
       
    50 
       
    51     EApVpnHomeNetworkID,            ///< The ID of the home netwokr, TUint32
       
    52     EApVpnIapNetworkID,             ///< The ID of the home netwokr, TUint32
       
    53     EApVpnIapNetworkName,           ///< The name of the home netwokr, TDesC16
       
    54     };
       
    55 
       
    56 
       
    57 
       
    58 
       
    59 
       
    60 // FORWARD DECLARATIONS
       
    61 class CCommsDatabase;
       
    62 
       
    63 // CLASS DECLARATION
       
    64 /**
       
    65 * This class encapsulates VPN related data in addition to a 'normal' 
       
    66 * access point. It provides Get/Set methods for every member.
       
    67 * Member set is not limited by the API.
       
    68 * It is used to read-write VPN data to and form CommsDb.
       
    69 * Main user is CVpnApEngine class but also UI might use this one.
       
    70 */
       
    71 NONSHARABLE_CLASS( CVpnApItem ) : public CBase
       
    72     { // holds VPN specific data
       
    73 
       
    74     public:  // Constructors and destructor
       
    75         /**
       
    76         * Two-phased constructor. Leaves on failure, places instance
       
    77         * on cleanup stack. Instance is initialised to default values.
       
    78         * @return The constructed CApAccessPointItem.
       
    79         *
       
    80         * @deprecated
       
    81         */
       
    82         IMPORT_C static CVpnApItem* NewLC();
       
    83 
       
    84 
       
    85         /**
       
    86         * Destructor.
       
    87         *
       
    88         * @deprecated
       
    89         */
       
    90         IMPORT_C virtual ~CVpnApItem();
       
    91 
       
    92         
       
    93     protected:      // Constructors
       
    94 
       
    95         /**
       
    96         * Second-phase constructor.
       
    97         *
       
    98         * @deprecated
       
    99         */
       
   100         IMPORT_C void ConstructL();
       
   101 
       
   102 
       
   103     private:    // Data
       
   104         /**
       
   105         * C++ default constructor.
       
   106         *
       
   107         * @deprecated
       
   108         */
       
   109         IMPORT_C CVpnApItem();
       
   110 
       
   111 
       
   112 
       
   113     public:  // other public, exported functions
       
   114         /**
       
   115         * Copies the data from another CVpnApItem.
       
   116         * Substitute for the "assignment operator". It requires allocation
       
   117         * thus can leave.
       
   118         * Wap Access Point Uid is not copied.
       
   119         *
       
   120         * @deprecated
       
   121         */
       
   122         IMPORT_C void CopyFromL( const CVpnApItem& aCopyFrom  );
       
   123 
       
   124 
       
   125         /**
       
   126         * Equality operator. Wap Access Point Uid is not counted.
       
   127         *
       
   128         * @deprecated
       
   129         */
       
   130         IMPORT_C TBool operator==( const CVpnApItem& aitem ) const;
       
   131 
       
   132 
       
   133         /**
       
   134         * Inequality operator. Wap Access Point Uid is not counted.
       
   135         *
       
   136         * @deprecated
       
   137         */
       
   138         IMPORT_C TBool operator!=( const CVpnApItem& aitem ) const;
       
   139 
       
   140 
       
   141 
       
   142         /**
       
   143         * This function reads up a 16-bit text value from the specified column.
       
   144         * @param aColumn Enum value indicating the column to read.
       
   145         * @param aValue Reference to a 16-bit descriptor to hold the value
       
   146         * @return no return value
       
   147         *
       
   148         * @deprecated
       
   149         */
       
   150         IMPORT_C void ReadTextL( const TVpnApMember aColumn, TDes16& aValue );
       
   151 
       
   152 
       
   153         /**
       
   154         * This function reads up a long text value from the specified column.
       
   155         * The ownership is not passed to the caller. It means that the caller
       
   156         * should not delete the received value.
       
   157         * If the caller must take the ownership for any reason, must make a
       
   158         * copy and use that and delete the copy when no longer needed.
       
   159         * @param aColumn Enum value indicating the column to read.
       
   160         * @return A const HBufC* to the value.
       
   161         *
       
   162         * @deprecated
       
   163         */
       
   164         IMPORT_C const HBufC* ReadConstLongTextL( const TVpnApMember aColumn );
       
   165 
       
   166 
       
   167         /**
       
   168         * This function reads up a TUint32 value from the specified column.
       
   169         * If the specified column does not exist (that is, not part of the
       
   170         * database structure), it will Panic in debug builds and it will
       
   171         * return KErrInvalidColumn in release builds without Panicking.
       
   172         * Panic is used in debug builds because it indicates a programming
       
   173         * error. In release, it 'notifies' the caller about the error through
       
   174         * the return value but enables system to continue operation.
       
   175         * @param aColumn Enum value indicating the column to read.
       
   176         * @param aValue A reference to a TUint32 to hold the value
       
   177         * @return Error code.
       
   178         *
       
   179         * @deprecated
       
   180         */
       
   181         IMPORT_C TInt ReadUint( const TVpnApMember aColumn, TUint32& aValue );
       
   182 
       
   183         /**
       
   184         * This function reads up a boolean value from the specified column.
       
   185         * If the specified column does not exist (that is, not part of the
       
   186         * database structure), it will Panic in debug builds and it will
       
   187         * return KErrInvalidColumn in release builds without Panicking.
       
   188         * Panic is used in debug builds because it indicates a programming
       
   189         * error. In release, it 'notifies' the caller about the error through
       
   190         * the return value but enables system to continue operation.
       
   191         * @param aColumn Enum value indicating the column to read.
       
   192         * @param aValue A reference to a boolean to hold the value
       
   193         * @return Error code.
       
   194         *
       
   195         * @deprecated
       
   196         */
       
   197         IMPORT_C TInt ReadBool( const TVpnApMember aColumn, TBool& aValue );
       
   198 
       
   199 
       
   200 
       
   201         /**
       
   202         * This function writes a 16-bit text value to the specified column.
       
   203         * If the specified column does not exist (that is, not part of the
       
   204         * database structure), it will Panic in debug builds and it will
       
   205         * return KErrInvalidColumn in release builds without Panicking.
       
   206         * Panic is used in debug builds because it indicates a programming
       
   207         * error. In release, it 'notifies' the caller about the error through
       
   208         * the return value but enables system to continue operation.
       
   209         * This function can Leave if the copying of the text does not succeed.
       
   210         * @param aColumn Enum value indicating the column to write.
       
   211         * @param aValue Reference to a 16-bit text descriptor to the value
       
   212         * @return Error code.
       
   213         *
       
   214         * @deprecated
       
   215         */
       
   216         IMPORT_C TInt WriteTextL( const TVpnApMember aColumn,
       
   217                                   const TDesC16& aValue );
       
   218 
       
   219 
       
   220 
       
   221         /**
       
   222         * This function writes a long text value to the specified column.
       
   223         * If the specified column does not exist (that is, not part of the
       
   224         * database structure), it will Panic in debug builds and it will
       
   225         * return KErrInvalidColumn in release builds without Panicking.
       
   226         * Panic is used in debug builds because it indicates a programming
       
   227         * error. In release, it 'notifies' the caller about the error through
       
   228         * the return value but enables system to continue operation.
       
   229         * This function can Leave if the copying of the text does not succeed.
       
   230         * @param aColumn Enum value indicating the column to write.
       
   231         * @param aValue Reference to a 16-bit text descriptor to the value
       
   232         * @return Error code.
       
   233         *
       
   234         * @deprecated
       
   235         */
       
   236         IMPORT_C TInt WriteLongTextL( const TVpnApMember aColumn,
       
   237                                       const TDesC& aValue );
       
   238 
       
   239 
       
   240         /**
       
   241         * This function writes a TUint32 value to the specified column.
       
   242         * If the specified column does not exist (that is, not part of the
       
   243         * database structure), it will Panic in debug builds and it will
       
   244         * return KErrInvalidColumn in release builds without Panicking.
       
   245         * Panic is used in debug builds because it indicates a programming
       
   246         * error. In release, it 'notifies' the caller about the error through
       
   247         * the return value but enables system to continue operation.
       
   248         * @param aColumn Enum value indicating the column to write.
       
   249         * @param aValue A const reference to a TUint32 value
       
   250         * @return Error code.
       
   251         *
       
   252         * @deprecated
       
   253         */
       
   254         IMPORT_C TInt WriteUint( const TVpnApMember aColumn,
       
   255                                  const TUint32& aValue );
       
   256 
       
   257         /**
       
   258         * This function writes a boolean value to the specified column.
       
   259         * If the specified column does not exist (that is, not part of the
       
   260         * database structure), it will Panic in debug builds and it will
       
   261         * return KErrInvalidColumn in release builds without Panicking.
       
   262         * Panic is used in debug builds because it indicates a programming
       
   263         * error. In release, it 'notifies' the caller about the error through
       
   264         * the return value but enables system to continue operation.
       
   265         * @param aColumn Enum value indicating the column to write.
       
   266         * @param aValue A const reference to a boolean value
       
   267         * @return Error code.
       
   268         *
       
   269         * @deprecated
       
   270         */
       
   271         IMPORT_C TInt WriteBool( const TVpnApMember aColumn,
       
   272                                  const TBool& aValue );
       
   273 
       
   274 
       
   275 
       
   276         // Query
       
   277         // COMMON
       
   278         /**
       
   279         * This function returns the ID of the access point
       
   280         * @return The ID of this access point
       
   281         *
       
   282         * @deprecated
       
   283         */
       
   284         IMPORT_C TUint32 WapUid() const;
       
   285 
       
   286 
       
   287         /**
       
   288         * This function returns the name of the connection
       
   289         * Ownership is not passed.
       
   290         * @return The name of the connection
       
   291         *
       
   292         * @deprecated
       
   293         */
       
   294         IMPORT_C const TDesC& Name() const;
       
   295 
       
   296 protected:
       
   297         /**
       
   298         * Reallocates a passed 16-bit descriptor. Passed descriptor is deleted,
       
   299         * new one is AllocL-ed
       
   300         * Passed descriptor MUST NOT BE on the CleanupStack
       
   301         */
       
   302         void ReAllocL(HBufC*& aDes, const TDesC16& aValue);
       
   303 
       
   304         
       
   305         /**
       
   306         * Removes invalid chars from the passed text
       
   307         * Invalid chars are: TAB
       
   308         * @return a HBufC16 holding the new text
       
   309         */
       
   310         HBufC* RemoveInvalidCharsLC( const TDesC16& aInText );
       
   311 
       
   312 
       
   313         /**
       
   314         * Returns whether this VPN access point has proxy data or not.
       
   315         * 
       
   316         */
       
   317         TBool HasProxy() const;
       
   318 
       
   319 private:    // Data
       
   320 
       
   321 
       
   322         HBufC*      iName;
       
   323         TUint32     iVpnTableId;
       
   324         TUint32     iVpnIapId;
       
   325         TUint32     iRealIapId;
       
   326 
       
   327         TUint32     iVpnRealWapId;
       
   328         TUint32     iVpnWapId;
       
   329 
       
   330         TUint32     iVirtualBearerID;
       
   331 
       
   332         HBufC*      iPolicyId;
       
   333 
       
   334         HBufC*      iPolicy;
       
   335         HBufC*      iProxyServerAddress;
       
   336         HBufC*      iRealIapName;
       
   337         TUint32     iProxyPort;
       
   338         TUint32     iHomeNetwork;
       
   339         TUint32     iVpnIapNetwork;
       
   340         HBufC*      iVpnIapNetworkName;
       
   341 
       
   342 
       
   343     protected:  // Friend classes
       
   344         friend class CVpnApEngine;
       
   345 
       
   346     };
       
   347 
       
   348 
       
   349 
       
   350 #endif 
       
   351 
       
   352 // End of File