|
1 /* |
|
2 * Copyright (c) 2002-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: 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 private: |
|
84 |
|
85 /** |
|
86 * C++ default constructor. |
|
87 * @param aUtils Reference to SAT Utils |
|
88 */ |
|
89 CSatApnHandler( MSatUtils& aUtils ); |
|
90 |
|
91 /** |
|
92 * create a new connection method in case, access point does not exist |
|
93 * @param aReqApn Formatted required access point name. |
|
94 * @param aUserLogin User name |
|
95 * @param aUserPwd Password |
|
96 * @param aIapId, after completion, holds the IAP id of the new APN |
|
97 * @param aNwId, after completion, holds the Network id of the new APN |
|
98 * @param aPdpType, indicates whether the address type is IPv4 or IPv6 |
|
99 * @param aLocalAddress, represents the Local Address provided by NAA |
|
100 */ |
|
101 void InsertRecordL( |
|
102 const TDesC& aReqApn, |
|
103 const RSat::TTextString& aUserLogin, |
|
104 const RSat::TTextString& aUserPwd, |
|
105 TUint32& aIapId, |
|
106 TUint32& aNwId, |
|
107 const RPacketContext::TProtocolType aPdpType, |
|
108 const TDesC8& aLocalAddress ); |
|
109 |
|
110 /** |
|
111 * Formats the APN from SIM into correct format. |
|
112 * @param aReqApn Accesspoint to format |
|
113 * @return Returns formatted APN in an HBufC |
|
114 * Invoker is responsible to release |
|
115 * the memory! |
|
116 */ |
|
117 HBufC* FormatAPN( const RSat::TAccessName& aReqApn ) const; |
|
118 |
|
119 private: // Data |
|
120 |
|
121 // Reference to command container |
|
122 MSatUtils& iUtils; |
|
123 |
|
124 }; |
|
125 |
|
126 #endif // CSATAPNHANDLER_H |
|
127 |
|
128 // End of File |