|
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 : NetworkInfo.h |
|
16 * Part of : ConnectionMgr |
|
17 * Version : SIP/4.0 |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef __NETWORKINFO_H__ |
|
30 #define __NETWORKINFO_H__ |
|
31 |
|
32 // INCLUDES |
|
33 #include <etelmm.h> |
|
34 #include <stringpool.h> |
|
35 #include "sipnetworkinfoobserver.h" |
|
36 #include "sipaccessnetworkinfo.h" |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CNetworkManager; |
|
40 class CSIPRequest; |
|
41 |
|
42 |
|
43 // CLASS DEFINITION |
|
44 /** |
|
45 * Observes the network mode and |
|
46 */ |
|
47 class CNetworkInfo : |
|
48 public CBase, |
|
49 public MSIPNetworkInfoObserver |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 static CNetworkInfo* NewL(CNetworkManager& aNetworkManager); |
|
53 |
|
54 ~CNetworkInfo(); |
|
55 |
|
56 public: // From MSIPNetworkInfoObserver |
|
57 void InfoChanged( const TSIPAccessNetworkInfo& aInfo ); |
|
58 |
|
59 public: // New functions |
|
60 void HandleRequestL( CSIPRequest& aRequest, |
|
61 TBool aIntegrityProtected ); |
|
62 |
|
63 private: |
|
64 CNetworkInfo(CNetworkManager& aNetworkManager); |
|
65 |
|
66 void ConstructL(); |
|
67 |
|
68 void TranslateInfoL(); |
|
69 |
|
70 void DetermineAccessType(); |
|
71 |
|
72 void DetermineAccessInfoL(); |
|
73 |
|
74 void AddHeaderL( CSIPRequest& aRequest ); |
|
75 |
|
76 private: // Data |
|
77 //Source where the network info is retrieved |
|
78 CNetworkManager& iNetworkManager; |
|
79 |
|
80 //Copy of the access network info, obtained from a plugin |
|
81 TSIPAccessNetworkInfo iInfo; |
|
82 |
|
83 //Network model. Updated on reception of |
|
84 //MSIPNetworkInfoObserver::InfoChanged |
|
85 RStringF iAccessType; |
|
86 |
|
87 //Computed on reception of MSIPNetworkInfoObserver::InfoChanged |
|
88 RStringF iAccessInfoValue; |
|
89 |
|
90 RStringF i3gppGeran; |
|
91 RStringF i3gppUtranFdd; |
|
92 RStringF i3gppUtranTdd; |
|
93 RStringF i3gppCdma2000; |
|
94 |
|
95 private: // For unit tests |
|
96 #ifdef CPPUNIT_TEST |
|
97 friend class CNetworkInfoStub; |
|
98 friend class CNetworkInfoTest; |
|
99 #endif |
|
100 }; |
|
101 |
|
102 |
|
103 #endif // end of __NETWORKINFO_H__ |
|
104 |
|
105 // End of File |