|
1 /* |
|
2 * Copyright (c) 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 * |
|
16 */ |
|
17 |
|
18 #ifndef CRADIOSYSTEMEVENTDETECTOR_H |
|
19 #define CRADIOSYSTEMEVENTDETECTOR_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 #include "cradiopropertyobserver.h" |
|
24 |
|
25 class MRadioSystemEventDetectorObserver; |
|
26 |
|
27 /** |
|
28 * Catches notification of the call and network state changes. |
|
29 * |
|
30 * Class provides implementation to detect system events and notify UI components of the event, |
|
31 * Class keeps several instances of CVPropertyObserver, and those instances send event notifications |
|
32 * about the particular system component state change. |
|
33 */ |
|
34 NONSHARABLE_CLASS( CRadioSystemEventDetector ) : public CBase |
|
35 , public MRadioPropertyChangeObserver |
|
36 { |
|
37 public: |
|
38 |
|
39 static CRadioSystemEventDetector* NewL( MRadioSystemEventDetectorObserver& aObserver ); |
|
40 |
|
41 virtual ~CRadioSystemEventDetector(); |
|
42 |
|
43 /** |
|
44 * Returns network coverage state ( wlan or mobile ). |
|
45 */ |
|
46 TBool IsNetworkCoverage() const; |
|
47 |
|
48 /** |
|
49 * Returns mobile network coverage state. |
|
50 */ |
|
51 TBool IsMobileNetworkCoverage() const; |
|
52 |
|
53 /** |
|
54 * Returns current call state. |
|
55 */ |
|
56 TBool IsCallActive() const; |
|
57 |
|
58 /** |
|
59 * Returns current audio resources state. |
|
60 * @return audio resources state |
|
61 */ |
|
62 TBool IsAudioResourcesAvailable() const; |
|
63 |
|
64 /** |
|
65 * Returns current Voice UI state. |
|
66 * @return ETrue if Voice UI is active, EFalse otherwise |
|
67 */ |
|
68 TBool IsVoiceUiActive() const; |
|
69 |
|
70 protected: |
|
71 |
|
72 // from base class MRadioPropertyChangeObserver |
|
73 |
|
74 void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TInt aValue ); |
|
75 void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TDesC8& aValue ); |
|
76 void HandlePropertyChangeL( const TUid& aCategory, const TUint aKey, const TDesC& aValue ); |
|
77 void HandlePropertyChangeErrorL( const TUid& aCategory, const TUint aKey, TInt aError ); |
|
78 |
|
79 private: |
|
80 |
|
81 void ConstructL(); |
|
82 |
|
83 CRadioSystemEventDetector( MRadioSystemEventDetectorObserver& aObserver ); |
|
84 |
|
85 private: // data |
|
86 |
|
87 /** Observer which will be notified of the call and network state changes*/ |
|
88 MRadioSystemEventDetectorObserver& iObserver; |
|
89 |
|
90 /** handler to Publish & Subscribe interface*/ |
|
91 CRadioPropertyObserver* iCallStatusObserver; |
|
92 /** handler to Publish & Subscribe interface*/ |
|
93 CRadioPropertyObserver* iNetworkStatusObserver; |
|
94 /** handler to Publish & Subscribe interface*/ |
|
95 CRadioPropertyObserver* iAudioPolicyObserver; |
|
96 |
|
97 /**Indicator for the mobile network status*/ |
|
98 TBool iIsMobileNetworkCoverage; |
|
99 |
|
100 /**Indicator for the call status*/ |
|
101 TBool iIsCallActive; |
|
102 |
|
103 /** Array of audio policy categories that radio must not resume after. */ |
|
104 RArray<TInt> iNoAutoResumeAudioCategories; |
|
105 |
|
106 /** Indicator for audio resource status. */ |
|
107 TBool iIsAudioResourcesAvailable; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif // CRADIOSYSTEMEVENTDETECTOR_H |