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