creator/engine/inc/creator_connectionmethod.h
branchRCL_3
changeset 22 fad26422216a
parent 21 b3cee849fa46
child 23 f8280f3bfeb7
equal deleted inserted replaced
21:b3cee849fa46 22:fad26422216a
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __CREATORCONNECTIONSETTINGS_H__
       
    22 #define __CREATORCONNECTIONSETTINGS_H__
       
    23 
       
    24 #include "engine.h"
       
    25 #include "creator_modulebase.h"
       
    26 #include "creator_connectionmethodbase.h"
       
    27 
       
    28 #include <e32base.h>
       
    29 #include <commdb.h>
       
    30 #include <msvapi.h>
       
    31 #include <mtclreg.h>
       
    32 #include <mmsclient.h>
       
    33 
       
    34 #include <cmconnectionmethoddef.h>
       
    35 #include <cmmanagerext.h>
       
    36 #include <cmpluginwlandef.h>
       
    37 using namespace CMManager;
       
    38 
       
    39 #include <etelpckt.h>//ETel Packet API needed for enums
       
    40 
       
    41 class CCreatorEngine;
       
    42 class CConnectionSettingsParameters;
       
    43 
       
    44 class CCreatorConnectionSettings : public CCreatorConnectionSettingsBase, public MMsvSessionObserver
       
    45     {
       
    46 public: 
       
    47     static CCreatorConnectionSettings* NewL(CCreatorEngine* aEngine);
       
    48     static CCreatorConnectionSettings* NewLC(CCreatorEngine* aEngine);
       
    49     ~CCreatorConnectionSettings();
       
    50 
       
    51 private:
       
    52     CCreatorConnectionSettings();
       
    53     void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase
       
    54 
       
    55     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); // from MMsvSessionObserver
       
    56         
       
    57 public:
       
    58     TBool AskDataFromUserL( TInt aCommand ); // from MCreatorModuleBase
       
    59     
       
    60     TInt CreateConnectionSettingsEntryL(CCreatorModuleBaseParameters *aParameters);    
       
    61     TUint32 AccessPointNameToIdL(const TDesC& aAPName, TBool aAnyIfNotFound = EFalse );
       
    62     
       
    63     //Setting default connection method, if not set
       
    64     void SetDefaultCML(RCmConnectionMethodExt conMethod);
       
    65     //Set random parameters
       
    66     void SetRandomParametersL(CConnectionSettingsParameters& parameters);
       
    67     void SetRandomBearerTypeL(CConnectionSettingsParameters& parameters);
       
    68     void DeleteAllL();
       
    69     void DeleteAllCreatedByCreatorL();
       
    70 private:
       
    71     void DeleteAllDestinationsL( TBool aOnlyCreatedWithCreator );
       
    72 private:
       
    73     CCommsDatabase* iCommsDb;
       
    74     
       
    75     RCmManagerExt iCmManagerExt;
       
    76 
       
    77     CConnectionSettingsParameters* iParameters;
       
    78     
       
    79     RArray<TUint32> iEntryIds; // TUint32 RCmDestinationExt::Id()
       
    80 
       
    81 public:
       
    82     };
       
    83 
       
    84    
       
    85 class CConnectionSettingsParameters : public CCreatorModuleBaseParameters
       
    86     {
       
    87 public: 
       
    88     HBufC*          iConnectionName; // connection name
       
    89     TUint           iBearerType; // bearer type
       
    90     HBufC*          iStartPage; // start page
       
    91     TWapWSPOption   iWapWspOption; // Indicating whether connection-oriented  or connectionless API should be used.
       
    92     
       
    93     RPacketContext::TProtocolType iProtocolType; //Type of protocol EPdpTypeIPv4 or EPdpTypeIPv4
       
    94     
       
    95     HBufC*          iLoginName; // username
       
    96     TBool           iSecureAuthentication; // password authentication
       
    97     HBufC*          iLoginPass; // password
       
    98     TBool           iPromptPassword; // prompt password
       
    99     HBufC*          iGatewayAddress; // gateway address
       
   100     HBufC*          iSubnetMask;  // subnet mask
       
   101     HBufC*          iIPAddr; // phone IP
       
   102     HBufC*          iIP4NameServer1;  // primary name server
       
   103     HBufC*          iIP4NameServer2;  // secondary name server
       
   104     HBufC*          iDefaultTelNumber; // datacall number
       
   105     TUint32         iBearerCallTypeIsdn; // datacall type
       
   106     TUint32         iBearerSpeed;  // max connection speed
       
   107     TBool           iUseProxy; //Use proxy or not
       
   108     HBufC*          iProxyServerAddress;  // proxy address
       
   109     TUint32         iProxyPortNumber; // proxy number
       
   110     HBufC*          iWLANName;//WLAN network name
       
   111     HBufC*          iWlanIpAddr;//IP address of EPOC.
       
   112     TWlanSecMode    iWLanSecMode;//WLAN security modes
       
   113     TWlanNetMode    iWlanNetMode;//WLAN connection mode. Ad-hoc or infrastructure.
       
   114 
       
   115     HBufC*          iIP6NameServer1;  // primary name server for IP v6
       
   116     HBufC*          iIP6NameServer2;  // secondary name server for IP v6
       
   117     TBool           iDisableTextAuth; // Disable plaintext authentication 
       
   118     
       
   119     CCreatorEngine* iEngine;
       
   120     
       
   121 public:
       
   122     CConnectionSettingsParameters();
       
   123     ~CConnectionSettingsParameters();   
       
   124     
       
   125     void SetRandomCMNameL(CCreatorEngine& aEngine);
       
   126     void SetRandomWLANNameL(CCreatorEngine& aEngine);
       
   127     void SetRandomWLANNetModeL(CCreatorEngine& aEngine);
       
   128     void SetRandomWLANSecurityModeL(CCreatorEngine& aEngine);
       
   129     void SetRandomLoginNameL(CCreatorEngine& aEngine);
       
   130     void SetRandomLoginPassL(CCreatorEngine& aEngine);
       
   131     void SetRandomSecureAuthenticationL(CCreatorEngine& aEngine);
       
   132     void SetRandomPromptPasswordL(CCreatorEngine& aEngine);
       
   133     void SetRandomUseProxyL(CCreatorEngine& aEngine);
       
   134     void SetRandomProxyAddressL(CCreatorEngine& aEngine);
       
   135     void SetRandomProxyPortL(CCreatorEngine& aEngine);
       
   136     void SetRandomStartPageL(CCreatorEngine& aEngine);
       
   137     void SetRandomIPAddressL(CCreatorEngine& aEngine);
       
   138     void SetRandomIP4NameServer1L(CCreatorEngine& aEngine);
       
   139     void SetRandomIP4NameServer2L(CCreatorEngine& aEngine);
       
   140     void SetRandomProtocolTypeL(CCreatorEngine& aEngine);
       
   141     void SetRandomTelephoneNumberL(CCreatorEngine& aEngine);
       
   142     void SetRandomBearerTypeIsdnL(CCreatorEngine& aEngine);
       
   143     void SetRandomBearerSpeedL(CCreatorEngine& aEngine);
       
   144     void SetRandomWapWspOptionL(CCreatorEngine& aEngine);
       
   145     void SetRandomSubnetMaskL(CCreatorEngine& aEngine);
       
   146     void SetRandomGatewayAddressL(CCreatorEngine& aEngine);
       
   147     void SetRandomWlanIpAddrL(CCreatorEngine& aEngine);
       
   148     void SetRandomIPv6NameServer1L(CCreatorEngine& aEngine);
       
   149     void SetRandomIPv6NameServer2L(CCreatorEngine& aEngine);
       
   150     void SetRandomDisableTextAuthL(CCreatorEngine& aEngine);
       
   151     };
       
   152 
       
   153 
       
   154 
       
   155 #endif // __CREATORCONNECTIONSETTINGS_H__