|
1 // Copyright (c) 2008-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 // inline implementations for TAdvancedPointerEvent |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef ADVANCEDPOINTEREVENT_INL_ |
|
19 #define ADVANCEDPOINTEREVENT_INL_ |
|
20 |
|
21 #include <w32std.h> |
|
22 |
|
23 /** Does basic initialisation of a TAdvancedPointerEvent |
|
24 @internalTechnology */ |
|
25 inline void TAdvancedPointerEvent::Init() |
|
26 { |
|
27 iModifiers=EModifierAdvancedPointerEvent; |
|
28 iData.ints.iSpare1=0; |
|
29 iData.ints.iSpare2=0; |
|
30 } |
|
31 |
|
32 /** Does specific initialisation of a TAdvancedPointerEvent |
|
33 @param aType The pointer event type. |
|
34 @param aModifiers Additional modifiers for the event. |
|
35 @param aPoint3D The 3D coordinated of the event. |
|
36 @param aPointerNumber The pointer number for the event. |
|
37 @internalTechnology */ |
|
38 inline void TAdvancedPointerEvent::Init(const TPointerEvent::TType aType, const TUint aModifiers, const TPoint3D &aPoint3D, const TUint8 aPointerNumber) |
|
39 { |
|
40 Init(); |
|
41 iType=aType; |
|
42 iModifiers|=aModifiers; //add the new modifiers to EModifierAdvancedPointerEvent |
|
43 iPosition.iX=aPoint3D.iX; |
|
44 iPosition.iY=aPoint3D.iY; |
|
45 iData.multiPos3D.iPosZ=aPoint3D.iZ; |
|
46 iData.multiPos3D.iPointerNumber=aPointerNumber; |
|
47 } |
|
48 |
|
49 /** Sets the pointer number and enforces pointer event to an advanced pointer event. |
|
50 @internalTechnology */ |
|
51 inline void TAdvancedPointerEvent::SetPointerNumber(TUint8 aPointerNumber) |
|
52 { |
|
53 iModifiers|=EModifierAdvancedPointerEvent; // ensure we're an AdvancePointerEvent |
|
54 iData.multiPos3D.iPointerNumber=aPointerNumber; |
|
55 } |
|
56 |
|
57 /** Sets Z and enforces pointer event to advanced pointer event |
|
58 @internalTechnology */ |
|
59 inline void TAdvancedPointerEvent::SetPointerZ(TInt aZ) |
|
60 { |
|
61 iModifiers|=EModifierAdvancedPointerEvent; // ensure we're an advanced pointer event |
|
62 iData.multiPos3D.iPosZ=aZ; |
|
63 } |
|
64 |
|
65 inline void TAdvancedPointerEvent::Copy(const TAdvancedPointerEvent& aPointerEvent) |
|
66 { |
|
67 if(aPointerEvent.iModifiers&EModifierAdvancedPointerEvent) |
|
68 { |
|
69 iType=aPointerEvent.iType; |
|
70 iModifiers=aPointerEvent.iModifiers; |
|
71 iPosition=aPointerEvent.iPosition; |
|
72 iParentPosition=aPointerEvent.iParentPosition; |
|
73 iData=aPointerEvent.iData; |
|
74 } |
|
75 else |
|
76 { |
|
77 // delegate to TPointerEvent::Copy |
|
78 TPointerEvent::Copy(aPointerEvent); |
|
79 } |
|
80 } |
|
81 |
|
82 #endif /*ADVANCEDPOINTEREVENT_INL_*/ |