ui/viewmanagement/statehandler/src/glxslideshowstate.cpp
changeset 23 74c9f037fd5d
child 54 0f0f3f26f787
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     1 /*
       
     2 * Copyright (c) 2009 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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 #include <glxslideshowstate.h>
       
    19 #include <glxstatemanager.h>
       
    20 #include <glxcommandhandlers.hrh>
       
    21 #include <QDebug>
       
    22 
       
    23 GlxSlideShowState::GlxSlideShowState(GlxStateManager *stateManager, GlxState *preState) : GlxState(GLX_SLIDESHOWVIEW_ID, preState)
       
    24 {
       
    25     mStateManager = stateManager;
       
    26     mState = NO_SLIDESHOW_S;
       
    27 }
       
    28 
       
    29 void GlxSlideShowState::eventHandler( qint32 &id )
       
    30 {
       
    31     qDebug("GlxSlideShowState::GlxSlideShowState() action id = %d", id);	
       
    32     
       
    33     if ( mState == SLIDESHOW_ALBUM_ITEM_S  ) {
       
    34         albumItemEventHandler( id );
       
    35     }   
       
    36 }
       
    37 
       
    38 void GlxSlideShowState::albumItemEventHandler( qint32 &id )
       
    39 {
       
    40     switch ( id ) {
       
    41     /* in the case of slide show play through list view item specfice menu option, a new model was
       
    42      * created so first remove the current model and then go back to pervious state 
       
    43      */    
       
    44     case EGlxCmdBack :
       
    45     case EGlxCmdEmptyData : //memory card was removed ( no data )
       
    46         mStateManager->removeCurrentModel();
       
    47         mStateManager->previousState();
       
    48         id = EGlxCmdHandled;
       
    49         break;
       
    50         
       
    51     default :
       
    52         break;        
       
    53     }    
       
    54 }
       
    55