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 MSMM error notifier. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef USBUINOTIFMSMMERROR_H |
19 #ifndef USBUINOTIFMSMMERROR_H |
20 #define USBUINOTIFMSMMERROR_H |
20 #define USBUINOTIFMSMMERROR_H |
21 |
21 |
22 // INCLUDES |
22 // INCLUDES |
|
23 #include <hb/hbwidgets/hbdevicemessageboxsymbian.h> |
|
24 #include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h> |
|
25 #include "usbnotifier.h" // Base class |
23 |
26 |
24 #include "usbnotifier.h" // Base class |
|
25 #include <AknQueryDialog.h> // AVKON component |
|
26 #include "usbuinotifdialerwatcher.h" |
|
27 |
27 |
28 #define KUsbUiNotifOtgGeneralQueryGranularity 3 |
|
29 // CLASS DECLARATION |
28 // CLASS DECLARATION |
30 |
29 |
31 /** |
30 /** |
32 * This class is used to show general USB query. |
31 * This class is used to show general USB query. |
33 * Asynchronous call is required. |
32 * Asynchronous call is required. |
34 * |
33 * |
35 * @lib |
34 * @lib |
36 */ |
35 */ |
37 NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase, public MDialerNotifier |
36 NONSHARABLE_CLASS(CUsbUiNotifMSMMError) : public CUSBUINotifierBase, |
|
37 public MHbDeviceMessageBoxObserver, |
|
38 public MHbDeviceNotificationDialogObserver |
38 { |
39 { |
39 public: |
40 public: |
40 |
41 |
41 /** |
42 /** |
42 * Possible parameter values for KUsbUiNotifMSMMError |
43 * Indexes for the strings used in KUsbUiNotifMSMMError which are mapped to 5 errors. |
43 */ |
44 */ |
44 enum TUsbUiNotifMSMMError |
45 enum TUsbUiNotifMSMMError |
45 { |
46 { |
46 EUsbMSMMGeneralError, |
47 EUsbMSMMGeneralError, |
47 EUsbMSMMUnknownFileSystem, |
48 EUsbMSMMUnknownFileSystem, |
48 EUsbMSMMOutOfMemory |
49 EUsbMSMMOutOfMemory, |
49 }; |
50 EUsbMSMMSafeToRemove, |
|
51 EUsbMSMMUnableToEject |
|
52 }; |
|
53 |
50 // Constructors and destructor |
54 // Constructors and destructor |
51 |
55 |
52 /** |
56 /** |
53 * Two-phased constructor. |
57 * Two-phased constructor. |
54 */ |
58 */ |
81 * so resources can be freed and outstanding messages completed. |
93 * so resources can be freed and outstanding messages completed. |
82 */ |
94 */ |
83 void Cancel(); |
95 void Cancel(); |
84 |
96 |
85 /** |
97 /** |
86 * From CUSBUINotifierBase Gets called when a request completes. |
|
87 */ |
|
88 void RunL(); |
|
89 |
|
90 /** |
|
91 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
98 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
92 * store received parameters into members variables and |
99 * store received parameters into members variables and |
93 * make needed initializations. |
100 * make needed initializations. |
94 * @param aBuffer A buffer containing received parameters |
101 * @param aBuffer A buffer containing received parameters |
95 * @param aReplySlot A reply slot. |
102 * @param aReplySlot A reply slot. |
96 * @param aMessage Should be completed when the notifier is deactivated. |
103 * @param aMessage Should be completed when the notifier is deactivated. |
97 */ |
104 */ |
98 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, |
105 void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, |
99 const RMessagePtr2& aMessage); |
106 const RMessagePtr2& aMessage); |
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * From MDialerNotifier |
|
105 * The function to be when Dialaer is activated |
|
106 * |
|
107 */ |
|
108 void DialerActivated(); |
|
109 |
|
110 /** |
|
111 * From MDialerNotifier |
|
112 * The function to be when Dialaer is deactivated |
|
113 * and note can be shown again |
|
114 * |
|
115 */ |
|
116 void ReActivateDialog(); |
|
117 |
107 |
118 private: |
108 private: |
119 |
109 |
120 /** |
110 /** |
121 * C++ default constructor. |
111 * C++ default constructor. |
122 */ |
112 */ |
123 CUsbUiNotifMSMMError(); |
113 CUsbUiNotifMSMMError(); |
124 |
114 |
125 private: |
115 private: |
126 // New functions |
116 // functions from MHbDeviceNotificationDialogObserver |
127 |
|
128 /** |
117 /** |
129 * Show query dialog |
118 * Callback function which is called when the dialog is tapped |
130 * @return KErrNone - accepted, KErrCancel - Cancel or End call key |
|
131 */ |
119 */ |
132 TInt QueryUserResponseL(); |
120 void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog); |
|
121 /** |
|
122 * Callback function which is called when the dialog is closed |
|
123 */ |
|
124 void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, |
|
125 TInt aCompletionCode); |
133 |
126 |
134 private: |
127 private: |
135 // Data |
128 // Data |
136 /** |
129 CHbDeviceMessageBoxSymbian* iQuery; |
137 * Query |
130 CHbDeviceNotificationDialogSymbian* iDiscreet; |
138 * Not own, destroys self when lauched. |
131 CDesCArrayFlat* iStringIds; |
139 */ |
132 }; |
140 CAknQueryDialog* iQuery; |
|
141 RArray<TInt> iStringIds; |
|
142 TInt iErrorId; |
|
143 /** |
|
144 * Dialer watcher |
|
145 * Own. |
|
146 */ |
|
147 CUsbuinotifDialerWatcher* iDialerWatcher; |
|
148 /** |
|
149 * Dialog is dismissed. |
|
150 */ |
|
151 TBool iDismissed; |
|
152 }; |
|
153 #endif // USBUINOTIFMSMMERROR_H |
133 #endif // USBUINOTIFMSMMERROR_H |