|
1 /* |
|
2 * Copyright (c) 2005-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 Cable Connected notifier class. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef USBUINCABLECONNECTEDNOTIFIER_H |
|
19 #define USBUINCABLECONNECTEDNOTIFIER_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <aknlistquerydialog.h> |
|
24 #include <AknQueryDialog.h> |
|
25 |
|
26 #include "usbnotifier.h" // Base class |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * This class is used to show query related to the USB cable connection |
|
31 * |
|
32 * @lib |
|
33 */ |
|
34 NONSHARABLE_CLASS(CUSBUICableConnectedNotifier) : public CUSBUINotifierBase, |
|
35 public MEikCommandObserver |
|
36 { |
|
37 public: |
|
38 // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 static CUSBUICableConnectedNotifier* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CUSBUICableConnectedNotifier(); |
|
49 |
|
50 private: |
|
51 // Functions from base class |
|
52 |
|
53 /** |
|
54 * From CUSBUINotifierBase Called when a notifier is first loaded. |
|
55 * @param None. |
|
56 * @return A structure containing priority and channel info. |
|
57 */ |
|
58 TNotifierInfo RegisterL(); |
|
59 |
|
60 /** |
|
61 * From CUSBUINotifierBase The notifier has been deactivated |
|
62 * so resources can be freed and outstanding messages completed. |
|
63 * @param None. |
|
64 * @return None. |
|
65 */ |
|
66 void Cancel(); |
|
67 |
|
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 |
|
77 * store received parameters into members variables and |
|
78 * make needed initializations. |
|
79 * @param aBuffer A buffer containing received parameters |
|
80 * @param aReplySlot a Reply slot. |
|
81 * @param aMessage Should be completed when the notifier is deactivated. |
|
82 * @return None. |
|
83 */ |
|
84 void GetParamsL(const TDesC8& aBuffer, TInt aReplySlot, |
|
85 const RMessagePtr2& aMessage); |
|
86 |
|
87 /** |
|
88 * Handles the command on USB connected note |
|
89 */ |
|
90 void ProcessCommandL(TInt aCommandId); |
|
91 |
|
92 private: |
|
93 //New functions |
|
94 /** |
|
95 * Get the ID for current USB personality mode |
|
96 * @param aCurrentPersonality current personality id |
|
97 */ |
|
98 void GetCurrentIdL(TInt& aCurrentPersonality); |
|
99 /** |
|
100 * Get the mode name and header for current personality |
|
101 * @param aDescription The returned current personality string. |
|
102 * @param aHeader The header string for message query. |
|
103 */ |
|
104 void GetPersonalityStringL(HBufC*& aHeader,HBufC*& aDescription ); |
|
105 |
|
106 /** |
|
107 * Runs the connected discreet note |
|
108 */ |
|
109 void RunQueryL(); |
|
110 |
|
111 |
|
112 /** |
|
113 * creates the USB UI setting view |
|
114 * @param aProcessName The process name (USBClassChangeUI.exe) |
|
115 * @param TUidType |
|
116 */ |
|
117 void CreateChosenViewL(const TDesC & aProcessName,const TUidType & aUidType) const; |
|
118 private: |
|
119 /** |
|
120 * C++ default constructor. |
|
121 */ |
|
122 CUSBUICableConnectedNotifier(); |
|
123 |
|
124 }; |
|
125 #endif // USBUINCABLECONNECTEDNOTIFIER_H |