|
1 /* |
|
2 * Copyright (c) 2004-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 : cellulardataUsagemonitor.h |
|
16 * Part of : ConnectionMgr |
|
17 * See class definition below. |
|
18 */ |
|
19 |
|
20 /** |
|
21 @internalComponent |
|
22 */ |
|
23 |
|
24 #ifndef CSIPCELLULARDATAUSAGEMONITOR_H |
|
25 #define CSIPCELLULARDATAUSAGEMONITOR_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include "MSipCellularDataUsageObserver.h" |
|
29 |
|
30 |
|
31 class CRepository; |
|
32 //class MSipCellularDataUsageObserver; |
|
33 |
|
34 /*This class is used to monitor the cellular Data Usage permission from the CenRep. |
|
35 * The CenRep Key that is monitored is KCurrentCellularDataUsage. |
|
36 * The value of this key will determine whether the Data usage Status for the Current Network. |
|
37 */ |
|
38 |
|
39 class CSipCellularDataUsageMonitor: public CActive |
|
40 { |
|
41 public: |
|
42 |
|
43 static CSipCellularDataUsageMonitor* NewL(MSipCellularDataUsageObserver & aObserver); |
|
44 ~CSipCellularDataUsageMonitor(); //D'tor |
|
45 MSipCellularDataUsageObserver::TCellularDataUsageStatus CellularUsageStatus(); |
|
46 |
|
47 protected: // From CActive |
|
48 |
|
49 void DoCancel(); |
|
50 void RunL(); |
|
51 TInt RunError(TInt aError); |
|
52 private: |
|
53 void ConstructL(); |
|
54 CSipCellularDataUsageMonitor(MSipCellularDataUsageObserver & aObserver); //Ctor |
|
55 void MonitorStatus(); |
|
56 void SetCellularUsageStatus(TInt aVal); |
|
57 |
|
58 private: |
|
59 CRepository* iRepository; |
|
60 MSipCellularDataUsageObserver::TCellularDataUsageStatus iPermissionStatus; |
|
61 MSipCellularDataUsageObserver & iObserver; |
|
62 private: // For testing purposes |
|
63 #ifdef CPPUNIT_TEST |
|
64 friend class CSipCellularUsageObserver_Test; |
|
65 #endif |
|
66 |
|
67 }; |
|
68 #endif |