--- a/ui/views/fullscreenview/inc/glxcoverflow.h Fri Aug 06 20:44:25 2010 +0530
+++ b/ui/views/fullscreenview/inc/glxcoverflow.h Mon Aug 23 18:06:16 2010 +0530
@@ -36,8 +36,7 @@
NO_MOVE,
TAP_MOVE,
LEFT_MOVE,
- RIGHT_MOVE,
- LONGPRESS_MOVE,
+ RIGHT_MOVE
} GlxUserMove;
typedef enum
@@ -48,98 +47,299 @@
ZOOM_START_EVENT
} GlxCoverFlowEvent;
+/**
+ * Class Description
+ * This is cover flow class to show and browse the image in fullscreen mode.
+ */
class GlxCoverFlow : public HbWidget
{
Q_OBJECT
public :
+ /**
+ * Constructor
+ * @param - QGraphicsItem parent of this widget
+ */
GlxCoverFlow (QGraphicsItem *parent = NULL);
+
+ /**
+ * Destructor
+ */
~GlxCoverFlow ();
- void setItemSize (QSize &size);
- void setModel (QAbstractItemModel *model);
- void indexChanged (int index);
- void setUiOn(bool uiOn) { mUiOn = uiOn; }
+
+ /**
+ * setItemSize() - To set the fullscreen image size.
+ * @param - size of fullscreen.
+ */
+ void setItemSize( QSize &size );
+
+ /**
+ * setModel() - To set the data provider of the widget.
+ * @param - data model pointor
+ */
+ void setModel( QAbstractItemModel *model );
+
+ /**
+ * indexChanged() - Call back to get the focus index change.
+ * @param - new focus index.
+ */
+ void indexChanged( int index );
+
+ /**
+ * setUiOn() - Call back to get the ui on/off status.
+ * @param - ui on/off status
+ */
+ void setUiOn( bool uiOn ) { mUiOn = uiOn; }
+
+ /**
+ * partiallyClean() - To clean all the item except focus one for improved the
+ * view transition animation.
+ */
void partiallyClean();
- void partiallyCreate(QAbstractItemModel *model, QSize itemSize, int posY = 0 );
- void setCoverFlow();
+
+ /*
+ * partiallyCreate() - To update the focus item only for improved the view transition
+ * animtaion.
+ * @param - data model pointer
+ * @param - size of fullscreen.
+ * @param - image pos in the screen.
+ */
+ void partiallyCreate( QAbstractItemModel *model, QSize itemSize, int posY = 0 );
+
+ /**
+ * setCoverFlow() - To initialise the coverflow.
+ */
+ void setCoverFlow();
+
+ /**
+ * ClearCoverFlow() - To cleanup the memory and connection.
+ */
void ClearCoverFlow();
- void setMultitouchFilter(QGraphicsItem* multitouchFilter);
+
+ /**
+ * setMultitouchFilter(() - To Set the widget who is interested in multi touch
+ * gesture event.
+ * @param - widget pointer
+ */
+ void setMultitouchFilter( QGraphicsItem* multitouchFilter );
- /*
- * To get the focus index
+ /**
+ * getFocusIndex() - To return the focus index
+ * @return - focus index.
*/
int getFocusIndex( );
- /*
- * To get the full screen icon of the image
+ /**
+ * getIcon() - to retuen the full screen icon of the image
+ * @param - index of imges which icon is required.
+ * @return - icon of the image.
*/
HbIcon getIcon( int index );
public slots:
- void zoomStarted(int index);
- void zoomFinished(int index);
+ /**
+ * zoomStarted() - Call back about user has start the zooming.
+ * @param - focus index.
+ */
+ void zoomStarted( int index );
+
+ /**
+ * zoomFinished() - Call back about user has finished the zoom and come back
+ * to coverflow.
+ * @param - focus index.
+ */
+ void zoomFinished( int index );
signals :
- void coverFlowEvent(GlxCoverFlowEvent e);
- void changeSelectedIndex(const QModelIndex &index);
+ /**
+ * coverFlowEvent() - To emit signal about coverflow event happen like panning, zomming ( For ui off ),
+ * Tap ( for ui on/off ) etc.
+ * @param - type of event
+ */
+ void coverFlowEvent( GlxCoverFlowEvent e );
+
+ /**
+ * changeSelectedIndex() - To emit the signal about focus inde change
+ * @param - new focus index
+ */
+ void changeSelectedIndex( const QModelIndex &index );
+
+ /**
+ * autoLeftMoveSignal() - Internal signal to move the next image with transition animation.
+ */
void autoLeftMoveSignal();
+
+ /**
+ * autoRightMoveSignal() - Internal signal to move the previous image with transition animation.
+ */
void autoRightMoveSignal();
- void doubleTapEventReceived(QPointF position);
+
+ /**
+ * doubleTapEventReceived() - To emit the signal about double tap happen.
+ * @param - coordinate of double tap postion with respect of view.
+ */
+ void doubleTapEventReceived( QPointF position );
+
+ /**
+ * moveNextSignal() - Internal signal to handle the buffering logic when user move
+ * to prevoius image.
+ */
+ void moveNextSignal();
+
+ /**
+ * movePreviousSignal() - Internal signal to handle the buffernig loigc when user move
+ * to previous image.
+ */
+ void movePreviousSignal();
protected slots:
- void panGesture ( const QPointF & delta ) ;
- void longPressGesture(const QPointF &point) ;
- void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
- void rowsInserted(const QModelIndex &parent, int start, int end);
- void rowsRemoved(const QModelIndex &parent, int start, int end);
+ /**
+ * panGesture() - To handle the pan gesture event.
+ * @param - user move delta postion.
+ */
+ void panGesture ( const QPointF & delta ) ;
+
+ /**
+ * dataChanged() - call back to monitor the widget data changed.
+ * @param - start index of data changed.
+ * @param - end index of data changed.
+ */
+ void dataChanged( QModelIndex startIndex, QModelIndex endIndex );
+
+ /**
+ * rowsInserted() - call back of new row inserted in the model.
+ * @param - Items are inserted under parent.
+ * @param - start index of items inserted.
+ * @param - end index of items removed.
+ */
+ void rowsInserted( const QModelIndex &parent, int start, int end );
+
+ /**
+ * rowsRemoved() - call back of new row removed in the model.
+ * @param - Items are removed from parent item.
+ * @param - start index of items inserted.
+ * @param - end index of items removed.
+ */
+ void rowsRemoved( const QModelIndex &parent, int start, int end );
+
+ /**
+ * modelDestroyed() - call back to monitor the model destroy.
+ */
void modelDestroyed();
+
+ /**
+ * autoLeftMove() - To play the next image move and bounce back transition animation.
+ */
void autoLeftMove();
+
+ /**
+ * autoRightMove() - To play the previous image move and bounce back transition animation.
+ */
void autoRightMove();
+
+ /**
+ * moveNextImage() - To Handle user next image move for buffering logic, emit the signal about
+ * new focus index and set some widget properties.
+ */
+ void moveNextImage();
+
+ /**
+ * movePreviousImage() - To Handle user pervious image move for buffering logic, emit the signal about
+ * new focus index and set some widget properties.
+ */
+ void movePreviousImage();
protected:
- void gestureEvent(QGestureEvent *event);
- void move(int value);
+ /**
+ * gestureEvent() - override function to handle the gesture event.
+ * @param - pointer of QGestureEvent
+ */
+ void gestureEvent( QGestureEvent *event );
+
+ /**
+ * move() - Change the postion of items for transition animation.
+ * @parma - delta move.
+ */
+ void move( int value );
+
+ /**
+ * setRows() - set the number of rows.
+ */
void setRows() ;
+
+ /**
+ * setStripLen() - set the virtual strip length of coverflow.
+ */
void setStripLen();
+
+ /**
+ * calculateIndex() - For cyclic cover flow map the index to actual item index.
+ * @param - index of the index.
+ */
int calculateIndex(int index);
+ /**
+ * loadIconItems() - Set the icon, size and postion of the icon items.
+ */
void loadIconItems ();
- void updateIconItem (qint16 selIndex, qint16 selIconIndex, qint16 deltaX);
- /*
- * In the case of animated image, it will play the animation for focus image
+ /**
+ * updateIconItem() - Set the icon, size and postion of the a particular item.
+ * It is used to support buffering logic and when user move to next or previous image.
+ * @param - image index.
+ * @param - item index in array.
+ * @param - position of the item.
+ */
+ void updateIconItem ( qint16 selIndex, qint16 selIconIndex, qint16 posX );
+
+ /**
+ * playAnimation() - In the case of animated image, it will play the animation for focus image
*/
void playAnimation();
- /*
- * To stop the animation
+ /**
+ * stopAnimation() - To stop the animation
*/
void stopAnimation();
/*
- * clear all the model connection
+ * clearCurrentModel() - clear all the model connection
*/
void clearCurrentModel();
/*
- * add the connection to the model
+ * initializeNewModel() - add the connection to the model
*/
void initializeNewModel();
/*
- * reset all the data of cover flow
+ * resetCoverFlow() - reset all the data of cover flow
*/
void resetCoverFlow();
+
+ /**
+ * getSubState() - To get the substate of fullscreen state.
+ * @return - return the substate of fullscreen state.
+ */
int getSubState();
- void timerEvent(QTimerEvent *event);
- /*
- * To get the URI of the image
+ /**
+ * timerEvent() - To handle the double tap timer
+ * @param - pointer of QTimerEvent.
+ */
+ void timerEvent( QTimerEvent *event );
+
+ /**
+ * getUri() - To get the URI of the image.
+ * @param - image index.
+ * @return - return the uri of the image.
*/
QString getUri( int index );
- /*
- * To get the GIF file info of the image
+ /**
+ * isAnimatedImage() - To get the GIF file info of the image
+ * @param - image index.
+ * @return - true if it GIF image else false.
*/
bool isAnimatedImage( int index );
@@ -147,7 +347,6 @@
HbIconItem *mIconItem[NBR_ICON_ITEM]; //at most contain only five item
qint16 mSelItemIndex; // current full screen index
qint16 mRows; // total number of item
- //QModelIndex mIndex; //current model index of seleced item
qint16 mSelIndex; // remove once model concept is integreted
qint32 mStripLen; //virtual strip lenght
qint32 mCurrentPos; //current postion in the virtual strip
@@ -161,6 +360,7 @@
QGraphicsItem* mMultitouchFilter;
int mTimerId;
bool mIsInit;
+ bool mIsAutoMoving;
};
#endif /* GLXCOVERFLOW_H_ */