sl@0
|
1 |
// Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef ADVANCEDPOINTEREVENT_H
|
sl@0
|
17 |
#define ADVANCEDPOINTEREVENT_H
|
sl@0
|
18 |
|
sl@0
|
19 |
#ifndef __E32STD_H__
|
sl@0
|
20 |
#include <e32std.h>
|
sl@0
|
21 |
#endif
|
sl@0
|
22 |
#ifndef __E32KEYS_H__
|
sl@0
|
23 |
#include <e32keys.h>
|
sl@0
|
24 |
#endif
|
sl@0
|
25 |
#ifndef POINTEREVENT_H
|
sl@0
|
26 |
#include <pointerevent.h>
|
sl@0
|
27 |
#endif
|
sl@0
|
28 |
|
sl@0
|
29 |
|
sl@0
|
30 |
/** Subclass of TPointerEvent created in order to maintain binary compatibility while
|
sl@0
|
31 |
extending TPointerEvent with new data:
|
sl@0
|
32 |
(1) pointer number of the pointer whose state change is described by the event,
|
sl@0
|
33 |
(2) proximity of the pointer to the screen's surface,
|
sl@0
|
34 |
(3) pressure applied by the pointer to the screen.
|
sl@0
|
35 |
|
sl@0
|
36 |
These new attributes will be present only on devices that support them, otherwise
|
sl@0
|
37 |
they will be set to 0.
|
sl@0
|
38 |
|
sl@0
|
39 |
@see TPointerEvent
|
sl@0
|
40 |
@see TPointerEvent::AdvancedPointerEvent()
|
sl@0
|
41 |
@see TPointerEvent::IsAdvancedPointerEvent()
|
sl@0
|
42 |
@see TWsEvent::Pointer()
|
sl@0
|
43 |
@publishedAll
|
sl@0
|
44 |
@released */
|
sl@0
|
45 |
class TAdvancedPointerEvent : public TPointerEvent
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
enum
|
sl@0
|
49 |
{
|
sl@0
|
50 |
/**
|
sl@0
|
51 |
The value used by Symbian OS as the default pointer number for pointer-related
|
sl@0
|
52 |
event objects which do not contain a pointer number member.
|
sl@0
|
53 |
|
sl@0
|
54 |
WARNING: Enum for internal use ONLY. Compatibility is not guaranteed in future releases.
|
sl@0
|
55 |
*/
|
sl@0
|
56 |
EDefaultPointerNumber = 0,
|
sl@0
|
57 |
/**
|
sl@0
|
58 |
Maximum number of pointers that WServ is able to support. On each particular platform,
|
sl@0
|
59 |
the number of supported pointers must be less than or equal to this value.
|
sl@0
|
60 |
|
sl@0
|
61 |
WARNING: Enum for internal use ONLY. Compatibility is not guaranteed in future releases.
|
sl@0
|
62 |
*/
|
sl@0
|
63 |
EMaximumWServNumberOfPointers = 8
|
sl@0
|
64 |
};
|
sl@0
|
65 |
|
sl@0
|
66 |
// Public API's for WServ Clients
|
sl@0
|
67 |
inline TAdvancedPointerEvent();
|
sl@0
|
68 |
inline TInt PointerNumber() const;
|
sl@0
|
69 |
inline TInt Proximity() const;
|
sl@0
|
70 |
inline TInt Pressure() const;
|
sl@0
|
71 |
inline TInt ProximityAndPressure() const;
|
sl@0
|
72 |
inline TPoint3D Position3D() const;
|
sl@0
|
73 |
inline TPoint3D Pressure3D() const;
|
sl@0
|
74 |
inline TPoint3D PositionAndPressure3D() const;
|
sl@0
|
75 |
|
sl@0
|
76 |
IMPORT_C TAdvancedPointerEvent(const TAdvancedPointerEvent& aPointerEvent);
|
sl@0
|
77 |
IMPORT_C TAdvancedPointerEvent& operator=(const TAdvancedPointerEvent& aPointerEvent);
|
sl@0
|
78 |
|
sl@0
|
79 |
private:
|
sl@0
|
80 |
// The methods in this section are internalTechnology and intended for use by TWsEvent
|
sl@0
|
81 |
// and TAdvancedPointerEventHelper (internal WSERV class).
|
sl@0
|
82 |
friend class TWsEvent;
|
sl@0
|
83 |
friend class TAdvancedPointerEventHelper;
|
sl@0
|
84 |
|
sl@0
|
85 |
enum
|
sl@0
|
86 |
{
|
sl@0
|
87 |
/**
|
sl@0
|
88 |
Value used as return value from PointerNumber API when the object is a TPointerEvent
|
sl@0
|
89 |
not a TAdvancedPointerEvent (as indicated by the iModifier flags).
|
sl@0
|
90 |
*/
|
sl@0
|
91 |
ENonAdvancedPointerPointerNumber = EDefaultPointerNumber,
|
sl@0
|
92 |
};
|
sl@0
|
93 |
enum
|
sl@0
|
94 |
{
|
sl@0
|
95 |
/**
|
sl@0
|
96 |
Value used to distinguish between pressure and proximity Z values by Pressure or
|
sl@0
|
97 |
Proximity Specific APIs.
|
sl@0
|
98 |
*/
|
sl@0
|
99 |
EPressureProximityCrossover = 0,
|
sl@0
|
100 |
/**
|
sl@0
|
101 |
Value used as return Z value from APIs when the object is a TPointerEvent
|
sl@0
|
102 |
not a TAdvancedPointerEvent (as indicated by the iModifier flags).
|
sl@0
|
103 |
*/
|
sl@0
|
104 |
ENonAdvancedPointerZCoordinate = EPressureProximityCrossover,
|
sl@0
|
105 |
};
|
sl@0
|
106 |
|
sl@0
|
107 |
// Private API's for external usage, via inlined accessors
|
sl@0
|
108 |
IMPORT_C TInt DoGetPointerNumber() const;
|
sl@0
|
109 |
IMPORT_C TInt DoGetProximity() const;
|
sl@0
|
110 |
IMPORT_C TInt DoGetPressure() const;
|
sl@0
|
111 |
IMPORT_C TInt DoGetProximityAndPressure() const;
|
sl@0
|
112 |
|
sl@0
|
113 |
// Private API's for internal WSERV usage. It is impossible to inline them into
|
sl@0
|
114 |
// client's binaries, thus implementation may be changed in the future.
|
sl@0
|
115 |
inline void Init();
|
sl@0
|
116 |
inline void Init(const TPointerEvent::TType aType, const TUint aModifiers, const TPoint3D &aPoint3D, const TUint8 aPointerNumber);
|
sl@0
|
117 |
inline void SetPointerNumber(TUint8 aPointerNumber);
|
sl@0
|
118 |
inline void SetPointerZ(TInt aZ);
|
sl@0
|
119 |
inline void Copy(const TAdvancedPointerEvent& aPointerEvent);
|
sl@0
|
120 |
|
sl@0
|
121 |
/** WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
|
sl@0
|
122 |
union
|
sl@0
|
123 |
{
|
sl@0
|
124 |
struct {TInt iSpare1; TInt iSpare2;} ints; // 8 bytes to fill TWsEvent
|
sl@0
|
125 |
struct {TInt32 iPosZ; TUint8 iPointerNumber;} multiPos3D;
|
sl@0
|
126 |
} iData;
|
sl@0
|
127 |
};
|
sl@0
|
128 |
|
sl@0
|
129 |
/** Default Constructor for TAdvancedPointerEvent
|
sl@0
|
130 |
|
sl@0
|
131 |
@publishedAll
|
sl@0
|
132 |
@released
|
sl@0
|
133 |
*/
|
sl@0
|
134 |
inline TAdvancedPointerEvent::TAdvancedPointerEvent() {}
|
sl@0
|
135 |
|
sl@0
|
136 |
inline const TAdvancedPointerEvent* TPointerEvent::AdvancedPointerEvent() const
|
sl@0
|
137 |
/** Casts this TPointerEvent to TAdvancedPointerEvent in order to provide access
|
sl@0
|
138 |
to event's pointer number, pressure and proximity (these attributes are accessible
|
sl@0
|
139 |
through appropriate getters of TAdvancedPointerEvent class).
|
sl@0
|
140 |
|
sl@0
|
141 |
If this is not an instance of TAdvancedPointerEvent, NULL will be returned.
|
sl@0
|
142 |
Please note that TAdvancedPointerEvents are delivered only to windows for
|
sl@0
|
143 |
which they have been enabled using RWindowBase::EnableAdvancedPointers() method.
|
sl@0
|
144 |
|
sl@0
|
145 |
@return A pointer to this object as TAdvancedPointerEvent or NULL if this is not
|
sl@0
|
146 |
an instance of TAdvancedPointerEvent.
|
sl@0
|
147 |
@see TPointerEvent::IsAdvancedPointerEvent()
|
sl@0
|
148 |
@see RWindowBase::EnableAdvancedPointers()
|
sl@0
|
149 |
@publishedAll
|
sl@0
|
150 |
@released */
|
sl@0
|
151 |
{
|
sl@0
|
152 |
return (iModifiers&EModifierAdvancedPointerEvent ? static_cast<const TAdvancedPointerEvent*>(this) : NULL);
|
sl@0
|
153 |
}
|
sl@0
|
154 |
|
sl@0
|
155 |
#include "advancedpointerevent.inl"
|
sl@0
|
156 |
|
sl@0
|
157 |
#endif /* ADVANCEDPOINTEREVENT_H */
|