|
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 |
|
19 |
|
20 #include <glxfullscreenstate.h> |
|
21 #include <glxstatemanager.h> |
|
22 #include <glxcommandhandlers.hrh> |
|
23 |
|
24 GlxFullScreenState::GlxFullScreenState(GlxStateManager *stateManager, GlxState *preState) : GlxState(GLX_FULLSCREENVIEW_ID, preState) |
|
25 { |
|
26 mStateManager = stateManager ; |
|
27 } |
|
28 |
|
29 void GlxFullScreenState::eventHandler(qint32 &id) |
|
30 { |
|
31 switch ( id ){ |
|
32 case EGlxCmdDetailsOpen : |
|
33 if ( mState == IMAGEVIEWER_S ) { |
|
34 |
|
35 mStateManager->nextState( GLX_DETAILSVIEW_ID, IMAGEVIEWER_DETAIL_S ); |
|
36 } |
|
37 else { |
|
38 |
|
39 mStateManager->nextState( GLX_DETAILSVIEW_ID, NO_DETAIL_S ); |
|
40 } |
|
41 id = EGlxCmdHandled; |
|
42 break ; |
|
43 default : |
|
44 break ; |
|
45 } |
|
46 } |
|
47 |
|
48 void GlxFullScreenState::setTranstionParameter(NavigationDir dir, GlxEffect &effect, GlxViewEffect &viewEffect) |
|
49 { |
|
50 GlxState *preState = previousState(); |
|
51 effect = NO_EFFECT ; |
|
52 viewEffect = NO_VIEW ; |
|
53 |
|
54 if ( preState == NULL ) { |
|
55 return ; |
|
56 } |
|
57 |
|
58 if ( dir == FORWARD_DIR ){ |
|
59 if ( preState->compare( GLX_GRIDVIEW_ID ) ) { |
|
60 effect = GRID_TO_FULLSCREEN ; |
|
61 viewEffect = BOTH_VIEW ; |
|
62 } |
|
63 } |
|
64 else if ( dir == BACKWARD_DIR ) { |
|
65 if ( preState->compare( GLX_GRIDVIEW_ID ) ) { |
|
66 effect = FULLSCREEN_TO_GRID; |
|
67 viewEffect = LAUNCH_VIEW; |
|
68 } |
|
69 } |
|
70 } |
|
71 |