|
1 /* |
|
2 * Copyright (c) 2005-2009 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 * Name : Sipimsprofileusimprovider.h |
|
16 * Part of : ProfileAgent |
|
17 * Version : SIP/4.1 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef __SIPPROFILE_USIM_PROVIDER_H__ |
|
29 #define __SIPPROFILE_USIM_PROVIDER_H__ |
|
30 |
|
31 // INCLUDES |
|
32 #include <etelmm.h> |
|
33 #include <mmretrieve.h> |
|
34 #include "msipprofileimsauthorizationdataobserver.h" |
|
35 #include "authinfoobserver.h" |
|
36 |
|
37 // FORWARD DECLARATIONS |
|
38 class CSIPProfileSIMRecord; |
|
39 class MSIPProfileIMSAuthenticationDataObserver; |
|
40 class MSIPProfileIMSAuthorizationDataObserver; |
|
41 class CSIPProfileIMSAuthorization; |
|
42 class CSIPProfileSIMAuthorization; |
|
43 class CSIPIMSProfileMCCandMNC; |
|
44 class CAuthInfoMonitor; |
|
45 |
|
46 /** |
|
47 * @brief Class |
|
48 * |
|
49 * @class CSIPProfileUsimProvider CSIPProfileUsimProvider.h |
|
50 * "CSIPProfileUsimProvider.h" |
|
51 */ |
|
52 class CSIPProfileUsimProvider : |
|
53 public CBase, |
|
54 public MSIPProfileIMSAuthorizationDataObserver, |
|
55 public MAuthInfoObserver |
|
56 { |
|
57 public: // Constructors and destructor |
|
58 |
|
59 /** |
|
60 * Constructor |
|
61 * @param aUserRecord the user record |
|
62 * @param aDeltaTimer an object used for ordering timer events |
|
63 * @return new instance, ownership is tranferred |
|
64 */ |
|
65 static CSIPProfileUsimProvider* |
|
66 NewL( CSIPProfileSIMRecord& aUserRecord, |
|
67 RTelServer& aTelServer, |
|
68 const RTelServer::TPhoneInfo& aPhoneInfo, |
|
69 MSIPProfileIMSAuthenticationDataObserver& aObserver ); |
|
70 |
|
71 /** |
|
72 * Destructor |
|
73 */ |
|
74 ~CSIPProfileUsimProvider(); |
|
75 |
|
76 public: |
|
77 |
|
78 /** |
|
79 * Starts the retrieving of authorization information |
|
80 */ |
|
81 void RequestL(TBool aUseSIM=EFalse); |
|
82 |
|
83 /** |
|
84 * Cancels pending operations |
|
85 */ |
|
86 void Cancel(); |
|
87 |
|
88 public: //From MSIPProfileIMSAuthorizationDataObserver |
|
89 |
|
90 |
|
91 void AuthorizedL(); |
|
92 |
|
93 void AuthorizationFailed(); |
|
94 |
|
95 void AuthorizationSIMFailed(); |
|
96 |
|
97 void AuthorizedSubscriberIdL(); |
|
98 |
|
99 void AuthorizedHomeNetworkIdL(); |
|
100 |
|
101 TBool IsSIMSupported(); |
|
102 |
|
103 TBool IsUsimSupported(); |
|
104 |
|
105 public: //From MAuthInfoObserver |
|
106 |
|
107 void AuthInfoUpdatedL(); |
|
108 |
|
109 private: //methods |
|
110 |
|
111 /** |
|
112 * Constructor |
|
113 * @param aUserRecord the user record |
|
114 * where the authorization information is stored |
|
115 * homenetwork domain name, private user identity, |
|
116 * public user identity |
|
117 */ |
|
118 CSIPProfileUsimProvider( CSIPProfileSIMRecord& aUserRecord, |
|
119 MSIPProfileIMSAuthenticationDataObserver& aObserver ); |
|
120 |
|
121 /** |
|
122 * 2nd phase constructor |
|
123 */ |
|
124 void ConstructL( |
|
125 RTelServer& aTelServer, |
|
126 const RTelServer::TPhoneInfo& aPhoneInfo ); |
|
127 |
|
128 /** |
|
129 * From the retrieved IMSI/MCC/MNC values |
|
130 * the home network domain name and private user identity |
|
131 * and the public user identity are derived |
|
132 * and stored to members of CSIPProfileSIMRecord object |
|
133 */ |
|
134 void DeriveValuesL(); |
|
135 |
|
136 private: //data |
|
137 |
|
138 RMobilePhone iPhone; |
|
139 CSIPProfileIMSAuthorization* iAuthorization; |
|
140 CSIPProfileSIMAuthorization* iAuthorizationSIM; |
|
141 CSIPIMSProfileMCCandMNC* iAuthorizationHomeNetwork; |
|
142 CSIPProfileSIMRecord& iProfileSIMRecord; |
|
143 MSIPProfileIMSAuthenticationDataObserver& iObserver; |
|
144 |
|
145 TBool iSIMSupported; |
|
146 TBool iUSimSupported; |
|
147 |
|
148 // Owned |
|
149 CAuthInfoMonitor* iAuthInfoMonitor; |
|
150 |
|
151 #ifdef CPPUNIT_TEST |
|
152 friend class CSIPProfileUSimProviderTest; |
|
153 friend class CSIPIMSProfileAgentTest; |
|
154 #endif |
|
155 }; |
|
156 |
|
157 |
|
158 #endif // end of __SIPPROFILE_USIM_PROVIDER_H__ |
|
159 |
|
160 // End of File |