1.1 --- a/epoc32/include/e32event.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/e32event.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,410 @@
1.4 -e32event.h
1.5 +// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// e32\include\e32event.h
1.19 +//
1.20 +//
1.21 +
1.22 +#ifndef __E32EVENT_H__
1.23 +#define __E32EVENT_H__
1.24 +#include <e32cmn.h>
1.25 +
1.26 +/**
1.27 +@publishedAll
1.28 +@released
1.29 +*/
1.30 +const TInt KUndefinedDeviceNumber = -1;
1.31 +
1.32 +/**
1.33 +@publishedAll
1.34 +@released
1.35 +
1.36 +Represents a raw hardware event as generated by hardware drivers of
1.37 +a pointer device, a keyboard etc.
1.38 +
1.39 +Raw hardware events are added to the kernel's event queue.
1.40 +*/
1.41 +class TRawEvent
1.42 + {
1.43 +public:
1.44 +
1.45 + /**
1.46 + Defines the event type.
1.47 + */
1.48 + enum TType
1.49 + {
1.50 +
1.51 + /**
1.52 + Represents an uninitialised event object.
1.53 + */
1.54 + ENone,
1.55 +
1.56 + /**
1.57 + A pointer device (e.g. a pen) has moved. Only changes in Cartesian coordinates are tracked.
1.58 + */
1.59 + EPointerMove,
1.60 +
1.61 + /**
1.62 + A switch on event caused by a screen tap using a pointer device.
1.63 + */
1.64 + EPointerSwitchOn,
1.65 +
1.66 + /**
1.67 + Represents a keyboard key down event.
1.68 + */
1.69 + EKeyDown,
1.70 +
1.71 + /**
1.72 + Represents a keyboard key up event.
1.73 + */
1.74 + EKeyUp,
1.75 +
1.76 + /**
1.77 + Represents a redraw event.
1.78 +
1.79 + Typically generated in an emulator environment in response
1.80 + to a host OS redraw event.
1.81 + */
1.82 + ERedraw,
1.83 +
1.84 + /**
1.85 + Represents a device switch on event.
1.86 + */
1.87 + ESwitchOn,
1.88 +
1.89 + /**
1.90 + */
1.91 + EActive,
1.92 +
1.93 + /**
1.94 + */
1.95 + EInactive,
1.96 +
1.97 + /**
1.98 + Represents a modifier key being pressed.
1.99 + */
1.100 + EUpdateModifiers,
1.101 +
1.102 + /**
1.103 + Represents a button down event.
1.104 +
1.105 + This is typically used to represent a pointing device
1.106 + coming into contact with a touch sensitive screen.
1.107 + */
1.108 + EButton1Down,
1.109 +
1.110 + /**
1.111 + Represents a button up event.
1.112 +
1.113 + This is typically used to represent a pointing device
1.114 + being lifted away from a touch sensitive screen.
1.115 + */
1.116 + EButton1Up,
1.117 +
1.118 + /**
1.119 + Represents a button down event.
1.120 +
1.121 + This is typically used to represent a pointing device
1.122 + coming into contact with a touch sensitive screen.
1.123 + */
1.124 + EButton2Down,
1.125 +
1.126 + /**
1.127 + Represents a button up event.
1.128 +
1.129 + This is typically used to represent a pointing device
1.130 + being lifted away from a touch sensitive screen.
1.131 + */
1.132 + EButton2Up,
1.133 +
1.134 + /**
1.135 + Represents a button down event.
1.136 +
1.137 + This is typically used to represent a pointing device
1.138 + coming into contact with a touch sensitive screen.
1.139 + */
1.140 + EButton3Down,
1.141 +
1.142 + /**
1.143 + Represents a button up event.
1.144 +
1.145 + This is typically used to represent a pointing device
1.146 + being lifted away from a touch sensitive screen.
1.147 + */
1.148 + EButton3Up,
1.149 +
1.150 + /**
1.151 + Represents a device switch off event.
1.152 + */
1.153 + ESwitchOff,
1.154 +
1.155 + /**
1.156 + Represents a key being continually pressed event.
1.157 + */
1.158 + EKeyRepeat,
1.159 +
1.160 + /**
1.161 + Represents a case open event.
1.162 +
1.163 + The meaning of a case is hardware specific.
1.164 + */
1.165 + ECaseOpen,
1.166 +
1.167 + /**
1.168 + Represents a case close event.
1.169 +
1.170 + The meaning of a case is hardware specific.
1.171 + */
1.172 + ECaseClose,
1.173 +
1.174 + /**
1.175 + @prototype
1.176 + Represents a 3D pointer entering the detection volume event.
1.177 +
1.178 + This is typically used to represent a pointing device
1.179 + coming into detection range of a sensitive screen.
1.180 + */
1.181 + EPointer3DInRange,
1.182 +
1.183 + /**
1.184 + @prototype
1.185 + Represents a 3D pointer leaving the detection volume event.
1.186 +
1.187 + This is typically used to represent a pointing device
1.188 + leaving the detection range of a sensitive screen.
1.189 + */
1.190 + EPointer3DOutOfRange,
1.191 +
1.192 + /**
1.193 + @prototype
1.194 + Represents a 3D pointer tilt changes only event.
1.195 +
1.196 + This is typically sent by a 3D pointer driver when it detects
1.197 + a change in the pointer's polar coordinates (Theta or Phi).
1.198 + */
1.199 + EPointer3DTilt,
1.200 +
1.201 + /**
1.202 + @prototype
1.203 + Represents a 3D pointer rotation only event.
1.204 +
1.205 + This is typically sent by a 3D pointer driver when it detects
1.206 + a rotation of the pointing device (along ist main axis).
1.207 + */
1.208 + EPointer3DRotation,
1.209 +
1.210 + /**
1.211 + @prototype
1.212 + Represents a general 3D pointer changes event.
1.213 +
1.214 + This is typically sent by a 3D pointer driver when it detects
1.215 + a change in the pointer's linear and/or polar coordinates and/or rotation.
1.216 + */
1.217 + EPointer3DTiltAndMove,
1.218 +
1.219 + /**
1.220 + @prototype
1.221 + Reserved for a 3D pointing device button down event.
1.222 + */
1.223 + EButton4Down,
1.224 +
1.225 + /**
1.226 + @prototype
1.227 + Reserved for a 3D pointing device button up event.
1.228 + */
1.229 + EButton4Up,
1.230 +
1.231 + /**
1.232 + @prototype
1.233 + Reserved for a 3D pointing device button down event.
1.234 + */
1.235 + EButton5Down,
1.236 +
1.237 + /**
1.238 + @prototype
1.239 + Reserved for a 3D pointing device button up event.
1.240 + */
1.241 + EButton5Up,
1.242 +
1.243 + /**
1.244 + @prototype
1.245 + Reserved for a 3D pointing device button down event.
1.246 + */
1.247 + EButton6Down,
1.248 +
1.249 + /**
1.250 + @prototype
1.251 + Reserved for a 3D pointing device button up event.
1.252 + */
1.253 + EButton6Up,
1.254 +
1.255 + /**
1.256 + Represents a device restart event.
1.257 + */
1.258 + ERestartSystem
1.259 + };
1.260 +public:
1.261 +
1.262 + /**
1.263 + Default constructor
1.264 + */
1.265 + inline TRawEvent()
1.266 + { *(TInt*)&iType=0; }
1.267 +
1.268 + /**
1.269 + Gets the event type
1.270 +
1.271 + @return The event type.
1.272 + */
1.273 + inline TType Type() const
1.274 + {return TType(iType);}
1.275 +
1.276 + /**
1.277 + Gets the device number (eg. screen number)
1.278 +
1.279 + @return The device number.
1.280 + */
1.281 + inline TInt DeviceNumber() const
1.282 + {return TInt(iDeviceNumber-1);}
1.283 +
1.284 + /**
1.285 + Sets the device number (eg. screen number)
1.286 +
1.287 + @param aDeviceNumber The device number
1.288 + */
1.289 + inline void SetDeviceNumber(TInt aDeviceNumber)
1.290 + {iDeviceNumber = TUint8(aDeviceNumber+1);}
1.291 +
1.292 + IMPORT_C TPoint Pos() const;
1.293 + IMPORT_C TInt ScanCode() const;
1.294 + IMPORT_C TInt Modifiers() const;
1.295 +
1.296 + /**
1.297 + Gets the Cartesian coordinates of the 3D pointer end that is closer to the screen.
1.298 +
1.299 + @return The Cartesian coordinates of the point defined by the end of the 3D pointing device that is closer to the screen.
1.300 + */
1.301 + IMPORT_C TPoint3D Pos3D() const;
1.302 +
1.303 +
1.304 + /**
1.305 + Gets the angular spherical polar coordinates of the 3D pointer end that is closer to the screen.
1.306 +
1.307 + @return The angular spherical polar coordinates of the point defined by the end of the 3D pointing device that is closer to the screen.
1.308 + @see TAngle3D
1.309 + */
1.310 + IMPORT_C TAngle3D Tilt() const;
1.311 +
1.312 + /**
1.313 + Gets the rotation angle of 3D pointing device.
1.314 +
1.315 + Some 3D pointing devices support information regarding the angle formed between the physical and magnetical poles,
1.316 + as obtaining when rotating the pen along its main axis.
1.317 +
1.318 + @return The rotation angle of the 3D pointing device.
1.319 + */
1.320 + IMPORT_C TInt Rotation() const;
1.321 +
1.322 + /**
1.323 + Gets the tick count value associated with the event.
1.324 +
1.325 + Note that the interval between tick counts is
1.326 + hardware dependent.
1.327 +
1.328 + @return The tick count value
1.329 + */
1.330 + inline TUint Ticks() const
1.331 + {return iTicks;}
1.332 + /**
1.333 + Gets the information on which end of the pointing device is closer to the screen
1.334 +
1.335 + @return A Boolean indicating which end of the pointing device is closer to the screen.
1.336 + */
1.337 + inline TBool IsTip() const
1.338 + {return TBool(iTip);}
1.339 +
1.340 + /**
1.341 + Sets the information on which end of the pointing device is closer to the screen
1.342 +
1.343 + @param aTip A Boolean indicating which end of the pointing device is closer to the screen.
1.344 + */
1.345 + inline void SetTip(TBool aTip)
1.346 + {iTip = TUint8(aTip);}
1.347 +
1.348 + IMPORT_C void Set(TType aType,TInt aScanCode);
1.349 + IMPORT_C void Set(TType aType,TInt aX,TInt aY);
1.350 + IMPORT_C void Set(TType aType);
1.351 +
1.352 + IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ);
1.353 + IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ,TInt aPhi,TInt aTheta,TInt aAlpha);
1.354 +
1.355 + IMPORT_C void SetTilt(TType aType,TInt aPhi,TInt aTheta);
1.356 + IMPORT_C void SetRotation(TType aType,TInt aAlpha);
1.357 +
1.358 +protected:
1.359 + TUint8 iType;
1.360 + TUint8 iTip; /**< Indicates whether the tip or head of pointing device is closer to screen.*/
1.361 + TUint8 iSpare2;
1.362 + TUint8 iDeviceNumber;
1.363 + TUint iTicks;
1.364 + union
1.365 + {
1.366 + struct {TInt x;TInt y;} pos;
1.367 + struct {TInt x;TInt y;TInt z;TInt phi;TInt theta;TInt alpha;} pos3D;
1.368 + TInt scanCode;
1.369 + TInt modifiers;
1.370 + } iU;
1.371 + };
1.372 +
1.373 +
1.374 +
1.375 +
1.376 +/**
1.377 +@publishedAll
1.378 +@released
1.379 +
1.380 +Encapsulates a hardware event object as a descriptor (package buffer) for
1.381 +the purpose of data transfer.
1.382 +*/
1.383 +class TRawEventBuf : public TPckgBuf<TRawEvent>
1.384 + {
1.385 +public:
1.386 +
1.387 + /**
1.388 + Gets the hardware event object from the package buffer.
1.389 +
1.390 + @return The hardware event object.
1.391 + */
1.392 + inline TRawEvent &Event() const {return(*((TRawEvent *)&iBuf[0]));}
1.393 + };
1.394 +
1.395 +
1.396 +
1.397 +
1.398 +/**
1.399 +@publishedPartner
1.400 +@released
1.401 +
1.402 +Encapsulates information about a device's display screen.
1.403 +*/
1.404 +class TScreenInfoV01
1.405 + {
1.406 +public:
1.407 + TBool iWindowHandleValid; /**< Indicates whether the window handle is valid.*/
1.408 + TAny *iWindowHandle; /**< The window handle.*/
1.409 + TBool iScreenAddressValid;/**< Indicates whether the screen address is valid.*/
1.410 + TAny *iScreenAddress; /**< The linear address of the screen.*/
1.411 + TSize iScreenSize; /**< The size of the screen.*/
1.412 + };
1.413 +//
1.414 +#endif