windowing/windowserver/test/tauto/TEVENT.H
changeset 188 1b081cb0800b
parent 103 2717213c588a
child 178 89bd4cfee505
equal deleted inserted replaced
187:9f66f99ee56f 188:1b081cb0800b
     1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1996-2010 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 "Eclipse Public License v1.0"
     4 // under the terms of "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.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    36 #include <graphics/surfaceupdateclient.h>
    36 #include <graphics/surfaceupdateclient.h>
    37 #endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
    37 #endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 
    38 
    38 
    39 const TInt EMaxEventQueueSize=32;
    39 const TInt EMaxEventQueueSize=32;
    40 const TInt EMinQueueSize = 2;
    40 const TInt EMinQueueSize = 2;
       
    41 const TUint KModifiersIgnore = 0xffffffff;
    41 
    42 
    42 
    43 
    43 class CTEventTest;
    44 class CTEventTest;
    44 class CTQueueClient;
    45 class CTQueueClient;
    45 
    46 
   261 		ECancelCaptureKeyUpAndDowns,		
   262 		ECancelCaptureKeyUpAndDowns,		
   262 		ECancelCaptureLongKey,
   263 		ECancelCaptureLongKey,
   263 		// Add additional enum values before this line
   264 		// Add additional enum values before this line
   264 		EMaxCancelCaptureKeyApis
   265 		EMaxCancelCaptureKeyApis
   265 		};
   266 		};
       
   267 	enum TLongkeyCapPriorityTests
       
   268 		{
       
   269 		ELongkeyCaptureSamePriority,
       
   270 		ELongkeyCaptureDiffPriority
       
   271 		};
   266 private:
   272 private:
   267 	void RunTestsL(TBool aNeedChildWindows=EFalse);
   273 	void RunTestsL(TBool aNeedChildWindows=EFalse);
   268 	void RunTestsRestoreAreaL(TBool aNeedChildWindows);
   274 	void RunTestsRestoreAreaL(TBool aNeedChildWindows);
   269 	void QueuePurge_NextSetOfEventsL();
   275 	void QueuePurge_NextSetOfEventsL();
   270 	void InitializeQueueSizeTestL(TBool aEventReadyCancel);
   276 	void InitializeQueueSizeTestL(TBool aEventReadyCancel);
   283 	void KeyClicks_NextSetOfEvents();
   289 	void KeyClicks_NextSetOfEvents();
   284 	void CaptureLong_NextSetOfEventsL();
   290 	void CaptureLong_NextSetOfEventsL();
   285 	void Password_NextSetOfEvents();
   291 	void Password_NextSetOfEvents();
   286 	void GroupListChanged_NextSetOfEventsL();
   292 	void GroupListChanged_NextSetOfEventsL();
   287 	void VisibilityChanged_NextSetOfEventsL();
   293 	void VisibilityChanged_NextSetOfEventsL();
       
   294 #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
       
   295 	void KeyEventTranslation_NextSetOfEventsL();
       
   296 	void KeyEventBlocking_NextSetOfEventsL();
       
   297 	void KeyEventAppRestriction_NextSetOfEventsL();
       
   298 	void KeyEventAppPriority_NextSetOfEventsL();
   288 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
   299 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
   289 #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA  	
       
   290 	void SurfaceVisibilityChanged1_NextSetOfEventsL();
   300 	void SurfaceVisibilityChanged1_NextSetOfEventsL();
   291 	void SurfaceVisibilityChanged2_NextSetOfEventsL();
   301 	void SurfaceVisibilityChanged2_NextSetOfEventsL();
   292 	void SurfaceVisibilityChanged3_NextSetOfEventsL();
   302 	void SurfaceVisibilityChanged3_NextSetOfEventsL();
       
   303 #endif //SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
   293 #endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
   304 #endif //TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
   294 #endif //SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
       
   295 	void CheckTimeStamp_NextSetOfEventsL();
   305 	void CheckTimeStamp_NextSetOfEventsL();
   296 	void RepeatableKeysL();
   306 	void RepeatableKeysL();
   297 	void PointerCapture_NextSetOfEventsL();
   307 	void PointerCapture_NextSetOfEventsL();
   298 	void PointerBufferPurge_NextSetOfEventsL();
   308 	void PointerBufferPurge_NextSetOfEventsL();
   299 	void MismatchedCapture_NextSetOfEventsL();	
   309 	void MismatchedCapture_NextSetOfEventsL();	
   309 	void EventHandlerRemoval_RemoveAndResetAllAnims();
   319 	void EventHandlerRemoval_RemoveAndResetAllAnims();
   310 	void EventHandlerRemoval_DestroyAllAnims();
   320 	void EventHandlerRemoval_DestroyAllAnims();
   311 	void EventHandlerRemoval_AddEventHandlerMultipleTimes();
   321 	void EventHandlerRemoval_AddEventHandlerMultipleTimes();
   312 	void CheckPointerCursorInDifferentScreenMode(TSizeMode aMode,TPoint aOrigin);
   322 	void CheckPointerCursorInDifferentScreenMode(TSizeMode aMode,TPoint aOrigin);
   313 	void SimulateAndCheck(TPoint aOrigin,TSize aScale,TInt aXOffset,TInt aYOffset,TPointerEvent::TType aEventType,TRect aPointerCursorArea);
   323 	void SimulateAndCheck(TPoint aOrigin,TSize aScale,TInt aXOffset,TInt aYOffset,TPointerEvent::TType aEventType,TRect aPointerCursorArea);
   314 	void AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);
   324 	void AddExpectedKey(TInt aEventCode, TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=KModifiersIgnore);
   315 	void AddExpectedKeyDownUp(TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=0);
   325 	void AddExpectedKeyDownUp(TInt aScanCode, TInt aCode=0, TInt aRepeats=0, TUint aModifiers=KModifiersIgnore);
   316 	void AddExpectedEvent(TInt aEventCode, CTWinBase* aWin);
   326 	void AddExpectedEvent(TInt aEventCode, CTWinBase* aWin);
   317 	void AddExpectedEvent(TInt aEventCode);
   327 	void AddExpectedEvent(TInt aEventCode);
   318 	void AddExpectedEvent(TInt aEventCode,RWindowGroup* aWindow);
   328 	void AddExpectedEvent(TInt aEventCode,RWindowGroup* aWindow);
   319 	void AddExpectedErrorMessage(TWsErrorMessage::TErrorCategory aCategory, TInt aError);
   329 	void AddExpectedErrorMessage(TWsErrorMessage::TErrorCategory aCategory, TInt aError);
   320 	void CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos);
   330 	void CalculatePointerEvent(TWsEvent& aEvent,TPointerEvent::TType aType, TPoint aPos);
   356 #if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
   366 #if !defined(TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA)
   357 	void SimulateButton1DownWithSimulatedMove(TInt aX, TInt aY);
   367 	void SimulateButton1DownWithSimulatedMove(TInt aX, TInt aY);
   358 #endif
   368 #endif
   359 	void TestCaptureAndCancelCapturePair(TCaptureKeyApis aCaptureApi, TCancelCaptureKeyApis aCancelCaptureApi);
   369 	void TestCaptureAndCancelCapturePair(TCaptureKeyApis aCaptureApi, TCancelCaptureKeyApis aCancelCaptureApi);
   360 	static TInt GenerateAnEvent(TAny* aEventTest);
   370 	static TInt GenerateAnEvent(TAny* aEventTest);
       
   371 	void CheckLongkeyCaptureWithPriority(TLongkeyCapPriorityTests aTestType);
       
   372 	void DelayForRepeatEvents(TInt aNumeratorFracVal, TInt aDenominatorFracVal);
       
   373 #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
       
   374 	void SpawnCaptureAppL(RProcess& aProcess);
       
   375 #endif
   361 private:
   376 private:
   362 	CTBlankWindow* iBlankWin;
   377 	CTBlankWindow* iBlankWin;
   363 	RBlankWindow iBackingWindow;
   378 	RBlankWindow iBackingWindow;
   364 	TSize iPhysicalScreenSize;
   379 	TSize iPhysicalScreenSize;
   365 	TSize iWinSize;
   380 	TSize iWinSize;
   388 	RAnimDll* iAnimDll;
   403 	RAnimDll* iAnimDll;
   389 	RPointerArray<RRemovableAnim>* iRemovableAnims;
   404 	RPointerArray<RRemovableAnim>* iRemovableAnims;
   390 	TBool iIs3DPointer;
   405 	TBool iIs3DPointer;
   391 	TBool iPtrPluginLoaded;
   406 	TBool iPtrPluginLoaded;
   392 	TInt iYOffset;
   407 	TInt iYOffset;
       
   408 	TTimeIntervalMicroSeconds32 iKeyBoardRepeatInitialDelay;
       
   409 	TTimeIntervalMicroSeconds32 iKeyBoardRepeatNextDelay;
       
   410 #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
       
   411 	RProcess iCaptureApp1;
       
   412 	RProcess iCaptureApp2;
   393 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
   413 #ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS	
   394 #ifndef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA 	
       
   395 	TSurfaceId iSurfaceId;
   414 	TSurfaceId iSurfaceId;
   396 	RSurfaceManager iSurfaceManager;
   415 	RSurfaceManager iSurfaceManager;
   397 	CPeriodic* iTimeOutCallback;
   416 	CPeriodic* iTimeOutCallback;
       
   417 #endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
   398 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
   418 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
   399 #endif // SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
       
   400 	};
   419 	};
   401 
   420 
   402 class CTQueueWindowGroup : public CTWindowGroup
   421 class CTQueueWindowGroup : public CTWindowGroup
   403 	{
   422 	{
   404 public:
   423 public: