18 #ifndef USBUINCABLECONNECTEDNOTIFIER_H |
18 #ifndef USBUINCABLECONNECTEDNOTIFIER_H |
19 #define USBUINCABLECONNECTEDNOTIFIER_H |
19 #define USBUINCABLECONNECTEDNOTIFIER_H |
20 |
20 |
21 // INCLUDES |
21 // INCLUDES |
22 |
22 |
23 #include <aknlistquerydialog.h> |
23 #include <hb/hbcore/hbdevicedialogsymbian.h> |
24 #include <AknQueryDialog.h> |
24 #include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h> |
25 |
25 |
26 #include "usbnotifier.h" // Base class |
26 #include "usbnotifier.h" // Base class |
27 // CLASS DECLARATION |
27 // CLASS DECLARATION |
28 |
28 |
29 /** |
29 /** |
30 * This class is used to show query related to the USB cable connection |
30 * This class is used to show query related to the USB cable connection |
31 * |
31 * |
32 * @lib |
32 * @lib |
33 */ |
33 */ |
34 NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase, |
34 NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase, |
35 public MEikCommandObserver |
35 public MHbDeviceNotificationDialogObserver |
36 { |
36 { |
37 public: |
37 public: |
38 // Constructors and destructor |
38 // Constructors and destructor |
39 |
39 |
40 /** |
40 /** |
64 * @return None. |
64 * @return None. |
65 */ |
65 */ |
66 void Cancel(); |
66 void Cancel(); |
67 |
67 |
68 /** |
68 /** |
69 * From CUSBUINotifierBase Gets called when a request completes. |
|
70 * @param None. |
|
71 * @return None. |
|
72 */ |
|
73 void RunL(); |
|
74 |
|
75 /** |
|
76 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
69 * From CUSBUINotifierBase Used in asynchronous notifier launch to |
77 * store received parameters into members variables and |
70 * store received parameters into members variables and |
78 * make needed initializations. |
71 * make needed initializations. |
79 * @param aBuffer A buffer containing received parameters |
72 * @param aBuffer A buffer containing received parameters |
80 * @param aReplySlot a Reply slot. |
73 * @param aReplySlot a Reply slot. |
81 * @param aMessage Should be completed when the notifier is deactivated. |
74 * @param aMessage Should be completed when the notifier is deactivated. |
82 * @return None. |
75 * @return None. |
83 */ |
76 */ |
84 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, |
77 void StartDialogL(const TDesC8& aBuffer, TInt aReplySlot, |
85 const RMessagePtr2& aMessage); |
78 const RMessagePtr2& aMessage); |
86 |
79 |
|
80 |
|
81 private: |
|
82 // functions from MHbDeviceNotificationDialogObserver |
87 /** |
83 /** |
88 * Handles the command on USB connected note |
84 * Callback function which is called when the dialog is tapped |
89 */ |
85 */ |
90 void ProcessCommandL(TInt aCommandId); |
86 void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog); |
|
87 /** |
|
88 * Callback function which is called when the dialog is closed |
|
89 */ |
|
90 void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, |
|
91 TInt aCompletionCode); |
91 |
92 |
92 private: |
93 private: |
93 //New functions |
94 //New functions |
94 /** |
95 /** |
95 * Get the ID for current USB personality mode |
96 * Get the ID for current USB personality mode |
96 * @param aCurrentPersonality current personality id |
97 * @param aCurrentPersonality current personality id |
97 */ |
98 */ |
98 void GetCurrentIdL(TInt& aCurrentPersonality); |
99 void GetCurrentIdL(TInt& aCurrentPersonality); |
99 |
|
100 /** |
100 /** |
101 * Get the mode name and header for current personality |
101 * Get the mode name and header for current personality |
|
102 * The parameters are pushed to the cleanup stack in order |
|
103 * aDescription, aHeader. |
102 * @param aDescription The returned current personality string. |
104 * @param aDescription The returned current personality string. |
103 * @param aHeader The header string for message query. |
105 * @param aHeader The header string for message query. |
104 */ |
106 */ |
105 void GetPersonalityStringL(HBufC*& aHeader,HBufC*& aDescription ); |
107 void GetPersonalityStringLC(HBufC*& aHeader,HBufC*& aDescription ); |
106 |
108 |
107 /** |
109 /** |
108 * Runs the connected discreet note |
110 * launches the (USB) application |
109 */ |
111 * @param aProcessName The process name (*.exe) |
110 void RunQueryL(); |
|
111 |
|
112 /** |
|
113 * creates the USB UI setting view |
|
114 * @param aProcessName The process name (USBClassChangeUI.exe) |
|
115 * @param TUidType |
112 * @param TUidType |
116 */ |
113 */ |
117 void CreateChosenViewL(const TDesC & aProcessName,const TUidType & aUidType) const; |
114 void LaunchApplication(const TDesC & aProcessName,const TUidType & aUidType) const; |
118 |
115 |
119 private: |
116 private: |
120 /** |
117 /** |
121 * C++ default constructor. |
118 * C++ default constructor. |
122 */ |
119 */ |
123 CUSBUICableConnectedNotifier(); |
120 CUSBUICableConnectedNotifier(); |
124 |
121 |
125 /** |
122 CHbDeviceNotificationDialogSymbian* iDialog; |
126 * Waiter for canceling notifier. Canceling is not posible when note is visible |
|
127 */ |
|
128 CActiveSchedulerWait iNoteWaiter; |
|
129 |
|
130 /** |
|
131 * Note visible |
|
132 */ |
|
133 TBool iNoteVisible; |
|
134 |
|
135 /** |
|
136 * Note tapped |
|
137 */ |
|
138 TBool iNoteTapped; |
|
139 |
123 |
140 }; |
124 }; |
141 |
|
142 #endif // USBUINCABLECONNECTEDNOTIFIER_H |
125 #endif // USBUINCABLECONNECTEDNOTIFIER_H |