1 /* |
1 /* |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
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: Base classes for Usb notifier wrapper |
|
15 * |
8 * |
16 */ |
9 * Initial Contributors: |
17 |
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Base classes for Usb notifier wrapper |
|
15 * |
|
16 */ |
18 |
17 |
19 #ifndef C_CUSBNOTENOTIFIER_H |
18 #ifndef C_CUSBNOTENOTIFIER_H |
20 #define C_CUSBNOTENOTIFIER_H |
19 #define C_CUSBNOTENOTIFIER_H |
21 |
20 |
22 #include <e32base.h> |
21 #include <e32base.h> |
36 /** |
35 /** |
37 * Active object of asynchronous showing notifier |
36 * Active object of asynchronous showing notifier |
38 */ |
37 */ |
39 class CNotifierActive : public CActive |
38 class CNotifierActive : public CActive |
40 { |
39 { |
41 public: |
40 public: |
42 /** |
41 /** |
43 * Default constructor |
42 * Default constructor |
44 * @param aNotifier RNotifier API |
43 * @param aNotifier RNotifier API |
45 * @param aUsbNoteNotifier the note notifier container |
44 * @param aUsbNoteNotifier the note notifier container |
46 */ |
45 */ |
47 CNotifierActive(RNotifier& aNotifier, CUsbNoteNotifier* aUsbNoteNotifier); |
46 CNotifierActive(RNotifier& aNotifier, CUsbNoteNotifier& aUsbNoteNotifier); |
48 |
|
49 /** |
|
50 * Destructor |
|
51 */ |
|
52 virtual ~CNotifierActive(); |
|
53 |
|
54 /** |
|
55 * Start to show the notifier |
|
56 */ |
|
57 void StartL(); |
|
58 |
|
59 protected: |
|
60 // From base class CActive |
|
61 /** |
|
62 * Caled when outstanding request completed |
|
63 */ |
|
64 void RunL(); |
|
65 |
47 |
66 /** |
48 /** |
67 * Called when outstanding request cancelled |
49 * Destructor |
68 */ |
50 */ |
69 void DoCancel(); |
51 virtual ~CNotifierActive(); |
70 |
52 |
71 /** |
53 /** |
72 * Called when RunL leaves |
54 * Start to show the notifier |
73 * @param aError errorcode |
55 */ |
74 * @return errorcode |
56 void StartL(); |
75 */ |
|
76 TInt RunError(TInt aError); |
|
77 |
57 |
78 private: |
58 protected: |
79 // data |
59 // From base class CActive |
|
60 /** |
|
61 * Caled when outstanding request completed |
|
62 */ |
|
63 void RunL(); |
80 |
64 |
81 /** |
65 /** |
82 * The note notifier container |
66 * Called when outstanding request cancelled |
83 * Not Own |
67 */ |
84 */ |
68 void DoCancel(); |
85 CUsbNoteNotifier* iUsbNoteNotifier; |
69 |
86 |
70 /** |
87 /** |
71 * Called when RunL leaves |
88 * RNotifier API |
72 * @param aError errorcode |
89 * Not Own |
73 * @return errorcode |
90 */ |
74 */ |
91 RNotifier& iNotifier; |
75 TInt RunError(TInt aError); |
|
76 |
|
77 private: |
|
78 // data |
|
79 |
|
80 /** |
|
81 * The note notifier container |
|
82 * Not Own |
|
83 */ |
|
84 CUsbNoteNotifier& iUsbNoteNotifier; |
|
85 |
|
86 /** |
|
87 * RNotifier API |
|
88 * Not Own |
|
89 */ |
|
90 RNotifier& iNotifier; |
92 |
91 |
93 /** |
92 /** |
94 * Response from notifier |
93 * Response from notifier |
95 */ |
94 */ |
96 TPckg<TInt> iRes; |
95 TPckg<TInt> iRes; |
|
96 |
|
97 /** |
|
98 * Notifier id pckg buffer |
|
99 */ |
|
100 TPckgBuf<TInt> iNotifIdPckg; |
97 }; |
101 }; |
98 public: |
102 public: |
99 |
103 |
100 /** |
104 /** |
101 * Destructor |
105 * Destructor |
120 * @param aNotifier RNotifier API |
124 * @param aNotifier RNotifier API |
121 * @param aNotifManager Manager |
125 * @param aNotifManager Manager |
122 * @param acat Category |
126 * @param acat Category |
123 * @param aNotidId id |
127 * @param aNotidId id |
124 */ |
128 */ |
125 CUsbNoteNotifier(RNotifier& aNotifier, CUsbNotifManager* aNotifManager, |
129 CUsbNoteNotifier(RNotifier& aNotifier, CUsbNotifManager& aNotifManager, |
126 TUid aCat, TUint aNotifId); |
130 TUid aCat, TUint aNotifId); |
127 |
131 |
128 /** |
132 /** |
129 * 2nd phase constructor. |
133 * 2nd phase constructor. |
130 */ |
134 */ |
131 void ConstructL(); |
135 void ConstructL(); |
132 |
136 |
133 private: |
137 private: |
134 // data |
138 // data |
135 |
139 |
136 /** |
140 /** |
137 * Active object of handling RNotifier instance |
141 * Active object of handling RNotifier instance |
138 * Own |
142 * Own |
139 */ |
143 */ |
140 CNotifierActive* iNotifierActive; |
144 CNotifierActive* iNotifierActive; |
141 |
145 |
142 /** |
146 /** |
143 * RNotifier API |
147 * RNotifier API |
144 * Not Own |
148 * Not Own |
145 */ |
149 */ |
146 RNotifier& iNotifier; |
150 RNotifier& iNotifier; |