photosgallery/slideshow/engine/controlsrc/shwevent.cpp
changeset 0 4e91876724a2
child 35 420f6808bf21
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2007-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 "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:    Default event implementations
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDES
       
    22 #include "shwevent.h"
       
    23 
       
    24 // -----------------------------------------------------------------------------
       
    25 // Constructor. iValue is set
       
    26 // -----------------------------------------------------------------------------
       
    27 TShwParametrizedEvent::TShwParametrizedEvent( TInt aValue ) : iValue( aValue )
       
    28 	{
       
    29 	}
       
    30 	
       
    31 // -----------------------------------------------------------------------------
       
    32 // Destructor.
       
    33 // -----------------------------------------------------------------------------
       
    34 TShwParametrizedEvent::~TShwParametrizedEvent()
       
    35 	{
       
    36 	}
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // Parameter.
       
    40 // -----------------------------------------------------------------------------
       
    41 TInt TShwParametrizedEvent::Parameter()
       
    42 	{
       
    43 	return iValue;
       
    44 	}
       
    45 
       
    46 // Macro to avoid copy & pasting similar code throughout the event classes
       
    47 #define SHW_DEFINE_EVENT_CLASS( cls ) \
       
    48 cls::cls() \
       
    49 	{ } \
       
    50 cls::~cls() \
       
    51 	{ } \
       
    52 MShwEvent* cls::CloneLC()\
       
    53 	{ \
       
    54 	cls* copy = new( ELeave ) cls; \
       
    55 	CleanupStack::PushL( copy ); \
       
    56 	return copy; \
       
    57 	}
       
    58 
       
    59 #define SHW_DEFINE_PARAMETER_EVENT_CLASS( cls ) \
       
    60 cls::cls( TInt aValue ) : TShwParametrizedEvent( aValue ) \
       
    61 	{ } \
       
    62 cls::~cls() \
       
    63 	{ } \
       
    64 MShwEvent* cls::CloneLC() \
       
    65 	{ \
       
    66 	cls* copy = new( ELeave ) cls( Parameter() ); \
       
    67 	CleanupStack::PushL( copy ); \
       
    68 	return copy; \
       
    69 	}
       
    70 
       
    71 /**
       
    72  * Initialize the show
       
    73  */
       
    74 SHW_DEFINE_EVENT_CLASS( TShwEventInitialize )
       
    75 
       
    76 /**
       
    77  * Start the slideshow
       
    78  */
       
    79 SHW_DEFINE_EVENT_CLASS( TShwEventStart )
       
    80 
       
    81 /**
       
    82  * Pause the slideshow 
       
    83  */
       
    84 SHW_DEFINE_EVENT_CLASS( TShwEventPause )
       
    85 
       
    86 /**
       
    87  * Resume from pause
       
    88  */
       
    89 SHW_DEFINE_EVENT_CLASS( TShwEventResume )
       
    90 
       
    91 /**
       
    92  *  Next image by the user
       
    93  */
       
    94 SHW_DEFINE_EVENT_CLASS( TShwEventNextImage )
       
    95 
       
    96 /**
       
    97  * Previous image by the user
       
    98  */
       
    99 SHW_DEFINE_EVENT_CLASS( TShwEventPreviousImage )
       
   100 
       
   101 /**
       
   102  * Timer beat occurred
       
   103  */
       
   104 SHW_DEFINE_EVENT_CLASS( TShwEventTimerBeat )
       
   105 
       
   106 /**
       
   107  * View mode is starting
       
   108  */
       
   109 SHW_DEFINE_PARAMETER_EVENT_CLASS( TShwEventStartView  )
       
   110 
       
   111 /**
       
   112  * Ready to start viewing current slide
       
   113  */
       
   114 SHW_DEFINE_EVENT_CLASS( TShwEventReadyToView );
       
   115 
       
   116 /**
       
   117  * Ready to advance to next slide
       
   118  */
       
   119 SHW_DEFINE_EVENT_CLASS( TShwEventReadyToAdvance )
       
   120 
       
   121 /**
       
   122  * Transition mode is starting
       
   123  */
       
   124 SHW_DEFINE_PARAMETER_EVENT_CLASS( TShwEventStartTransition )
       
   125 
       
   126 /**
       
   127  * Transition mode is ready
       
   128  */
       
   129 SHW_DEFINE_EVENT_CLASS( TShwEventTransitionReady )
       
   130 
       
   131 /**
       
   132  * Music volume is adjusted down
       
   133  */
       
   134 SHW_DEFINE_EVENT_CLASS( TShwEventVolumeDown );
       
   135 
       
   136 /**
       
   137  * Music volume is adjusted up
       
   138  */
       
   139 SHW_DEFINE_EVENT_CLASS( TShwEventVolumeUp );
       
   140 
       
   141 /**
       
   142  * Slideshow needs to be exited because of a fatal error
       
   143  */
       
   144 SHW_DEFINE_EVENT_CLASS( TShwEventFatalError );
       
   145 
       
   146 /**
       
   147  * Selection key pressed for changed ui state (Hide or visible)
       
   148  */
       
   149 SHW_DEFINE_EVENT_CLASS( TShwEventToggleControlUi);