ui/views/slideshowview/inc/glxslideshowwidget.h
changeset 55 fb37077c270f
parent 36 6481344a6d67
child 61 743eb0b9959e
--- a/ui/views/slideshowview/inc/glxslideshowwidget.h	Tue Jul 06 14:16:16 2010 +0300
+++ b/ui/views/slideshowview/inc/glxslideshowwidget.h	Wed Aug 18 09:48:53 2010 +0300
@@ -34,6 +34,7 @@
 class QGraphicsItem;
 class HbDocumentLoader;
 class HbAbstractDataModel;
+class HbLabel;
 
 //User Forward Declarations
 class GlxEffectEngine;
@@ -48,83 +49,273 @@
     EFFECT_STARTED  // sends the signal when effect is started.
 } GlxSlideShowEvent;
 
-typedef enum 
-{
-    MOVE_FORWARD,
-    MOVE_BACKWARD,
-} GlxSlideShowMoveDir;
-
+/**
+ * Class Description
+ * This is Slideshow widget class used to play the slide show animation and ahndle the user action like pause and play.
+ */
 class GlxSlideShowWidget : public HbWidget
 {
 Q_OBJECT
 
 public :
-    GlxSlideShowWidget (QGraphicsItem *parent = NULL);
+    /**
+     * Constructor
+     * @param - QGraphicsItem
+     */    
+    GlxSlideShowWidget ( QGraphicsItem *parent = NULL );
+    
+    /**
+     * Destructor
+     */    
     ~GlxSlideShowWidget ();
-    void setModel (QAbstractItemModel *model);
-    void setItemGeometry(QRect screenRect);
+    
+    /**
+     * setmodel() - To set the model of the widget.
+     * @param - QAbstractItemModel.
+     */    
+    void setModel ( QAbstractItemModel *model );
+    
+    /**
+     * setItemGeometry() - To Set the layout data of widgets item.
+     * @param scrren gemoetry
+     */
+    void setItemGeometry( QRect screenRect );
+    
+    /**
+     * startSlideShow() - To start the slide show timer to run the slide show.
+     */
     void startSlideShow();
+    
+    /**
+     * stopSlideShow() - To stop slide show timer.
+     */
     void stopSlideShow();
-    /*
-     * Initialise the slideshow widget
-     * creation of the icons are done here
-     */
-    void setSlideShowWidget(HbDocumentLoader *DocLoader);
     
     /*
-     * Cleans up the slide show widget
+     * setSlideShowWidget() - Initialise the slideshow widget and creation of the icons are done here.
+     * @param - docloader
+     */
+    void setSlideShowWidget( HbDocumentLoader *DocLoader );
+    
+    /*
+     * cleanUp() -Cleans up the slide show widget
      */
     void cleanUp();
     
+    /*
+     * animationItem() - Return the icon to use for some transition effect
+     */
+    QGraphicsItem * animationItem();
+    
+    /**
+     * updateAnimationItem() - upadte the z value of anition item for smooth effect.
+     */    
+    void updateAnimationItem();
+    
+    
 signals:
-    void slideShowEvent(GlxSlideShowEvent e);
+    /**
+     * slideShowEvent() - This signal is emitted when slide show event happend lide ui on/off
+     * @param - GlxSlideShowEvent.
+     */
+    void slideShowEvent( GlxSlideShowEvent e );
+    
+    /**
+     * indexchanged() - This signal is emmitted when image selected index is changed. 
+     */
     void indexchanged();
     
 public slots :
+    /**
+     * triggeredEffect() - To start the slide show animation.
+     */
     void triggeredEffect();
+
+    /**
+     * continueSlideShow() - Play the slide show.
+     * @param - From HbAbstractButton.
+     */
+    void continueSlideShow( bool check );
+    
+    /**
+     * effectFinshed() -  Call back to get notification of slide show animation has been finshed.
+     */
     void effectFinshed();
-    void cancelEffect();
-    void pauseSlideShow();
-    void continueSlideShow(bool check);
-    void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
-    void rowsInserted(const QModelIndex &parent, int start, int end);
-    void rowsRemoved(const QModelIndex &parent, int start, int end);
+    
+    /**
+     * 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();
-    void orientationChanged(QRect screenRect);
+    
+    /**
+     * orientationChanged() - relayout the data when orientation has been changed
+     * @param - Screen Geometry
+     */
+    void orientationChanged( QRect screenRect );
 
+    /**
+     * leftMoveEffectFinished() - call back, when animation of browse the image in forward direction
+     * has been finished.
+     * @param - staus of effect
+     */
     void leftMoveEffectFinished( const HbEffect::EffectStatus &status );
+
+    /**
+     * leftMoveEffectFinished() - call back, when animation of browse the image in backward direction
+     * has been finished.
+     * @param - staus of effect
+     */
     void rightMoveEffectFinished( const HbEffect::EffectStatus &status );
     
 protected slots :
-    void leftGesture (int value);
-    void rightGesture (int value);
+    /**
+     * leftGesture() - To handle the left move event
+     * @parma number of pixel  move.
+     */
+    void leftGesture ( int value );
+    
+    /**
+     * rightGesture() - To handle the right move event
+     * @parma number of pixel  move.
+     */
+    void rightGesture ( int value );
     
 protected :
-    void gestureEvent(QGestureEvent *event);
+    /**
+     * gestureEvent() - gesture event handler.
+     * @param - QGestureEvent
+     */
+    void gestureEvent( QGestureEvent *event );
     
 private :
-    //clear all the model connection
+    /**
+     * clearCurrentModel() - clear all the model call backs
+     */
     void clearCurrentModel();
-    //add the connection to the model
+    
+    /**
+     * initializeNewModel() - register the model data change call backs
+     */
     void initializeNewModel();
+    
+    /**
+     * resetSlideShow() - Reinitialise the widget property.
+     */
     void resetSlideShow();
-    void setIconItems( int moveDir );
+    
+    /**
+     * moveImage() - Sopport function to handle the user browsing.
+     * @param -  next selected image index.
+     * @param - position of next image index.
+     * @param - effect event
+     * @param - animation finished callback function
+     */
     void moveImage( int nextIndex, int posX, const QString & move, char * callBack );
+    
+    /**
+     * addConnections() - register the internal and effect engine callback.
+     */
     void addConnections();
+	
+    /**
+     * removeConnections() - deregister the internal and effect engine callback.
+     */
     void removeConnections();
+    
+    /**
+     * cancelEffect() - To cancel the currnet effect running.
+     */
+    void cancelEffect();
+    
+    /**
+     * pauseSlideShow() - Pause the slide show.
+     */
+    void pauseSlideShow();
+    
+    /**
+     * getFocusIndex() -To get the focus index
+     */
+    int getFocusIndex( );
+
+    /*
+     * getIcon() - To get the full screen icon of the image
+     * @param - index of the icon
+     */
+    HbIcon getIcon( int index );
+    
+    /**
+     * isCorrupt() - To check the itemis corrupted or not
+     * @param - index of the icon
+     */
+    bool isCorrupt( int index );
+    
+    /**
+     * setFocusItemIcon() - To set the current ( focus ) item icon
+     * @return - return the success or failure status
+     */
+    bool setFocusItemIcon();
+    
+    /**
+     * setNextItemIcon() - To set the next itme icon in the list
+     * @return - return the success or failure status
+     */
+    bool setNextItemIcon();
+    
+    /**
+     * setPreItemIcon() - To set the previous icon in the list
+     * @return - return the success or failure status
+     */
+    bool setPreItemIcon();
+    
+    /**
+     * showErrorNote() - In the case of all the image are corrupted then show the error notes
+     */
+    void showErrorNote();
+    
+    /**
+     * hideErrorNote() - It will hide the corrupted images note
+     */
+    void hideErrorNote();    
 
 private:
     GlxEffectEngine          *mEffectEngine;
     GlxSettingInterface      *mSettings;               //no ownership
-    HbIconItem               *mIconItems[NBR_ITEM]; 
+    HbIconItem               *mIconItems[ NBR_ITEM ]; 
+    HbIconItem               *mAnimItem;
+    HbIconItem               *mBackGroundItem;
     HbPushButton             *mContinueButton;
+    HbLabel                  *mErrorNote ;               //when all the image are corrupted then show the no image label
     int                      mItemIndex;
-    int                      mSelIndex;
+    int                      mSelIndex[ NBR_ITEM ];
     QTimer                   *mSlideTimer;
     QAbstractItemModel       *mModel;
     QRect                    mScreenRect;
     QList <QGraphicsItem *>  mItemList;
     bool                     mIsPause;
+    int                      mSlideShowItemCount;
 };
 
 #endif /* GLXSLIDESHOWWIDGET_H */