loadgen/engine/inc/loadgen_pointerevent.h
branchRCL_3
changeset 21 b3cee849fa46
equal deleted inserted replaced
20:48060abbbeaf 21:b3cee849fa46
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef LOADGEN_POINTEREVENT_H
       
    20 #define LOADGEN_POINTEREVENT_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <w32std.h>
       
    26 #include <e32svr.h>
       
    27 #include "loadgen_loadbase.h"
       
    28 #include "loadgen_loadattributes.h"
       
    29 
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 
       
    33 
       
    34 
       
    35 // CLASS DECLARATIONS
       
    36 
       
    37 class CPointerEvent : public CLoadBase
       
    38     {
       
    39 public:
       
    40     static CPointerEvent* NewL(TPointerEventAttributes& aAttributes, TInt aReferenceNumber);
       
    41     virtual ~CPointerEvent();
       
    42         
       
    43 private: // Constructors
       
    44     CPointerEvent(TPointerEventAttributes& aAttributes, TInt aReferenceNumber);
       
    45     void ConstructL();  
       
    46 
       
    47 public:  // New methods
       
    48     virtual void Resume();
       
    49     virtual void Suspend();
       
    50     virtual void SetPriority();
       
    51     virtual void Close();
       
    52     virtual TPtrC Description();
       
    53     inline TPointerEventAttributes& Attributes() { return iAttributes; }
       
    54 	inline void SetAttributes(TPointerEventAttributes aAttributes) { iAttributes = aAttributes; }
       
    55 
       
    56 public:  // New static methods
       
    57     static TInt ThreadFunction(TAny* aThreadArg);
       
    58 
       
    59 private:  // New static methods
       
    60     static void GenerateLoad(TPointerEventAttributes& aAttributes);
       
    61 
       
    62 private: // Data
       
    63     TPointerEventAttributes         iAttributes;    
       
    64     RThread                     iThread;
       
    65     };
       
    66 
       
    67 
       
    68 class CPointerEventManager : public CActive
       
    69     {
       
    70 public:
       
    71     static CPointerEventManager* NewL(TPointerEventAttributes& aAttributes);
       
    72     ~CPointerEventManager();
       
    73 
       
    74 private:
       
    75     CPointerEventManager(TPointerEventAttributes& aAttributes);
       
    76     void ConstructL();
       
    77 
       
    78 private:
       
    79     void RunL();
       
    80     void DoCancel();
       
    81 
       
    82 private:
       
    83     static TInt PeriodicTimerCallBack(TAny* aAny);
       
    84     void SimulatePointerEvent();
       
    85 
       
    86 public:
       
    87     inline CPeriodic* PeriodicTimer() { return iPeriodicTimer; }
       
    88 
       
    89 private:
       
    90     TPointerEventAttributes&    iAttributes;    
       
    91     CPeriodic*                  iPeriodicTimer;
       
    92     //RWsSession                  iWsSession;
       
    93     }; 
       
    94 
       
    95 #endif