ui/views/fullscreenview/inc/glxcoverflow.h
author hgs
Mon, 23 Aug 2010 18:06:16 +0530
changeset 58 383b67fbdb11
parent 52 a3a4c0de738e
child 62 36d93b4dc635
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:   ?Description
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
*
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*/
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#ifndef GLXCOVERFLOW_H
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#define GLXCOVERFLOW_H
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#define NBR_ICON_ITEM 5
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <hbeffect.h>
45
hgs
parents: 44
diff changeset
    26
#include <hbwidget.h>
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
//forward declaration
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
class HbIconItem;
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
class HbMainWindow;
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
class QAbstractItemModel;
45
hgs
parents: 44
diff changeset
    32
class QGestureEvent;
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
typedef enum
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
{
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
    NO_MOVE,
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
    TAP_MOVE,
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    LEFT_MOVE,
58
hgs
parents: 52
diff changeset
    39
    RIGHT_MOVE
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
} GlxUserMove;
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
typedef enum
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
{
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    TAP_EVENT, //send the signal when user tap on full screen
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
    PANNING_START_EVENT, //send the signal when panning of full screen start
50
hgs
parents: 45
diff changeset
    46
    EMPTY_ROW_EVENT, //send the signal when model have no data
hgs
parents: 45
diff changeset
    47
    ZOOM_START_EVENT
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
} GlxCoverFlowEvent;
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
58
hgs
parents: 52
diff changeset
    50
/**
hgs
parents: 52
diff changeset
    51
 * Class Description
hgs
parents: 52
diff changeset
    52
 * This is cover flow class to show and browse the image in fullscreen mode.
hgs
parents: 52
diff changeset
    53
 */
40
hgs
parents: 26
diff changeset
    54
class GlxCoverFlow : public HbWidget
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
{
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
Q_OBJECT
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    57
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    58
public :
58
hgs
parents: 52
diff changeset
    59
    /**
hgs
parents: 52
diff changeset
    60
     * Constructor
hgs
parents: 52
diff changeset
    61
     * @param - QGraphicsItem parent of this widget
hgs
parents: 52
diff changeset
    62
     */    
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    63
	GlxCoverFlow (QGraphicsItem *parent = NULL);
58
hgs
parents: 52
diff changeset
    64
	
hgs
parents: 52
diff changeset
    65
    /**
hgs
parents: 52
diff changeset
    66
     * Destructor
hgs
parents: 52
diff changeset
    67
     */	
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
	~GlxCoverFlow ();
58
hgs
parents: 52
diff changeset
    69
	
hgs
parents: 52
diff changeset
    70
	/**
hgs
parents: 52
diff changeset
    71
	 * setItemSize() - To set the fullscreen image size.
hgs
parents: 52
diff changeset
    72
	 * @param - size of fullscreen.
hgs
parents: 52
diff changeset
    73
	 */
hgs
parents: 52
diff changeset
    74
    void setItemSize( QSize &size );
hgs
parents: 52
diff changeset
    75
    
hgs
parents: 52
diff changeset
    76
    /**
hgs
parents: 52
diff changeset
    77
     * setModel() - To set the data provider of the widget.
hgs
parents: 52
diff changeset
    78
     * @param - data model pointor 
hgs
parents: 52
diff changeset
    79
     */
hgs
parents: 52
diff changeset
    80
    void setModel( QAbstractItemModel *model );
hgs
parents: 52
diff changeset
    81
    
hgs
parents: 52
diff changeset
    82
    /**
hgs
parents: 52
diff changeset
    83
     * indexChanged() - Call back to get the focus index change.
hgs
parents: 52
diff changeset
    84
     * @param - new focus index.
hgs
parents: 52
diff changeset
    85
     */
hgs
parents: 52
diff changeset
    86
    void indexChanged( int index );
hgs
parents: 52
diff changeset
    87
    
hgs
parents: 52
diff changeset
    88
    /**
hgs
parents: 52
diff changeset
    89
     * setUiOn() - Call back to get the ui on/off status.
hgs
parents: 52
diff changeset
    90
     * @param - ui on/off status
hgs
parents: 52
diff changeset
    91
     */
hgs
parents: 52
diff changeset
    92
    void setUiOn( bool uiOn ) { mUiOn = uiOn; }
hgs
parents: 52
diff changeset
    93
    
hgs
parents: 52
diff changeset
    94
    /**
hgs
parents: 52
diff changeset
    95
     * partiallyClean() - To clean all the item except focus one for improved the
hgs
parents: 52
diff changeset
    96
     * view transition animation.
hgs
parents: 52
diff changeset
    97
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    void partiallyClean();
58
hgs
parents: 52
diff changeset
    99
    
hgs
parents: 52
diff changeset
   100
    /*
hgs
parents: 52
diff changeset
   101
     * partiallyCreate() - To update the focus item only for improved the view transition
hgs
parents: 52
diff changeset
   102
     * animtaion.
hgs
parents: 52
diff changeset
   103
     * @param - data model pointer
hgs
parents: 52
diff changeset
   104
     * @param - size of fullscreen.
hgs
parents: 52
diff changeset
   105
     * @param - image pos in the screen. 
hgs
parents: 52
diff changeset
   106
     */
hgs
parents: 52
diff changeset
   107
    void partiallyCreate( QAbstractItemModel *model, QSize itemSize, int posY = 0 );
hgs
parents: 52
diff changeset
   108
	
hgs
parents: 52
diff changeset
   109
    /**
hgs
parents: 52
diff changeset
   110
	 * setCoverFlow() - To initialise the coverflow.
hgs
parents: 52
diff changeset
   111
	 */
hgs
parents: 52
diff changeset
   112
    void setCoverFlow();
hgs
parents: 52
diff changeset
   113
    
hgs
parents: 52
diff changeset
   114
    /**
hgs
parents: 52
diff changeset
   115
     * ClearCoverFlow() - To cleanup the memory and connection.
hgs
parents: 52
diff changeset
   116
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
    void ClearCoverFlow();
58
hgs
parents: 52
diff changeset
   118
    
hgs
parents: 52
diff changeset
   119
    /**
hgs
parents: 52
diff changeset
   120
     * setMultitouchFilter(() - To Set the widget who is interested in multi touch
hgs
parents: 52
diff changeset
   121
     * gesture event.
hgs
parents: 52
diff changeset
   122
     * @param - widget pointer
hgs
parents: 52
diff changeset
   123
     */
hgs
parents: 52
diff changeset
   124
	void setMultitouchFilter( QGraphicsItem* multitouchFilter );
50
hgs
parents: 45
diff changeset
   125
	
58
hgs
parents: 52
diff changeset
   126
	/**
hgs
parents: 52
diff changeset
   127
     * getFocusIndex() - To return the focus index
hgs
parents: 52
diff changeset
   128
     * @return - focus index.
50
hgs
parents: 45
diff changeset
   129
     */
hgs
parents: 45
diff changeset
   130
    int getFocusIndex( );
hgs
parents: 45
diff changeset
   131
58
hgs
parents: 52
diff changeset
   132
    /**
hgs
parents: 52
diff changeset
   133
     * getIcon() - to retuen the full screen icon of the image
hgs
parents: 52
diff changeset
   134
     * @param  - index of imges which icon is required.
hgs
parents: 52
diff changeset
   135
     * @return - icon of the image.
50
hgs
parents: 45
diff changeset
   136
     */
hgs
parents: 45
diff changeset
   137
    HbIcon getIcon( int index );
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
		    
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
public slots:
58
hgs
parents: 52
diff changeset
   140
    /**
hgs
parents: 52
diff changeset
   141
     * zoomStarted() - Call back about user has start the zooming.
hgs
parents: 52
diff changeset
   142
     * @param - focus index.
hgs
parents: 52
diff changeset
   143
     */
hgs
parents: 52
diff changeset
   144
	void zoomStarted( int index );
hgs
parents: 52
diff changeset
   145
	
hgs
parents: 52
diff changeset
   146
	/**
hgs
parents: 52
diff changeset
   147
	 * zoomFinished() - Call back about user has finished the zoom and come back 
hgs
parents: 52
diff changeset
   148
	 * to coverflow.
hgs
parents: 52
diff changeset
   149
	 *  @param - focus index.
hgs
parents: 52
diff changeset
   150
	 */
hgs
parents: 52
diff changeset
   151
	void zoomFinished( int index );
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   152
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   153
signals :
58
hgs
parents: 52
diff changeset
   154
    /**
hgs
parents: 52
diff changeset
   155
     * coverFlowEvent() - To emit signal about coverflow event happen like panning, zomming ( For ui off ),
hgs
parents: 52
diff changeset
   156
     * Tap ( for ui on/off ) etc.
hgs
parents: 52
diff changeset
   157
     * @param - type of event
hgs
parents: 52
diff changeset
   158
     */
hgs
parents: 52
diff changeset
   159
    void coverFlowEvent( GlxCoverFlowEvent e );
hgs
parents: 52
diff changeset
   160
    
hgs
parents: 52
diff changeset
   161
    /**
hgs
parents: 52
diff changeset
   162
     * changeSelectedIndex() - To emit the signal about focus inde change
hgs
parents: 52
diff changeset
   163
     * @param - new focus index
hgs
parents: 52
diff changeset
   164
     */
hgs
parents: 52
diff changeset
   165
    void changeSelectedIndex( const QModelIndex &index );
hgs
parents: 52
diff changeset
   166
    
hgs
parents: 52
diff changeset
   167
    /**
hgs
parents: 52
diff changeset
   168
     * autoLeftMoveSignal() - Internal signal to move the next image with transition animation.
hgs
parents: 52
diff changeset
   169
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   170
    void autoLeftMoveSignal();
58
hgs
parents: 52
diff changeset
   171
    
hgs
parents: 52
diff changeset
   172
    /**
hgs
parents: 52
diff changeset
   173
     * autoRightMoveSignal() - Internal signal to move the previous image with transition animation.
hgs
parents: 52
diff changeset
   174
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
    void autoRightMoveSignal();
58
hgs
parents: 52
diff changeset
   176
    
hgs
parents: 52
diff changeset
   177
    /**
hgs
parents: 52
diff changeset
   178
     * doubleTapEventReceived() - To emit the signal about double tap happen.
hgs
parents: 52
diff changeset
   179
     * @param - coordinate of double tap postion with respect of view.
hgs
parents: 52
diff changeset
   180
     */
hgs
parents: 52
diff changeset
   181
    void doubleTapEventReceived( QPointF position );
hgs
parents: 52
diff changeset
   182
    
hgs
parents: 52
diff changeset
   183
    /**
hgs
parents: 52
diff changeset
   184
     * moveNextSignal() - Internal signal to handle the buffering logic when user move
hgs
parents: 52
diff changeset
   185
     * to prevoius image.
hgs
parents: 52
diff changeset
   186
     */
hgs
parents: 52
diff changeset
   187
    void moveNextSignal();
hgs
parents: 52
diff changeset
   188
    
hgs
parents: 52
diff changeset
   189
    /**
hgs
parents: 52
diff changeset
   190
     * movePreviousSignal() - Internal signal to handle the buffernig loigc when user move 
hgs
parents: 52
diff changeset
   191
     * to previous image.
hgs
parents: 52
diff changeset
   192
     */
hgs
parents: 52
diff changeset
   193
    void movePreviousSignal();
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
protected slots:
58
hgs
parents: 52
diff changeset
   196
    /**
hgs
parents: 52
diff changeset
   197
     * panGesture() - To handle the pan gesture event.
hgs
parents: 52
diff changeset
   198
     * @param -  user move delta postion.
hgs
parents: 52
diff changeset
   199
     */
hgs
parents: 52
diff changeset
   200
    void panGesture ( const QPointF & delta ) ;
hgs
parents: 52
diff changeset
   201
    
hgs
parents: 52
diff changeset
   202
    /**
hgs
parents: 52
diff changeset
   203
     * dataChanged() - call back to monitor the widget data changed.
hgs
parents: 52
diff changeset
   204
     * @param - start index of data changed.
hgs
parents: 52
diff changeset
   205
     * @param - end index of data changed.
hgs
parents: 52
diff changeset
   206
     */
hgs
parents: 52
diff changeset
   207
    void dataChanged( QModelIndex startIndex, QModelIndex endIndex );
hgs
parents: 52
diff changeset
   208
    
hgs
parents: 52
diff changeset
   209
    /**
hgs
parents: 52
diff changeset
   210
     * rowsInserted() - call back of new row inserted in the model.
hgs
parents: 52
diff changeset
   211
     * @param - Items are inserted under parent.
hgs
parents: 52
diff changeset
   212
     * @param - start index of items inserted.
hgs
parents: 52
diff changeset
   213
     * @param - end index of items removed.
hgs
parents: 52
diff changeset
   214
     */    
hgs
parents: 52
diff changeset
   215
    void rowsInserted( const QModelIndex &parent, int start, int end );
hgs
parents: 52
diff changeset
   216
    
hgs
parents: 52
diff changeset
   217
    /**
hgs
parents: 52
diff changeset
   218
     * rowsRemoved() - call back of new row removed in the model.
hgs
parents: 52
diff changeset
   219
     * @param - Items are removed from parent item.
hgs
parents: 52
diff changeset
   220
     * @param - start index of items inserted.
hgs
parents: 52
diff changeset
   221
     * @param - end index of items removed.
hgs
parents: 52
diff changeset
   222
     */    
hgs
parents: 52
diff changeset
   223
    void rowsRemoved( const QModelIndex &parent, int start, int end );
hgs
parents: 52
diff changeset
   224
    
hgs
parents: 52
diff changeset
   225
    /**
hgs
parents: 52
diff changeset
   226
     * modelDestroyed() - call back to monitor the model destroy.
hgs
parents: 52
diff changeset
   227
     */
45
hgs
parents: 44
diff changeset
   228
    void modelDestroyed();
58
hgs
parents: 52
diff changeset
   229
hgs
parents: 52
diff changeset
   230
    /**
hgs
parents: 52
diff changeset
   231
     * autoLeftMove() - To play the next image move and bounce back transition animation.
hgs
parents: 52
diff changeset
   232
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
    void autoLeftMove();
58
hgs
parents: 52
diff changeset
   234
    
hgs
parents: 52
diff changeset
   235
    /**
hgs
parents: 52
diff changeset
   236
     * autoRightMove() - To play the previous image move and bounce back transition animation.
hgs
parents: 52
diff changeset
   237
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
    void autoRightMove();
58
hgs
parents: 52
diff changeset
   239
    
hgs
parents: 52
diff changeset
   240
    /**
hgs
parents: 52
diff changeset
   241
     * moveNextImage() - To Handle user next image move for buffering logic, emit the signal about
hgs
parents: 52
diff changeset
   242
     * new focus index and set some widget properties.
hgs
parents: 52
diff changeset
   243
     */
hgs
parents: 52
diff changeset
   244
    void moveNextImage();
hgs
parents: 52
diff changeset
   245
    
hgs
parents: 52
diff changeset
   246
    /**
hgs
parents: 52
diff changeset
   247
     * movePreviousImage() - To Handle user pervious image move for buffering logic, emit the signal about
hgs
parents: 52
diff changeset
   248
     * new focus index and set some widget properties.
hgs
parents: 52
diff changeset
   249
     */    
hgs
parents: 52
diff changeset
   250
    void movePreviousImage();
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
protected:
58
hgs
parents: 52
diff changeset
   253
    /**
hgs
parents: 52
diff changeset
   254
     * gestureEvent() - override function to handle the gesture event.
hgs
parents: 52
diff changeset
   255
     * @param - pointer of QGestureEvent
hgs
parents: 52
diff changeset
   256
     */
hgs
parents: 52
diff changeset
   257
	void gestureEvent( QGestureEvent *event );
hgs
parents: 52
diff changeset
   258
	
hgs
parents: 52
diff changeset
   259
	/**
hgs
parents: 52
diff changeset
   260
	 * move() - Change the postion of items for transition animation.
hgs
parents: 52
diff changeset
   261
	 * @parma - delta move.
hgs
parents: 52
diff changeset
   262
	 */
hgs
parents: 52
diff changeset
   263
    void move( int value );
hgs
parents: 52
diff changeset
   264
    
hgs
parents: 52
diff changeset
   265
    /**
hgs
parents: 52
diff changeset
   266
     * setRows() - set the number of rows.
hgs
parents: 52
diff changeset
   267
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   268
    void setRows() ;
58
hgs
parents: 52
diff changeset
   269
    
hgs
parents: 52
diff changeset
   270
    /**
hgs
parents: 52
diff changeset
   271
     * setStripLen() - set the virtual strip length of coverflow.
hgs
parents: 52
diff changeset
   272
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   273
    void setStripLen();
58
hgs
parents: 52
diff changeset
   274
    
hgs
parents: 52
diff changeset
   275
    /**
hgs
parents: 52
diff changeset
   276
     * calculateIndex() - For cyclic cover flow map the index to actual item index.
hgs
parents: 52
diff changeset
   277
     * @param - index of the index.
hgs
parents: 52
diff changeset
   278
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   279
    int calculateIndex(int index);
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   280
    
58
hgs
parents: 52
diff changeset
   281
    /**
hgs
parents: 52
diff changeset
   282
     * loadIconItems() - Set the icon, size and postion of the icon items.
hgs
parents: 52
diff changeset
   283
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   284
    void loadIconItems (); 
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   285
    
58
hgs
parents: 52
diff changeset
   286
    /**
hgs
parents: 52
diff changeset
   287
     * updateIconItem() - Set the icon, size and postion of the a particular item.
hgs
parents: 52
diff changeset
   288
     * It is used to support buffering logic and when user move to next or previous image.
hgs
parents: 52
diff changeset
   289
     * @param - image index.
hgs
parents: 52
diff changeset
   290
     * @param - item index in array.
hgs
parents: 52
diff changeset
   291
     * @param - position of the item.
hgs
parents: 52
diff changeset
   292
     */
hgs
parents: 52
diff changeset
   293
    void updateIconItem ( qint16 selIndex, qint16 selIconIndex, qint16 posX );
hgs
parents: 52
diff changeset
   294
    
hgs
parents: 52
diff changeset
   295
    /**
hgs
parents: 52
diff changeset
   296
     * playAnimation() - In the case of animated image, it will play the animation for focus image
45
hgs
parents: 44
diff changeset
   297
     */
hgs
parents: 44
diff changeset
   298
    void playAnimation();
hgs
parents: 44
diff changeset
   299
    
58
hgs
parents: 52
diff changeset
   300
    /**
hgs
parents: 52
diff changeset
   301
     * stopAnimation() - To stop the animation
45
hgs
parents: 44
diff changeset
   302
     */
hgs
parents: 44
diff changeset
   303
    void stopAnimation();
hgs
parents: 44
diff changeset
   304
    
hgs
parents: 44
diff changeset
   305
    /*
58
hgs
parents: 52
diff changeset
   306
     * clearCurrentModel() - clear all the model connection
45
hgs
parents: 44
diff changeset
   307
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   308
    void clearCurrentModel();
45
hgs
parents: 44
diff changeset
   309
    
hgs
parents: 44
diff changeset
   310
    /*
58
hgs
parents: 52
diff changeset
   311
     * initializeNewModel() - add the connection to the model
45
hgs
parents: 44
diff changeset
   312
     */
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   313
    void initializeNewModel();
45
hgs
parents: 44
diff changeset
   314
    
hgs
parents: 44
diff changeset
   315
    /*
58
hgs
parents: 52
diff changeset
   316
     * resetCoverFlow() - reset all the data of cover flow
45
hgs
parents: 44
diff changeset
   317
     */    
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   318
    void resetCoverFlow();
58
hgs
parents: 52
diff changeset
   319
    
hgs
parents: 52
diff changeset
   320
    /**
hgs
parents: 52
diff changeset
   321
     * getSubState() - To get the substate of fullscreen state.
hgs
parents: 52
diff changeset
   322
     * @return - return the substate of fullscreen state.
hgs
parents: 52
diff changeset
   323
     */
26
c499df2dbb33 Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents: 23
diff changeset
   324
    int getSubState();
45
hgs
parents: 44
diff changeset
   325
    
58
hgs
parents: 52
diff changeset
   326
    /**
hgs
parents: 52
diff changeset
   327
     * timerEvent() - To handle the double tap timer
hgs
parents: 52
diff changeset
   328
     * @param - pointer of QTimerEvent.
hgs
parents: 52
diff changeset
   329
     */
hgs
parents: 52
diff changeset
   330
    void timerEvent( QTimerEvent *event );
hgs
parents: 52
diff changeset
   331
    
hgs
parents: 52
diff changeset
   332
    /**
hgs
parents: 52
diff changeset
   333
     * getUri() - To get the URI of the image.
hgs
parents: 52
diff changeset
   334
     * @param - image index.
hgs
parents: 52
diff changeset
   335
     * @return - return the uri of the image.
45
hgs
parents: 44
diff changeset
   336
     */
hgs
parents: 44
diff changeset
   337
    QString getUri( int index );
hgs
parents: 44
diff changeset
   338
    
58
hgs
parents: 52
diff changeset
   339
    /**
hgs
parents: 52
diff changeset
   340
     * isAnimatedImage() - To get the GIF file info of the image
hgs
parents: 52
diff changeset
   341
     * @param - image index.
hgs
parents: 52
diff changeset
   342
     * @return - true if it GIF image else false.
45
hgs
parents: 44
diff changeset
   343
     */
hgs
parents: 44
diff changeset
   344
    bool isAnimatedImage( int index );
hgs
parents: 44
diff changeset
   345
    
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   346
private:
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   347
	HbIconItem *mIconItem[NBR_ICON_ITEM];      //at most contain only five item
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   348
    qint16 mSelItemIndex;                    // current full screen index
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   349
    qint16 mRows;                        // total number of item  
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   350
    qint16 mSelIndex;                    // remove once model concept is integreted
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   351
    qint32 mStripLen;                    //virtual strip lenght
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   352
    qint32 mCurrentPos;                   //current postion in the virtual strip
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   353
    QSize mItemSize;                     //hb icon item size
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   354
    bool mUiOn;
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   355
    int mBounceBackDeltaX;
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   356
    QAbstractItemModel *mModel;
40
hgs
parents: 26
diff changeset
   357
    GlxUserMove mMoveDir;
hgs
parents: 26
diff changeset
   358
    int mSpeed;        
42
5e1df1b52eb3 201019_01
hgs
parents: 40
diff changeset
   359
	bool mZoomOn;
5e1df1b52eb3 201019_01
hgs
parents: 40
diff changeset
   360
	QGraphicsItem* mMultitouchFilter;
44
hgs
parents: 43
diff changeset
   361
    int mTimerId;
52
hgs
parents: 50
diff changeset
   362
    bool mIsInit;
58
hgs
parents: 52
diff changeset
   363
    bool mIsAutoMoving;
23
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   364
};
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   365
74c9f037fd5d Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   366
#endif /* GLXCOVERFLOW_H_ */