epoc32/include/e32event.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    16 //
    16 //
    17 
    17 
    18 #ifndef __E32EVENT_H__
    18 #ifndef __E32EVENT_H__
    19 #define __E32EVENT_H__
    19 #define __E32EVENT_H__
    20 #include <e32cmn.h>
    20 #include <e32cmn.h>
       
    21 #ifdef BTRACE_TRAWEVENT	
       
    22 #include <e32btrace.h>
       
    23 #endif
    21 
    24 
    22 /**
    25 /**
    23 @publishedAll
    26 @publishedAll
    24 @released
    27 @released
    25 */
    28 */
   286 		{iDeviceNumber = TUint8(aDeviceNumber+1);}
   289 		{iDeviceNumber = TUint8(aDeviceNumber+1);}
   287 
   290 
   288 	IMPORT_C TPoint Pos() const;
   291 	IMPORT_C TPoint Pos() const;
   289 	IMPORT_C TInt ScanCode() const;
   292 	IMPORT_C TInt ScanCode() const;
   290     IMPORT_C TInt Modifiers() const;
   293     IMPORT_C TInt Modifiers() const;
       
   294 	IMPORT_C TInt Repeats() const;
   291     
   295     
   292     /**
   296     /**
   293     Gets the Cartesian coordinates of the 3D pointer end that is closer to the screen.
   297     Gets the Cartesian coordinates of the 3D pointer end that is closer to the screen.
   294     
   298     
   295     @return The Cartesian coordinates of the point defined by the end of the 3D pointing device that is closer to the screen.
   299     @return The Cartesian coordinates of the point defined by the end of the 3D pointing device that is closer to the screen.
   337 	Sets the information on which end of the pointing device is closer to the screen
   341 	Sets the information on which end of the pointing device is closer to the screen
   338 	
   342 	
   339 	@param aTip A Boolean indicating which end of the pointing device is closer to the screen.
   343 	@param aTip A Boolean indicating which end of the pointing device is closer to the screen.
   340 	*/	
   344 	*/	
   341 	inline void SetTip(TBool aTip)
   345 	inline void SetTip(TBool aTip)
   342 		{iTip = TUint8(aTip);}
   346 		{iTip = TUint8(aTip);
       
   347 #ifdef BTRACE_TRAWEVENT	
       
   348 		BTraceContext4(BTrace::ERawEvent, BTrace::ESetTipEvent,(TUint32)aTip);
       
   349 #endif
       
   350 		}
   343 
   351 
   344 	IMPORT_C void Set(TType aType,TInt aScanCode);
   352 	IMPORT_C void Set(TType aType,TInt aScanCode);
   345 	IMPORT_C void Set(TType aType,TInt aX,TInt aY);
   353 	IMPORT_C void Set(TType aType,TInt aX,TInt aY);
   346 	IMPORT_C void Set(TType aType);
   354 	IMPORT_C void Set(TType aType);
   347 
   355 
   348 	IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ);
   356 	IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ);
   349 	IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ,TInt aPhi,TInt aTheta,TInt aAlpha);
   357 	IMPORT_C void Set(TType aType,TInt aX,TInt aY,TInt aZ,TInt aPhi,TInt aTheta,TInt aAlpha);
   350 
   358 
   351 	IMPORT_C void SetTilt(TType aType,TInt aPhi,TInt aTheta);
   359 	IMPORT_C void SetTilt(TType aType,TInt aPhi,TInt aTheta);
   352 	IMPORT_C void SetRotation(TType aType,TInt aAlpha);
   360 	IMPORT_C void SetRotation(TType aType,TInt aAlpha);
   353 
   361 	IMPORT_C void SetRepeat(TType aType,TInt aScanCode,TInt aRepeats);
       
   362 
       
   363 	/**
       
   364 	@return the pointer number of the the event
       
   365 	*/
       
   366 	inline TUint8 PointerNumber() const
       
   367 		{
       
   368 		return iPointerNumber;
       
   369 		}
       
   370 
       
   371 
       
   372 	/**
       
   373 	The pointer number for the event is set
       
   374 	The pointer  number should be more or equal 0 and should be less than HALData::EPointerMaxPointers,
       
   375 	otherwise WSERV would ignore the event,ie 	0 <= aPointerNumber < HALData::EPointerMaxPointers 
       
   376 	@param	aPointerNumber
       
   377 	Error conditions: None.
       
   378 	*/
       
   379 	inline void SetPointerNumber(const TUint8 aPointerNumber)
       
   380 		{
       
   381 		iPointerNumber=aPointerNumber;	
       
   382 #ifdef BTRACE_TRAWEVENT	
       
   383 		BTraceContext4(BTrace::ERawEvent, BTrace::ESetPointerNumberEvent,(TUint32)aPointerNumber);
       
   384 #endif
       
   385 		}
       
   386 
       
   387     /**
       
   388 	Initialises the event with the supplied information	
       
   389 	@param	aType	The event type.
       
   390 	@param	aX		The X position.
       
   391 	@param	aY		The Y position.
       
   392 	@param	aZ		The Z position.
       
   393 	@param  aPointerNumber   The pointer number for the event
       
   394 	*/
       
   395 	IMPORT_C void Set (TType aType, TInt aX, TInt aY, TInt aZ, TUint8 aPointerNumber);
       
   396 	
   354 protected:
   397 protected:
   355 	TUint8 iType;
   398 	TUint8 iType;
   356 	TUint8 iTip;	/**< Indicates whether the tip or head of pointing device is closer to screen.*/
   399 	TUint8 iTip;	/**< Indicates whether the tip or head of pointing device is closer to screen.*/
   357 	TUint8 iSpare2;
   400 	TUint8 iPointerNumber; //
   358 	TUint8 iDeviceNumber;
   401 	TUint8 iDeviceNumber;
   359 	TUint iTicks;
   402 	TUint iTicks;
   360 	union
   403 	union
   361 		{
   404 		{
   362 		struct {TInt x;TInt y;} pos;
   405 		struct {TInt x;TInt y;} pos;
   363 		struct {TInt x;TInt y;TInt z;TInt phi;TInt theta;TInt alpha;} pos3D;
   406 		struct {TInt x;TInt y;TInt z;TInt phi;TInt theta;TInt alpha;} pos3D;
   364 		TInt scanCode;
   407 		struct {TInt scanCode;TInt repeats;} key;
   365 		TInt modifiers;
   408 		TInt modifiers;
   366 		} iU;
   409 		} iU;
   367 	};
   410 	};
   368 
   411 
   369 
   412 
   386     @return The hardware event object.
   429     @return The hardware event object.
   387     */
   430     */
   388 	inline TRawEvent &Event() const {return(*((TRawEvent *)&iBuf[0]));}
   431 	inline TRawEvent &Event() const {return(*((TRawEvent *)&iBuf[0]));}
   389 	};
   432 	};
   390 
   433 
   391 
   434 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   392 
   435 #include <e32event_private.h>
   393 
       
   394 /**
       
   395 @publishedPartner
       
   396 @released
       
   397 
       
   398 Encapsulates information about a device's display screen.
       
   399 */
       
   400 class TScreenInfoV01
       
   401 	{
       
   402 public:
       
   403 	TBool iWindowHandleValid; /**< Indicates whether the window handle is valid.*/
       
   404 	TAny *iWindowHandle;      /**< The window handle.*/
       
   405 	TBool iScreenAddressValid;/**< Indicates whether the screen address is valid.*/
       
   406 	TAny *iScreenAddress;     /**< The linear address of the screen.*/
       
   407 	TSize iScreenSize;        /**< The size of the screen.*/
       
   408 	};
       
   409 //
       
   410 #endif
   436 #endif
       
   437 
       
   438 #endif
       
   439