|
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // This contains CUnsolicitedEventMonitor which mornitor the arriving unsocilited event and then notify this to all observers. |
|
15 // |
|
16 |
|
17 #ifndef UNSOLICITEDEVENTMONITOR_H_ |
|
18 #define UNSOLICITEDEVENTMONITOR_H_ |
|
19 |
|
20 //system include |
|
21 |
|
22 //user include |
|
23 #include "atcommandcontrolbase.h" |
|
24 #include "globalphonemanager.h" |
|
25 #include "atunsolicitedobserver.h" |
|
26 #include <ctsy/ltsy/cctsydispatchercallback.h> |
|
27 |
|
28 /** |
|
29 * This is a watcher class which mornitor the unsolicited events sent by baseband. |
|
30 * Notify all the interesting observers when an unsolicited event has been received |
|
31 */ |
|
32 class CUnsolicitedEventMonitor : public CATCommandControlBase |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Factory function |
|
37 */ |
|
38 static CUnsolicitedEventMonitor* NewL(CGlobalPhonemanager& aPhoneglobals, |
|
39 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
40 |
|
41 /** |
|
42 * Factory function |
|
43 */ |
|
44 static CUnsolicitedEventMonitor* NewLC(CGlobalPhonemanager& aPhoneglobals, |
|
45 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
46 |
|
47 /** |
|
48 * Destructor |
|
49 */ |
|
50 virtual ~CUnsolicitedEventMonitor(); |
|
51 |
|
52 /** |
|
53 * Add the observer which is interested in geting the notification of incoming unsolicited event |
|
54 */ |
|
55 void AddUnsolicitedObserver(const MLtsyUnsolicitedCommandObserver* aObserver); |
|
56 |
|
57 /** |
|
58 * Remove the unsolicited observer |
|
59 */ |
|
60 void RemoveUnsolicitedObserver(const MLtsyUnsolicitedCommandObserver* aObserver); |
|
61 |
|
62 /** |
|
63 * Notify all the observers that the unsoclicited event is received |
|
64 */ |
|
65 void NotifyEveryObserver(); |
|
66 |
|
67 /** |
|
68 * Start to mornitor |
|
69 */ |
|
70 void StartUnsolicitedObserver(); |
|
71 |
|
72 /** |
|
73 * Stop to mornitor |
|
74 */ |
|
75 void StopUnsolicitedObserver(); |
|
76 |
|
77 protected: |
|
78 /** |
|
79 * The constructor |
|
80 */ |
|
81 CUnsolicitedEventMonitor(CGlobalPhonemanager& aPhoneglobals, |
|
82 CCtsyDispatcherCallback& aCtsyDispatcherCallback); |
|
83 |
|
84 /** |
|
85 * 2nd constructor |
|
86 */ |
|
87 void ConstructL(); |
|
88 |
|
89 public: |
|
90 /** |
|
91 * Inherit from CAtCommandContolBase |
|
92 */ |
|
93 virtual void AtCommandExecuteComplete(TAtEventSource aEventSource, TInt aStatus); |
|
94 |
|
95 private: |
|
96 /** |
|
97 * Own |
|
98 * Store a list of observers |
|
99 */ |
|
100 RPointerArray <MLtsyUnsolicitedCommandObserver> iArray; |
|
101 }; |
|
102 |
|
103 #endif /*UNSOLICITEDEVENTMONITOR_H_*/ |