webengine/webkitutils/stmgesturefw/inc/uieventsender.h
changeset 65 5bfc169077b2
parent 42 d39add9822e2
child 66 cacf6ee57968
equal deleted inserted replaced
42:d39add9822e2 65:5bfc169077b2
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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:   Ui Event Sender Class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef UIEVENTSENDER_H_
       
    19 #define UIEVENTSENDER_H_
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <coemain.h>
       
    23 #include <rt_uievent.h>
       
    24 
       
    25 namespace stmUiEventEngine
       
    26 {
       
    27 
       
    28 class CUiEvent;
       
    29 /**
       
    30  * CUiEventSender class for handling the sending of events to the UI event listener
       
    31  */
       
    32 NONSHARABLE_CLASS(CUiEventSender): public CBase
       
    33     {
       
    34 public:
       
    35     enum TEventSenderState
       
    36         {
       
    37         ENoEvents,
       
    38         EEventsReady,
       
    39         EBusy
       
    40         };
       
    41 
       
    42     static CUiEventSender* NewL( );
       
    43     ~CUiEventSender();
       
    44 
       
    45     TInt AddEvent(CUiEvent* aGestureEvent);
       
    46     bool addObserver(MUiEventObserver* aObserver );
       
    47     bool removeObserver(MUiEventObserver* aObserver );
       
    48     void setLogging(bool a) {m_loggingenabled = a;} ;
       
    49 
       
    50 private:
       
    51     CUiEventSender();
       
    52     void EmitEventL( const CUiEvent& aGestureEvent );
       
    53 
       
    54     /*!
       
    55      * Should we be prepared for more than 5 pointers ?  Jos tulee Torvisen voittaja
       
    56      */
       
    57     CUiEvent* iEvents[stmUiEventEngine::KMaxNumberOfPointers];
       
    58     void compressStack(CUiEvent* aUiEvent) ;
       
    59 
       
    60     /*
       
    61      * Let's be prepared for more than one observer,
       
    62      * although usually there is only the gesture engine
       
    63      */
       
    64     RPointerArray<MUiEventObserver> iObserver;
       
    65     bool m_loggingenabled ;
       
    66 
       
    67     };
       
    68 }
       
    69 #endif /* UIEVENTSENDER_H_ */