|
1 /* |
|
2 * Copyright (c) 2006-2007 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: Header file for personality notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CUSBPERSONALITYNOTIFIER_H |
|
20 #define CUSBPERSONALITYNOTIFIER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <musbnotifiercallback.h> |
|
24 |
|
25 NONSHARABLE_CLASS(CUsbPersonalityNotifier) : public CActive |
|
26 { |
|
27 public: |
|
28 IMPORT_C ~CUsbPersonalityNotifier(); |
|
29 |
|
30 IMPORT_C static CUsbPersonalityNotifier* NewL(); |
|
31 |
|
32 IMPORT_C TInt ShowQuery(TUid aNotifierUid, const TDesC8 &aBuffer, TDes8 &aResponse, |
|
33 MUsbNotifierCallBack* aCallBack = NULL, TRequestStatus* aStatus = NULL); |
|
34 |
|
35 IMPORT_C TInt ShowNote(TUid aNotifierUid, const TDesC8 &aBuffer, TDes8 &aResponse); |
|
36 |
|
37 IMPORT_C void CancelAll(); |
|
38 |
|
39 IMPORT_C void CancelQuery(TUid aNotifierUid); |
|
40 |
|
41 /** Cancel all queued queries and notes but the currently shown */ |
|
42 IMPORT_C void CancelAllButCurrent(); |
|
43 |
|
44 /** Return ETrue, if the notifier is showing currently */ |
|
45 /** DEPRICATED */ |
|
46 IMPORT_C TBool IsShowing(TUid aNotifierUid); |
|
47 |
|
48 private: |
|
49 |
|
50 CUsbPersonalityNotifier(); |
|
51 |
|
52 void ConstructL(); |
|
53 |
|
54 enum TNotifierState |
|
55 { |
|
56 EUsbPersonalityNotifierIdle, |
|
57 EUsbPersonalityNotifierStarted |
|
58 }; |
|
59 |
|
60 void DoCancel(); |
|
61 void RunL(); |
|
62 TInt RunError( TInt /*aError*/ ); |
|
63 |
|
64 TInt DoShowQuery(MUsbNotifierCallBack* aCallBack, TUid aNotifierUid, |
|
65 const TDesC8 &aBuffer, TDes8 &aResponse, TRequestStatus* aStatus); |
|
66 |
|
67 TInt DoShowNote(TUid aNotifierUid, const TDesC8 &aBuffer, TDes8 &aResponse); |
|
68 |
|
69 class TNotifierClient |
|
70 { |
|
71 public: |
|
72 TNotifierClient::TNotifierClient(MUsbNotifierCallBack* aCallBack, TUid aNotifierUid, |
|
73 const TDesC8 &aBuffer, TDes8 &aResponse, TRequestStatus* iRequestStatus, |
|
74 TBool aConfirmation); |
|
75 |
|
76 MUsbNotifierCallBack* iCallBack; |
|
77 TUid iNotifierUid; |
|
78 const TDesC8 &iBuffer; |
|
79 TDes8 &iResponse; |
|
80 TRequestStatus* iRequestStatus; |
|
81 TBool iConfirmation; |
|
82 }; |
|
83 |
|
84 RPointerArray<TNotifierClient> iNotifierClient; |
|
85 |
|
86 MUsbNotifierCallBack* iCallBack; |
|
87 TUid iNotifierUid; |
|
88 RNotifier iNotifier; |
|
89 TNotifierState iState; |
|
90 TRequestStatus* iRequestStatus; |
|
91 }; |
|
92 |
|
93 #endif |
|
94 |