33
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-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: Handles APN operations
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#ifndef CSATAPNHANDLER_H
|
|
21 |
#define CSATAPNHANDLER_H
|
|
22 |
|
|
23 |
// INCLUDES
|
|
24 |
#include <e32base.h>
|
|
25 |
#include "MSatApnHandler.h"
|
|
26 |
|
|
27 |
class MSatUtils;
|
|
28 |
|
|
29 |
/**
|
|
30 |
* Handles the Access point operations with CMManager. Searches, inserts and
|
|
31 |
* deletes APNs, if neccessary
|
|
32 |
*
|
|
33 |
* @lib SatEngine
|
|
34 |
* @since S60 3.0
|
|
35 |
*/
|
|
36 |
class CSatApnHandler : public CBase,
|
|
37 |
public MSatApnHandler
|
|
38 |
{
|
|
39 |
public: // Constructors and destructor
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Two-phased constructor.
|
|
43 |
* @param aUtils Reference to SAT Utils
|
|
44 |
*/
|
|
45 |
static CSatApnHandler* NewL( MSatUtils& aUtils );
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Destructor.
|
|
49 |
*/
|
|
50 |
virtual ~CSatApnHandler();
|
|
51 |
|
|
52 |
public: // Functions from MSatApnHandler
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Locates APN from CMManager, creates new APN if not found, and
|
|
56 |
* returns IAP id and Network ID in referenced parameters
|
|
57 |
* @param aName Accesspoint to locate / create
|
|
58 |
* @param aUserLogin, User name in case new APN is needed
|
|
59 |
* @param aUserPwd, Password in case, new APN is needed
|
|
60 |
* @param aIapId, after completion, holds the IAP id of the APN
|
|
61 |
* @param aNwId, after completion, holds the Network id of the APN
|
|
62 |
* @param aApnCreated indicates is new APN created
|
|
63 |
* @param aPdpType, indicates whether the address type is IPv4 or IPv6
|
|
64 |
* @param aLocalAddress, represents the Local Address provided by NAA
|
|
65 |
*/
|
|
66 |
void GetApnInfoL(
|
|
67 |
const RSat::TAccessName& aName,
|
|
68 |
const RSat::TTextString& aUserLogin,
|
|
69 |
const RSat::TTextString& aUserPwd,
|
|
70 |
TUint32& aIapId,
|
|
71 |
TUint32& aNwId,
|
|
72 |
TBool& aApnCreated,
|
|
73 |
const RPacketContext::TProtocolType& aPdpType,
|
|
74 |
const TDesC8& aLocalAddress );
|
|
75 |
|
|
76 |
/**
|
|
77 |
* Deletes the connection method with given APN ID. Note that aApnId is
|
|
78 |
* the same id that GetApnInfoL returns in aNwId.
|
|
79 |
* @param aApnId APN to delete
|
|
80 |
*/
|
|
81 |
void DeleteApnL( TUint32 aApnId );
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Find the default APN Id
|
|
85 |
* @param aPdpType, indicates the address type is IPv4 or IPv6
|
|
86 |
* @return a default iap id
|
|
87 |
*/
|
|
88 |
TUint32 FindDefaultApL(
|
|
89 |
const RPacketContext::TProtocolType& aPdpType );
|
|
90 |
private:
|
|
91 |
|
|
92 |
/**
|
|
93 |
* C++ default constructor.
|
|
94 |
* @param aUtils Reference to SAT Utils
|
|
95 |
*/
|
|
96 |
CSatApnHandler( MSatUtils& aUtils );
|
|
97 |
|
|
98 |
/**
|
|
99 |
* create a new connection method in case, access point does not exist
|
|
100 |
* @param aReqApn Formatted required access point name.
|
|
101 |
* @param aUserLogin User name
|
|
102 |
* @param aUserPwd Password
|
|
103 |
* @param aIapId, after completion, holds the IAP id of the new APN
|
|
104 |
* @param aNwId, after completion, holds the Network id of the new APN
|
|
105 |
* @param aPdpType, indicates whether the address type is IPv4 or IPv6
|
|
106 |
* @param aLocalAddress, represents the Local Address provided by NAA
|
|
107 |
*/
|
|
108 |
void InsertRecordL(
|
|
109 |
const TDesC& aReqApn,
|
|
110 |
const RSat::TTextString& aUserLogin,
|
|
111 |
const RSat::TTextString& aUserPwd,
|
|
112 |
TUint32& aIapId,
|
|
113 |
TUint32& aNwId,
|
|
114 |
const RPacketContext::TProtocolType aPdpType,
|
|
115 |
const TDesC8& aLocalAddress );
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Formats the APN from SIM into correct format.
|
|
119 |
* @param aReqApn Accesspoint to format
|
|
120 |
* @return Returns formatted APN in an HBufC
|
|
121 |
* Invoker is responsible to release
|
|
122 |
* the memory!
|
|
123 |
*/
|
|
124 |
HBufC* FormatAPN( const RSat::TAccessName& aReqApn ) const;
|
|
125 |
|
|
126 |
private: // Data
|
|
127 |
|
|
128 |
// Reference to command container
|
|
129 |
MSatUtils& iUtils;
|
|
130 |
|
|
131 |
};
|
|
132 |
|
|
133 |
#endif // CSATAPNHANDLER_H
|
|
134 |
|
|
135 |
// End of File
|