idlefw/plugins/wsplugin/inc/keylockstates.h
branchRCL_3
changeset 8 d0529222e3f0
parent 4 1a2a00e78665
child 11 bd874ee5e5e2
equal deleted inserted replaced
4:1a2a00e78665 8:d0529222e3f0
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Keylock handler states for Active Idle WS Plug-in.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef T_AIWSPLUGIN_KEYLOCKSTATES_H
       
    20 #define T_AIWSPLUGIN_KEYLOCKSTATES_H
       
    21 
       
    22 #include <e32def.h>
       
    23 class TRawEvent;
       
    24 
       
    25 namespace AiWsPlugin {
       
    26 
       
    27 class MKeyLockHandlerControl;
       
    28 
       
    29 /**
       
    30  *  @ingroup group_wsplugin
       
    31  *
       
    32  * Internal state structure for class CKeyLockHandler.
       
    33  * The states are behaviour-only and thus consist of just function pointers.
       
    34  */
       
    35 class TKeylockState
       
    36     {
       
    37 public:
       
    38     /**
       
    39      * Returns the state machine's initial startup state.
       
    40      */
       
    41     static const TKeylockState& StartupState();
       
    42 
       
    43     /**
       
    44      * Returns this state's default succeeding state.
       
    45      */
       
    46     inline const TKeylockState& DefaultNextState() const
       
    47         { return (*iDefaultNextState)(); }
       
    48 
       
    49     /**
       
    50      * Handles Active Idle focus changes.
       
    51      *
       
    52      * @param aControl Key lock control interface.
       
    53      * @param aState   current focus state. See CWindowAnim::FocusChaned.
       
    54      */
       
    55     inline void FocusChanged( MKeyLockHandlerControl& aControl, TBool aState ) const
       
    56         { (*iFocusChanged)( aControl, aState ); }
       
    57         
       
    58     /**
       
    59      * Handles raw Window Server events.
       
    60      *
       
    61      * @param aControl  Key lock control interface.
       
    62      * @param aRawEvent The event to handle. See MEventHandler::OfferRawEvent.
       
    63      * @return true if the event was consumed by the state, false otherwise.
       
    64      */
       
    65     inline TBool OfferRawEvent
       
    66             (  MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent ) const
       
    67         { return (*iOfferRawEvent)( aControl, aRawEvent ); }
       
    68 
       
    69     /**
       
    70      * Handles key lock timeout timer elapsed event.
       
    71      *
       
    72      * @param aControl  Key lock control interface.
       
    73      */
       
    74     inline void TimerElapsed( MKeyLockHandlerControl& aControl ) const
       
    75         { (*iTimerElapsed)( aControl ); }
       
    76 
       
    77 // Public function pointers
       
    78 
       
    79     /**
       
    80      * Pointer to state function that returns this state's default succeeding state.
       
    81      */
       
    82     const TKeylockState& (*iDefaultNextState)();
       
    83     
       
    84     /**
       
    85      * Pointer to state function which handles Active Idle focus changes.
       
    86      *
       
    87      * @param aControl Key lock control interface.
       
    88      * @param aState   current focus state. See CWindowAnim::FocusChaned.
       
    89      */
       
    90     void  (*iFocusChanged)( MKeyLockHandlerControl& aControl, TBool aState );
       
    91 
       
    92     /**
       
    93      * Pointer to state function which handles raw Window Server events.
       
    94      *
       
    95      * @param aControl  Key lock control interface.
       
    96      * @param aRawEvent The event to handle. See MEventHandler::OfferRawEvent.
       
    97      * @return true if the event was consumed by the state, false otherwise.
       
    98      */
       
    99     TBool (*iOfferRawEvent)( MKeyLockHandlerControl& aControl, const TRawEvent& aRawEvent );
       
   100     
       
   101     /**
       
   102      * Pointer to state function which handles key lock timeout timer elapsed 
       
   103      * event.
       
   104      *
       
   105      * @param aControl  Key lock control interface.
       
   106      */
       
   107     void  (*iTimerElapsed)( MKeyLockHandlerControl& aControl );
       
   108     };
       
   109 
       
   110 } // namespace AiWsPlugin
       
   111 
       
   112 #endif // T_AIWSPLUGIN_KEYLOCKSTATES_H
       
   113