|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __EVENTDD_H__ |
|
17 #define __EVENTDD_H__ |
|
18 |
|
19 #ifndef __E32cmn_H__ |
|
20 #include <e32cmn.h> |
|
21 #endif |
|
22 |
|
23 _LIT(KName,"EventDD"); |
|
24 |
|
25 |
|
26 class REventDD : public RBusLogicalChannel |
|
27 { |
|
28 friend class DEventDD; |
|
29 public: |
|
30 /** |
|
31 Structure for holding driver capabilities information |
|
32 (Just a version number in this example.) |
|
33 */ |
|
34 class TCaps |
|
35 { |
|
36 public: |
|
37 TVersion iVersion; |
|
38 }; |
|
39 |
|
40 public: |
|
41 inline static const TDesC& BinaryName(); |
|
42 inline static const TDesC& DriverName(); |
|
43 inline static TVersion VersionRequired(); |
|
44 inline TInt Open(); |
|
45 inline TInt SendEvent(TRawEvent& aEvent); |
|
46 private: |
|
47 enum TControl |
|
48 { |
|
49 ESendEvent |
|
50 }; |
|
51 }; |
|
52 |
|
53 |
|
54 inline const TDesC& REventDD::BinaryName() |
|
55 { |
|
56 return KName; |
|
57 } |
|
58 inline const TDesC& REventDD::DriverName() |
|
59 { |
|
60 return KName; |
|
61 } |
|
62 inline TVersion REventDD::VersionRequired() |
|
63 { |
|
64 return TVersion(1,0,0); |
|
65 } |
|
66 inline TInt REventDD::Open() |
|
67 { |
|
68 return DoCreate(DriverName(),VersionRequired(),KNullUnit,NULL,NULL,EOwnerThread); |
|
69 } |
|
70 inline TInt REventDD::SendEvent(TRawEvent& aEvent) |
|
71 { |
|
72 return DoControl(ESendEvent,static_cast<TAny*>(&aEvent)); |
|
73 } |
|
74 |
|
75 #endif //__EVENTDD_H__ |