|
1 /* |
|
2 * Copyright (c) 2007, 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: Declares USB dialer activation watcher class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_USBUINOTIFDIALERWATCHER_H |
|
19 #define C_USBUINOTIFDIALERWATCHER_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <coecntrl.h> |
|
23 #include <viewclipartner.h> |
|
24 #include <viewcli.h> |
|
25 |
|
26 |
|
27 /** |
|
28 * Dialer activation callback |
|
29 * |
|
30 * This class specifies the functions when dialer is activated |
|
31 * or note can be reactivated |
|
32 * |
|
33 */ |
|
34 class MDialerNotifier |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * The function to be when Dialaer is activated |
|
39 * |
|
40 */ |
|
41 virtual void DialerActivated() = 0; |
|
42 |
|
43 /** |
|
44 * The function to be when Dialaer is deactivated |
|
45 * and note can be shown again |
|
46 * |
|
47 */ |
|
48 virtual void ReActivateDialog() = 0; |
|
49 }; |
|
50 |
|
51 /** |
|
52 * |
|
53 * This class will check if application key is pressed when error note is active. |
|
54 * When application key is pressed dialer view is activated and error notifier is |
|
55 * informed so it can dismis dialog. When dialer is deactivated error notifier is |
|
56 * notified that dialog can be again shown. |
|
57 * |
|
58 */ |
|
59 NONSHARABLE_CLASS( CUsbuinotifDialerWatcher): public CCoeControl, |
|
60 public MVwsSessionWrapperObserver |
|
61 |
|
62 { |
|
63 public: |
|
64 /** |
|
65 * Two-phased constructor. |
|
66 * @param aDialerKeyNotifier Callback interface for dialer activation/deactivation |
|
67 * @return dialer watcher |
|
68 */ |
|
69 |
|
70 static CUsbuinotifDialerWatcher* NewL( MDialerNotifier* aDialerNotifier ); |
|
71 |
|
72 /** |
|
73 * Two-phased constructor. |
|
74 * @param aDialerKeyNotifier Callback interface for dialer activation/deactivation |
|
75 * @return dialer watcher |
|
76 */ |
|
77 static CUsbuinotifDialerWatcher* NewLC( MDialerNotifier* aDialerNotifier ); |
|
78 |
|
79 /** |
|
80 * Destructor |
|
81 */ |
|
82 virtual ~CUsbuinotifDialerWatcher(); |
|
83 |
|
84 private: |
|
85 |
|
86 /** |
|
87 * From CCoeControl |
|
88 * @param aKeyEvent Key Event |
|
89 * @param aType Type of event |
|
90 */ |
|
91 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
92 |
|
93 private: |
|
94 |
|
95 /** |
|
96 * From MVwsSessionWrapperObserver |
|
97 * @param aEvent View event |
|
98 */ |
|
99 void HandleViewEventL(const TVwsViewEvent &aEvent); |
|
100 |
|
101 |
|
102 private: |
|
103 |
|
104 /** |
|
105 * Constructor |
|
106 * @param aDialerKeyNotifier Callback interface for dialer activation/deactivation |
|
107 */ |
|
108 CUsbuinotifDialerWatcher( MDialerNotifier* aDialerKeyNotifier ); |
|
109 |
|
110 /** |
|
111 * Two-phased constructor. |
|
112 */ |
|
113 void ConstructL(); |
|
114 |
|
115 private: |
|
116 // Member variables |
|
117 |
|
118 /** |
|
119 * The observer for this objects events |
|
120 * Not own. |
|
121 */ |
|
122 MDialerNotifier* iNotify; |
|
123 |
|
124 /** |
|
125 * The observer for this objects events |
|
126 * Own. |
|
127 */ |
|
128 CVwsSessionWrapper* iwsSession; |
|
129 |
|
130 /** |
|
131 * Is notifier allready notified. |
|
132 */ |
|
133 TBool iNotified; |
|
134 }; |
|
135 #endif // C_USBUINOTIFDIALERWATCHER_H |