17 |
17 |
18 #ifndef USBUINQUERIESNOTIFIER_H |
18 #ifndef USBUINQUERIESNOTIFIER_H |
19 #define USBUINQUERIESNOTIFIER_H |
19 #define USBUINQUERIESNOTIFIER_H |
20 |
20 |
21 // INCLUDES |
21 // INCLUDES |
|
22 #include <hb/hbwidgets/hbdevicemessageboxsymbian.h> |
|
23 #include "usbnotifier.h" // Base class |
22 |
24 |
23 #include "usbnotifier.h" // Base class |
25 |
24 #include <AknQueryDialog.h> // AVKON component |
|
25 // CLASS DECLARATION |
26 // CLASS DECLARATION |
26 |
27 |
27 /** |
28 /** |
28 * This class is used to show USB query dialogs. |
29 * This class is used to show USB query dialogs. |
29 * |
30 * |
30 * @lib |
31 * @lib |
31 * @since S60 3.0 |
32 * @since S60 3.0 |
32 */ |
33 */ |
33 NONSHARABLE_CLASS(CUSBUIQueriesNotifier) : public CUSBUINotifierBase |
34 NONSHARABLE_CLASS(CUSBUIQueriesNotifier) : public CUSBUINotifierBase, |
|
35 public MHbDeviceMessageBoxObserver |
34 { |
36 { |
35 public: |
37 public: |
36 // Constructors and destructor |
38 // Constructors and destructor |
37 |
39 |
38 /** |
40 /** |
62 * @return None. |
72 * @return None. |
63 */ |
73 */ |
64 void Cancel(); |
74 void Cancel(); |
65 |
75 |
66 /** |
76 /** |
67 * From CUSBUINotifierBase Gets called when a request completes. |
|
68 * @param None. |
|
69 * @return None. |
|
70 */ |
|
71 void RunL(); |
|
72 |
|
73 /** |
|
74 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
77 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
75 * store received parameters into members variables and |
78 * store received parameters into members variables and |
76 * make needed initializations. |
79 * make needed initializations. |
77 * @param aBuffer A buffer containing received parameters |
80 * @param aBuffer A buffer containing received parameters |
78 * @param aReplySlot A reply slot. |
81 * @param aReplySlot A reply slot. |
79 * @param aMessage Should be completed when the notifier is deactivated. |
82 * @param aMessage Should be completed when the notifier is deactivated. |
80 * @return None. |
83 * @return None. |
81 */ |
84 */ |
82 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, |
85 void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, |
83 const RMessagePtr2& aMessage); |
86 const RMessagePtr2& aMessage); |
84 |
87 |
85 private: |
88 private: |
86 /* |
89 |
87 * From MEikSrvNotifierBase2 Synchronic notifier launch. |
|
88 * @param aBuffer Received parameter data. |
|
89 * @return A pointer to return value. |
|
90 */ |
|
91 virtual TPtrC8 StartL(const TDesC8& aBuffer); |
|
92 |
|
93 /** |
90 /** |
94 * C++ default constructor. |
91 * C++ default constructor. |
95 */ |
92 */ |
96 CUSBUIQueriesNotifier(); |
93 CUSBUIQueriesNotifier(); |
97 |
94 |
98 private: |
|
99 // New functions |
|
100 |
|
101 /** |
|
102 * Show query dialog |
|
103 * @param aStringHolder The string for the query. |
|
104 * @param aCoverDialogId The dialog ID for the cover UI. |
|
105 * @param aIsCancelKey Does the dialog show Cancel key. |
|
106 * @return KErrNone - accepted, KErrCancel - Cancel or End call key |
|
107 */ |
|
108 TInt QueryUserResponseL(const TDesC& aStringHolder, TInt aCoverDialogId, |
|
109 TBool aIsCancelKey, TBool aIsErrorQuery); |
|
110 |
|
111 /** |
|
112 * Get attributes for the query dialog |
|
113 * The query type is idenfied by the member variable iQueryType. |
|
114 * The caller should pop and destroy the returned heap descriptor |
|
115 * when it is no longer needed. |
|
116 * @param aCoverDialogId Returned dialog ID for the cover UI. |
|
117 * @param aIsCancelKey Returned info about showing the Cancel key. |
|
118 * @return The string holder for the query. |
|
119 */ |
|
120 HBufC* GetQueryAttributesLC(TInt& aCoverDialogId, TBool& aIsCancelKey, TBool& aIsErrorQuery); |
|
121 |
95 |
122 private: |
96 private: |
123 // Data |
97 // Data |
124 |
98 |
125 /** |
99 /** |
126 * Not own, destroys self when lauched. |
100 * owned |
127 */ |
101 */ |
128 CAknQueryDialog* iUSBQueryDlg; |
102 CHbDeviceMessageBoxSymbian* iUSBQueryDlg; |
129 TUSBUIQueries iQueryType; // To store the type of the query |
103 TUSBUIQueries iQueryType; // To store the type of the query |
130 |
104 |
131 }; |
105 }; |
132 #endif // USBUINQUERIESNOTIFIER_H |
106 #endif // USBUINQUERIESNOTIFIER_H |