voipplugins/voipadapters/voipxmlprovisioning/voipxmlprocessor/inc/voipxmliaphandler.h
changeset 2 7b872347d83b
child 8 7117cbf1600a
equal deleted inserted replaced
1:bfb1de3eac8e 2:7b872347d83b
       
     1 /*
       
     2 * Copyright (c) 2009-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:  IAP handler for VoIP XML processor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef  VOIPXMLIAPHANDLER_H
       
    20 #define  VOIPXMLIAPHANDLER_H
       
    21 
       
    22 #include "voipxmlprocessordefaults.h"
       
    23 
       
    24 class RCmManagerExt;
       
    25 
       
    26 class TWepKey
       
    27     {
       
    28 public:
       
    29     /**
       
    30      * ETrue if hexadecimal, EFalse if ASCII.
       
    31      */
       
    32     TBool iHex;
       
    33     /**
       
    34      * WEP key length.
       
    35      */
       
    36     TInt iLength;
       
    37     /**
       
    38      * WEP key data.
       
    39      */
       
    40     TBuf<KMaxWepKeyDataLength> iData;
       
    41     };
       
    42 
       
    43 struct TTemporaryIap
       
    44     {
       
    45     /**
       
    46      * Name of the IAP.
       
    47      */
       
    48     HBufC* iName;
       
    49     /**
       
    50      * SSID of the IAP.
       
    51      */
       
    52     HBufC* iSsid;
       
    53     /**
       
    54      * Tells if the SSID is hidden or not.
       
    55      */
       
    56     TBool iHidden;
       
    57     /**
       
    58      * Network mode.
       
    59      */
       
    60     TInt iNetworkMode;
       
    61     /**
       
    62      * Network type.
       
    63      */
       
    64     TInt iSecurityType;
       
    65     /**
       
    66      * Pre-shared key.
       
    67      */
       
    68     HBufC* iPreSharedKey;
       
    69     /**
       
    70      * WEP authentication mode.
       
    71      */
       
    72     TInt iWepAuthMode;
       
    73     /**
       
    74      * Current WEP key.
       
    75      */
       
    76     TWepKey iCurrentWepKey;
       
    77     /**
       
    78      * Array of WEP keys.
       
    79      */
       
    80     RArray<TWepKey> iWepKeys;
       
    81     };
       
    82 
       
    83 /**
       
    84 *  VoipXmlIapHandler
       
    85 *  IAP handler class.
       
    86 * 
       
    87 *  @lib voipxmlprocessor.lib
       
    88 *  @since S60 v5.0
       
    89 */
       
    90 class CVoipXmlIapHandler : public CBase
       
    91     {
       
    92 #ifdef _DEBUG
       
    93     friend class UT_CVoipXmlIapHandler;
       
    94     friend class UT_CVoipXmlParamHandler;
       
    95 #endif
       
    96 
       
    97 public:
       
    98 
       
    99     static CVoipXmlIapHandler* NewL();
       
   100     ~CVoipXmlIapHandler();
       
   101 
       
   102 public:
       
   103 
       
   104     /**
       
   105      * Sets IAP setting.
       
   106      *
       
   107      * @since S60 v5.0
       
   108      * @param aType Type of settings.
       
   109      * @param aParam Parameter to be set.
       
   110      * @param aValue Value of the setting.
       
   111      */
       
   112     void SetSetting( TInt aType, TInt aParam, const TDesC& aValue );
       
   113 
       
   114     /**
       
   115      * Stores settings to 'XDM registry', i.e. creates an XDM collection.
       
   116      *
       
   117      * @since S60 v5.0
       
   118      * @return KErrNone if successful,
       
   119      *         KErrNotSupported if no settings to be stored,
       
   120      *         KErrCompletion if settings could not be stored.
       
   121      */
       
   122     TInt StoreSettings();
       
   123 
       
   124     /**
       
   125      * Returns destination ID.
       
   126      *
       
   127      * @since S60 v5.0
       
   128      * @return Destination ID.
       
   129      */
       
   130     TUint32 SettingsId();
       
   131 
       
   132     /**
       
   133      * Method to inform the handler that currently deployed settings
       
   134      * have ended. This way we will know when an IAP is ready to be
       
   135      * appended to iIaps array, or when a WEP key is ready to appended
       
   136      * to iWepKeys array.
       
   137      *
       
   138      * @since S60 v5.0
       
   139      * @param aType Type of settings.
       
   140      */
       
   141     void SettingsEnd( TInt aType );
       
   142 
       
   143 private:
       
   144 
       
   145     /**
       
   146      * Resets iCurrentIap settings, i.e. deletes its member data.
       
   147      *
       
   148      * @since S60 v5.0
       
   149      * @param aCloseArray Tells if array inside iCurrentIap is to be closed.
       
   150      */
       
   151     void ResetCurrentIap( TBool aCloseArray = EFalse );
       
   152 
       
   153     /**
       
   154      * Resets iIaps array, i.e. deletes its items member data.
       
   155      *
       
   156      * @since S60 v5.0
       
   157      * @param aCloseArray Tells if arrays inside iIaps' 
       
   158      *                    members are to be closed.
       
   159      */
       
   160     void ResetTempIapArray( TBool aCloseArray = EFalse );
       
   161 
       
   162     /**
       
   163      * Adds current IAP settings to iIaps array.
       
   164      *
       
   165      * @since S60 v5.0
       
   166      */
       
   167     void AddCurrentIapL();
       
   168 
       
   169     /**
       
   170      * Stores settings.
       
   171      *
       
   172      * @since S60 v5.0
       
   173      */
       
   174     void StoreSettingsL();
       
   175 
       
   176     /**
       
   177      * Creates an access point.
       
   178      * 
       
   179      * @since S60 v5.0
       
   180      * @param aCmManager CMManager reference.
       
   181      * @param aTempIap TTemporaryIap from which actual IAP will be created.
       
   182      * @return IAP ID.
       
   183      */
       
   184     TUint32 CreateIapL( RCmManagerExt& aCmManager, TTemporaryIap aTempIap );
       
   185 private:
       
   186 
       
   187     CVoipXmlIapHandler();
       
   188     void ConstructL();
       
   189 
       
   190 private:
       
   191 
       
   192     /**
       
   193      * Tells if any settings have been set to temporary profile.
       
   194      */
       
   195     TBool iSettingsSet;
       
   196 
       
   197     /**
       
   198      * Name of destination. If this is empty when saving settings,
       
   199      * destination will not be created.
       
   200      * Own.
       
   201      */
       
   202     HBufC* iDestinationName;
       
   203 
       
   204     /**
       
   205      * ID of destination.
       
   206      */
       
   207     TUint32 iDestinationId;
       
   208 
       
   209     /**
       
   210      * Access point that is being currently handled.
       
   211      */
       
   212     TTemporaryIap iCurrentIap;
       
   213 
       
   214     /**
       
   215      * Array for temporary IAP's.
       
   216      */
       
   217     RPointerArray<TTemporaryIap> iIaps;
       
   218     };
       
   219 
       
   220 #endif // VOIPXMLIAPHANDLER_H
       
   221 
       
   222 // End of file.