9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Declares USB UI Queries notifier. |
14 * Description: Declares USB UI OTG Errors notifier. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef USBUINOTIFOTGERROR_H |
19 #ifndef USBUINOTIFOTGERROR_H |
20 #define USBUINOTIFOTGERROR_H |
20 #define USBUINOTIFOTGERROR_H |
21 |
21 |
22 // INCLUDES |
22 // INCLUDES |
|
23 #include <hb/hbwidgets/hbdevicemessageboxsymbian.h> |
|
24 #include "usbnotifier.h" // Base class |
23 |
25 |
24 #include "usbnotifier.h" // Base class |
|
25 #include <AknQueryDialog.h> // AVKON component |
|
26 #include "usbuinotifdialerwatcher.h" |
|
27 |
26 |
28 #define KUsbUiNotifOtgGeneralQueryGranularity 3 |
|
29 // CLASS DECLARATION |
27 // CLASS DECLARATION |
30 |
28 |
31 /** |
29 /** |
32 * This class is used to show general USB query. |
30 * This class is used to show general USB OTG errors |
33 * Asynchronous call is required. |
31 * Asynchronous call is required. |
34 * |
32 * |
35 * @lib |
33 * @lib |
36 */ |
34 */ |
37 NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase, public MDialerNotifier |
35 NONSHARABLE_CLASS(CUsbUiNotifOtgError) : public CUSBUINotifierBase, |
|
36 public MHbDeviceMessageBoxObserver |
38 { |
37 { |
39 public: |
38 public: |
40 // Constructors and destructor |
39 // Constructors and destructor |
41 |
40 |
42 /** |
41 /** |
46 |
45 |
47 /** |
46 /** |
48 * Destructor. |
47 * Destructor. |
49 */ |
48 */ |
50 virtual ~CUsbUiNotifOtgError(); |
49 virtual ~CUsbUiNotifOtgError(); |
51 |
50 |
|
51 /** |
|
52 * Call back function to observe device message box closing. |
|
53 * @param aMessageBox Pointer to the closing message box instance. |
|
54 * @param aButton Button that was pressed. |
|
55 */ |
|
56 void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, |
|
57 CHbDeviceMessageBoxSymbian::TButtonId aButton); |
52 protected: |
58 protected: |
53 |
59 |
54 /** |
60 /** |
55 * Second phase contructor |
61 * Second phase contructor |
56 */ |
62 */ |
71 * so resources can be freed and outstanding messages completed. |
77 * so resources can be freed and outstanding messages completed. |
72 */ |
78 */ |
73 void Cancel(); |
79 void Cancel(); |
74 |
80 |
75 /** |
81 /** |
76 * From CUSBUINotifierBase Gets called when a request completes. |
|
77 */ |
|
78 void RunL(); |
|
79 |
|
80 /** |
|
81 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
82 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
82 * store received parameters into members variables and |
83 * store received parameters into members variables and |
83 * make needed initializations. |
84 * make needed initializations. |
84 * @param aBuffer A buffer containing received parameters |
85 * @param aBuffer A buffer containing received parameters |
85 * @param aReplySlot A reply slot. |
86 * @param aReplySlot A reply slot. |
86 * @param aMessage Should be completed when the notifier is deactivated. |
87 * @param aMessage Should be completed when the notifier is deactivated. |
87 */ |
88 */ |
88 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, |
89 void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, |
89 const RMessagePtr2& aMessage); |
90 const RMessagePtr2& aMessage); |
90 |
|
91 private: |
|
92 |
|
93 /** |
|
94 * From MDialerNotifier |
|
95 * The function to be when Dialaer is activated |
|
96 * |
|
97 */ |
|
98 void DialerActivated(); |
|
99 |
|
100 /** |
|
101 * From MDialerNotifier |
|
102 * The function to be when Dialaer is deactivated |
|
103 * and note can be shown again |
|
104 * |
|
105 */ |
|
106 void ReActivateDialog(); |
|
107 |
91 |
108 private: |
92 private: |
109 |
93 |
110 /** |
94 /** |
111 * C++ default constructor. |
95 * C++ default constructor. |
112 */ |
96 */ |
113 CUsbUiNotifOtgError(); |
97 CUsbUiNotifOtgError(); |
114 |
98 |
115 private: |
99 private: |
116 // New functions |
|
117 |
|
118 /** |
|
119 * Show query dialog |
|
120 * @return KErrNone - accepted, KErrCancel - Cancel or End call key |
|
121 */ |
|
122 TInt QueryUserResponseL(); |
|
123 |
|
124 private: |
|
125 // Data |
100 // Data |
126 /** |
101 /** |
127 * Query |
102 * Query |
128 * Not own, destroys self when lauched. |
103 * Owned |
129 */ |
104 */ |
130 CAknQueryDialog* iQuery; |
105 CHbDeviceMessageBoxSymbian* iQuery; |
131 RArray<TInt> iStringIds; |
106 CDesCArrayFlat* iStringIds; |
132 TInt iErrorId; |
|
133 /** |
|
134 * Dialer watcher |
|
135 * Own. |
|
136 */ |
|
137 CUsbuinotifDialerWatcher* iDialerWatcher; |
|
138 /** |
|
139 * Dialog is dismissed. |
|
140 */ |
|
141 TBool iDismissed; |
|
142 }; |
107 }; |
143 #endif // USBUINOTIFOTGERROR_H |
108 #endif // USBUINOTIFOTGERROR_H |