epoc32/include/e32event.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// e32\include\e32event.h
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __E32EVENT_H__
williamr@2
    19
#define __E32EVENT_H__
williamr@2
    20
#include <e32cmn.h>
williamr@2
    21
williamr@2
    22
/**
williamr@2
    23
@publishedAll
williamr@2
    24
@released
williamr@2
    25
*/
williamr@2
    26
const TInt KUndefinedDeviceNumber = -1;
williamr@2
    27
williamr@2
    28
/**
williamr@2
    29
@publishedAll
williamr@2
    30
@released
williamr@2
    31
williamr@2
    32
Represents a raw hardware event as generated by hardware drivers of
williamr@2
    33
a pointer device, a keyboard etc.
williamr@2
    34
williamr@2
    35
Raw hardware events are added to the kernel's event queue.
williamr@2
    36
*/
williamr@2
    37
class TRawEvent
williamr@2
    38
	{
williamr@2
    39
public:
williamr@2
    40
williamr@2
    41
    /**
williamr@2
    42
    Defines the event type.
williamr@2
    43
    */
williamr@2
    44
	enum TType
williamr@2
    45
		{
williamr@2
    46
		
williamr@2
    47
		/**
williamr@2
    48
		Represents an uninitialised event object.
williamr@2
    49
		*/
williamr@2
    50
		ENone,
williamr@2
    51
		
williamr@2
    52
		/**
williamr@2
    53
		A pointer device (e.g. a pen) has moved. Only changes in Cartesian coordinates are tracked.
williamr@2
    54
		*/
williamr@2
    55
		EPointerMove,
williamr@2
    56
		
williamr@2
    57
		/**
williamr@2
    58
		A switch on event caused by a screen tap using a pointer device. 
williamr@2
    59
		*/
williamr@2
    60
        EPointerSwitchOn,
williamr@2
    61
        
williamr@2
    62
        /**
williamr@2
    63
        Represents a keyboard key down event.
williamr@2
    64
        */
williamr@2
    65
		EKeyDown,
williamr@2
    66
		
williamr@2
    67
		/**
williamr@2
    68
		Represents a keyboard key up event.
williamr@2
    69
		*/
williamr@2
    70
		EKeyUp,
williamr@2
    71
		
williamr@2
    72
		/**
williamr@2
    73
		Represents a redraw event.
williamr@2
    74
		
williamr@2
    75
		Typically generated in an emulator environment in response
williamr@2
    76
		to a host OS redraw event.
williamr@2
    77
		*/
williamr@2
    78
		ERedraw,
williamr@2
    79
		
williamr@2
    80
		/**
williamr@2
    81
		Represents a device switch on event.
williamr@2
    82
		*/
williamr@2
    83
		ESwitchOn,
williamr@2
    84
		
williamr@2
    85
		/**
williamr@2
    86
		*/
williamr@2
    87
        EActive,
williamr@2
    88
        
williamr@2
    89
  		/**
williamr@2
    90
		*/
williamr@2
    91
		EInactive,
williamr@2
    92
		
williamr@2
    93
		/**
williamr@2
    94
		Represents a modifier key being pressed.
williamr@2
    95
		*/
williamr@2
    96
		EUpdateModifiers,
williamr@2
    97
		
williamr@2
    98
		/**
williamr@2
    99
		Represents a button down event.
williamr@2
   100
		
williamr@2
   101
		This is typically used to represent a pointing device
williamr@2
   102
		coming into contact with a touch sensitive screen.
williamr@2
   103
		*/
williamr@2
   104
		EButton1Down,
williamr@2
   105
		
williamr@2
   106
		/**
williamr@2
   107
		Represents a button up event.
williamr@2
   108
		
williamr@2
   109
		This is typically used to represent a pointing device
williamr@2
   110
		being lifted away from a touch sensitive screen.
williamr@2
   111
		*/
williamr@2
   112
		EButton1Up,
williamr@2
   113
		
williamr@2
   114
		/**
williamr@2
   115
		Represents a button down event.
williamr@2
   116
		
williamr@2
   117
		This is typically used to represent a pointing device
williamr@2
   118
		coming into contact with a touch sensitive screen.
williamr@2
   119
		*/
williamr@2
   120
		EButton2Down,
williamr@2
   121
		
williamr@2
   122
		/**
williamr@2
   123
		Represents a button up event.
williamr@2
   124
		
williamr@2
   125
		This is typically used to represent a pointing device
williamr@2
   126
		being lifted away from a touch sensitive screen.
williamr@2
   127
		*/
williamr@2
   128
		EButton2Up,
williamr@2
   129
		
williamr@2
   130
		/**
williamr@2
   131
		Represents a button down event.
williamr@2
   132
		
williamr@2
   133
		This is typically used to represent a pointing device
williamr@2
   134
		coming into contact with a touch sensitive screen.
williamr@2
   135
		*/
williamr@2
   136
		EButton3Down,
williamr@2
   137
		
williamr@2
   138
		/**
williamr@2
   139
		Represents a button up event.
williamr@2
   140
		
williamr@2
   141
		This is typically used to represent a pointing device
williamr@2
   142
		being lifted away from a touch sensitive screen.
williamr@2
   143
		*/
williamr@2
   144
		EButton3Up,
williamr@2
   145
		
williamr@2
   146
		/**
williamr@2
   147
		Represents a device switch off event.
williamr@2
   148
		*/
williamr@2
   149
		ESwitchOff,
williamr@2
   150
		
williamr@2
   151
		/**
williamr@2
   152
		Represents a key being continually pressed event.
williamr@2
   153
		*/
williamr@2
   154
		EKeyRepeat,
williamr@2
   155
		
williamr@2
   156
		/**
williamr@2
   157
		Represents a case open event.
williamr@2
   158
		
williamr@2
   159
		The meaning of a case is hardware specific.
williamr@2
   160
		*/
williamr@2
   161
		ECaseOpen,
williamr@2
   162
		
williamr@2
   163
		/**
williamr@2
   164
        Represents a case close event.
williamr@2
   165
		
williamr@2
   166
		The meaning of a case is hardware specific.
williamr@2
   167
		*/
williamr@2
   168
		ECaseClose,
williamr@2
   169
williamr@2
   170
		/**
williamr@2
   171
		@prototype
williamr@2
   172
        Represents a 3D pointer entering the detection volume event.
williamr@2
   173
		
williamr@2
   174
		This is typically used to represent a pointing device
williamr@2
   175
		coming into detection range of a sensitive screen.
williamr@2
   176
		*/
williamr@2
   177
		EPointer3DInRange,
williamr@2
   178
williamr@2
   179
		/**
williamr@2
   180
		@prototype
williamr@2
   181
        Represents a 3D pointer leaving the detection volume event.
williamr@2
   182
		
williamr@2
   183
		This is typically used to represent a pointing device
williamr@2
   184
		leaving the detection range of a sensitive screen.
williamr@2
   185
		*/
williamr@2
   186
		EPointer3DOutOfRange,
williamr@2
   187
williamr@2
   188
		/**
williamr@2
   189
		@prototype
williamr@2
   190
        Represents a 3D pointer tilt changes only event.
williamr@2
   191
		
williamr@2
   192
		This is typically sent by a 3D pointer driver when it detects
williamr@2
   193
		a change in the pointer's polar coordinates (Theta or Phi).
williamr@2
   194
		*/
williamr@2
   195
		EPointer3DTilt,
williamr@2
   196
williamr@2
   197
		/**
williamr@2
   198
		@prototype
williamr@2
   199
        Represents a 3D pointer rotation only event.
williamr@2
   200
		
williamr@2
   201
		This is typically sent by a 3D pointer driver when it detects
williamr@2
   202
		a rotation of the pointing device (along ist main axis).
williamr@2
   203
		*/
williamr@2
   204
		EPointer3DRotation,
williamr@2
   205
williamr@2
   206
		/**
williamr@2
   207
		@prototype
williamr@2
   208
        Represents a general 3D pointer changes event.
williamr@2
   209
		
williamr@2
   210
		This is typically sent by a 3D pointer driver when it detects
williamr@2
   211
		a change in the pointer's linear and/or polar coordinates and/or rotation.
williamr@2
   212
		*/
williamr@2
   213
		EPointer3DTiltAndMove,
williamr@2
   214
williamr@2
   215
		/**
williamr@2
   216
		@prototype
williamr@2
   217
		Reserved for a 3D pointing device button down event.
williamr@2
   218
		*/
williamr@2
   219
		EButton4Down,
williamr@2
   220
		
williamr@2
   221
		/**
williamr@2
   222
		@prototype
williamr@2
   223
		Reserved for a 3D pointing device button up event.
williamr@2
   224
		*/
williamr@2
   225
		EButton4Up,
williamr@2
   226
williamr@2
   227
		/**
williamr@2
   228
		@prototype
williamr@2
   229
		Reserved for a 3D pointing device button down event.
williamr@2
   230
		*/
williamr@2
   231
		EButton5Down,
williamr@2
   232
		
williamr@2
   233
		/**
williamr@2
   234
		@prototype
williamr@2
   235
		Reserved for a 3D pointing device button up event.
williamr@2
   236
		*/
williamr@2
   237
		EButton5Up,
williamr@2
   238
williamr@2
   239
		/**
williamr@2
   240
		@prototype
williamr@2
   241
		Reserved for a 3D pointing device button down event.
williamr@2
   242
		*/
williamr@2
   243
		EButton6Down,
williamr@2
   244
		
williamr@2
   245
		/**
williamr@2
   246
		@prototype
williamr@2
   247
		Reserved for a 3D pointing device button up event.
williamr@2
   248
		*/
williamr@2
   249
		EButton6Up,
williamr@2
   250
williamr@2
   251
		/**
williamr@2
   252
		Represents a device restart event.
williamr@2
   253
		*/
williamr@2
   254
		ERestartSystem
williamr@2
   255
		};
williamr@2
   256
public:
williamr@2
   257
williamr@2
   258
    /**
williamr@2
   259
    Default constructor
williamr@2
   260
    */
williamr@2
   261
	inline TRawEvent()
williamr@2
   262
		{ *(TInt*)&iType=0; }
williamr@2
   263
		
williamr@2
   264
	/**
williamr@2
   265
	Gets the event type
williamr@2
   266
	
williamr@2
   267
	@return The event type.
williamr@2
   268
	*/	
williamr@2
   269
	inline TType Type() const
williamr@2
   270
		{return TType(iType);}
williamr@2
   271
williamr@2
   272
	/**
williamr@2
   273
	Gets the device number (eg. screen number)
williamr@2
   274
williamr@2
   275
	@return The device number.
williamr@2
   276
	*/
williamr@2
   277
	inline TInt DeviceNumber() const
williamr@2
   278
		{return TInt(iDeviceNumber-1);}
williamr@2
   279
williamr@2
   280
	/**
williamr@2
   281
	Sets the device number (eg. screen number)
williamr@2
   282
williamr@2
   283
	@param aDeviceNumber The device number
williamr@2
   284
	*/
williamr@2
   285
	inline void SetDeviceNumber(TInt aDeviceNumber)
williamr@2
   286
		{iDeviceNumber = TUint8(aDeviceNumber+1);}
williamr@2
   287
williamr@2
   288
	IMPORT_C TPoint Pos() const;
williamr@2
   289
	IMPORT_C TInt ScanCode() const;
williamr@2
   290
    IMPORT_C TInt Modifiers() const;
williamr@2
   291
    
williamr@2
   292
    /**
williamr@2
   293
    Gets the Cartesian coordinates of the 3D pointer end that is closer to the screen.
williamr@2
   294
    
williamr@2
   295
    @return The Cartesian coordinates of the point defined by the end of the 3D pointing device that is closer to the screen.
williamr@2
   296
    */
williamr@2
   297
	IMPORT_C TPoint3D Pos3D() const;
williamr@2
   298
    
williamr@2
   299
williamr@2
   300
	/**
williamr@2
   301
    Gets the angular spherical polar coordinates of the 3D pointer end that is closer to the screen.
williamr@2
   302
    
williamr@2
   303
    @return The angular spherical polar coordinates of the point defined by the end of the 3D pointing device that is closer to the screen.
williamr@2
   304
	@see TAngle3D
williamr@2
   305
	*/
williamr@2
   306
	IMPORT_C TAngle3D Tilt() const;
williamr@2
   307
williamr@2
   308
	/**
williamr@2
   309
    Gets the rotation angle of 3D pointing device.
williamr@2
   310
williamr@2
   311
    Some 3D pointing devices support information regarding the angle formed between the physical and magnetical poles,
williamr@2
   312
	as obtaining when rotating the pen along its main axis.
williamr@2
   313
williamr@2
   314
    @return The rotation angle of the 3D pointing device.
williamr@2
   315
    */
williamr@2
   316
	IMPORT_C TInt Rotation() const;
williamr@2
   317
williamr@2
   318
    /**
williamr@2
   319
    Gets the tick count value associated with the event.
williamr@2
   320
    
williamr@2
   321
    Note that the interval between tick counts is
williamr@2
   322
    hardware dependent.
williamr@2
   323
    
williamr@2
   324
    @return The tick count value
williamr@2
   325
    */
williamr@2
   326
	inline TUint Ticks() const
williamr@2
   327
		{return iTicks;}
williamr@2
   328
	/**
williamr@2
   329
	Gets the information on which end of the pointing device is closer to the screen
williamr@2
   330
	
williamr@2
   331
	@return A Boolean indicating which end of the pointing device is closer to the screen.
williamr@2
   332
	*/	
williamr@2
   333
	inline TBool IsTip() const
williamr@2
   334
		{return TBool(iTip);}
williamr@2
   335
	
williamr@2
   336
	/**
williamr@2
   337
	Sets the information on which end of the pointing device is closer to the screen
williamr@2
   338
	
williamr@2
   339
	@param aTip A Boolean indicating which end of the pointing device is closer to the screen.
williamr@2
   340
	*/	
williamr@2
   341
	inline void SetTip(TBool aTip)
williamr@2
   342
		{iTip = TUint8(aTip);}
williamr@2
   343
williamr@2
   344
	IMPORT_C void Set(TType aType,TInt aScanCode);
williamr@2
   345
	IMPORT_C void Set(TType aType,TInt aX,TInt aY);
williamr@2
   346
	IMPORT_C void Set(TType aType);
williamr@2
   347
williamr@2
   348
	IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ);
williamr@2
   349
	IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ,TInt aPhi,TInt aTheta,TInt aAlpha);
williamr@2
   350
williamr@2
   351
	IMPORT_C void SetTilt(TType aType,TInt aPhi,TInt aTheta);
williamr@2
   352
	IMPORT_C void SetRotation(TType aType,TInt aAlpha);
williamr@2
   353
williamr@2
   354
protected:
williamr@2
   355
	TUint8 iType;
williamr@2
   356
	TUint8 iTip;	/**< Indicates whether the tip or head of pointing device is closer to screen.*/
williamr@2
   357
	TUint8 iSpare2;
williamr@2
   358
	TUint8 iDeviceNumber;
williamr@2
   359
	TUint iTicks;
williamr@2
   360
	union
williamr@2
   361
		{
williamr@2
   362
		struct {TInt x;TInt y;} pos;
williamr@2
   363
		struct {TInt x;TInt y;TInt z;TInt phi;TInt theta;TInt alpha;} pos3D;
williamr@2
   364
		TInt scanCode;
williamr@2
   365
		TInt modifiers;
williamr@2
   366
		} iU;
williamr@2
   367
	};
williamr@2
   368
williamr@2
   369
williamr@2
   370
williamr@2
   371
williamr@2
   372
/**
williamr@2
   373
@publishedAll
williamr@2
   374
@released
williamr@2
   375
williamr@2
   376
Encapsulates a hardware event object as a descriptor (package buffer) for
williamr@2
   377
the purpose of data transfer.
williamr@2
   378
*/
williamr@2
   379
class TRawEventBuf : public TPckgBuf<TRawEvent>
williamr@2
   380
	{
williamr@2
   381
public:
williamr@2
   382
williamr@2
   383
    /**
williamr@2
   384
    Gets the hardware event object from the package buffer.
williamr@2
   385
    
williamr@2
   386
    @return The hardware event object.
williamr@2
   387
    */
williamr@2
   388
	inline TRawEvent &Event() const {return(*((TRawEvent *)&iBuf[0]));}
williamr@2
   389
	};
williamr@2
   390
williamr@2
   391
williamr@2
   392
williamr@2
   393
williamr@2
   394
/**
williamr@2
   395
@publishedPartner
williamr@2
   396
@released
williamr@2
   397
williamr@2
   398
Encapsulates information about a device's display screen.
williamr@2
   399
*/
williamr@2
   400
class TScreenInfoV01
williamr@2
   401
	{
williamr@2
   402
public:
williamr@2
   403
	TBool iWindowHandleValid; /**< Indicates whether the window handle is valid.*/
williamr@2
   404
	TAny *iWindowHandle;      /**< The window handle.*/
williamr@2
   405
	TBool iScreenAddressValid;/**< Indicates whether the screen address is valid.*/
williamr@2
   406
	TAny *iScreenAddress;     /**< The linear address of the screen.*/
williamr@2
   407
	TSize iScreenSize;        /**< The size of the screen.*/
williamr@2
   408
	};
williamr@2
   409
//
williamr@2
   410
#endif