|
1 /* |
|
2 * Copyright (c) 2008-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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TESTUSBAWAREAPP_H |
|
19 #define TESTUSBAWAREAPP_H |
|
20 |
|
21 #include <e32cmn.h> |
|
22 #include <e32base.h> |
|
23 #include <usbman.h> |
|
24 #include <e32property.h> |
|
25 |
|
26 _LIT(KUsbAwareAppTitle, "USB Aware App"); |
|
27 |
|
28 class CUsbAwareAppKeys; |
|
29 class CShutdownMonitor; |
|
30 |
|
31 NONSHARABLE_CLASS(MShutdownInterface) |
|
32 { |
|
33 public: |
|
34 virtual void Stop() const = 0; |
|
35 }; |
|
36 |
|
37 NONSHARABLE_CLASS(CUsbAwareAppConsole) : public CBase, public MShutdownInterface |
|
38 { |
|
39 friend class CUsbAwareAppKeys; |
|
40 |
|
41 public: |
|
42 static CUsbAwareAppConsole* NewLC(); |
|
43 ~CUsbAwareAppConsole(); |
|
44 |
|
45 public: |
|
46 void Start(); |
|
47 void Stop() const; |
|
48 |
|
49 private: |
|
50 CUsbAwareAppConsole(); |
|
51 void ConstructL(); |
|
52 void Move(TInt aX, TInt aY); |
|
53 void Draw(); |
|
54 |
|
55 private: |
|
56 CConsoleBase* iConsole; |
|
57 CUsbAwareAppKeys* iKeys; |
|
58 CShutdownMonitor* iShutdownMonitor; |
|
59 |
|
60 private: |
|
61 static const TInt KNumLinesInWindow = 5; |
|
62 }; |
|
63 |
|
64 |
|
65 NONSHARABLE_CLASS(CUsbAwareAppKeys) : public CActive |
|
66 { |
|
67 public: |
|
68 static CUsbAwareAppKeys* NewL(CUsbAwareAppConsole& aUsbAwareAppConsole); |
|
69 ~CUsbAwareAppKeys(); |
|
70 |
|
71 private: |
|
72 CUsbAwareAppKeys(CUsbAwareAppConsole& aUsbAwareAppConsole); |
|
73 void ConstructL(); |
|
74 void DoCancel(); |
|
75 void RunL(); |
|
76 |
|
77 private: |
|
78 CUsbAwareAppConsole& iUsbAwareAppConsole; |
|
79 RUsb iUsb; |
|
80 }; |
|
81 |
|
82 |
|
83 NONSHARABLE_CLASS(CShutdownMonitor) : public CActive |
|
84 { |
|
85 public: |
|
86 static CShutdownMonitor* NewL(MShutdownInterface& aUsbAwareAppConsole); |
|
87 ~CShutdownMonitor(); |
|
88 private: |
|
89 CShutdownMonitor(MShutdownInterface& aUsbAwareAppConsole); |
|
90 void ConstructL(); |
|
91 // From CActive |
|
92 void DoCancel(); |
|
93 void RunL(); |
|
94 private: |
|
95 RProperty iShutdownProp; |
|
96 MShutdownInterface& iUsbAwareAppConsole; |
|
97 }; |
|
98 |
|
99 #endif // TESTUSBAWAREAPP_H |