--- a/ui/uiengine/model/mediamodel/inc/glxmediamodel.h Tue Jul 06 14:16:16 2010 +0300
+++ b/ui/uiengine/model/mediamodel/inc/glxmediamodel.h Wed Aug 18 09:48:53 2010 +0300
@@ -43,76 +43,227 @@
{
Q_OBJECT
public :
-
- GlxMediaModel(GlxModelParm & modelParm);
- ~GlxMediaModel();
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
- QModelIndex parent(const QModelIndex &child) const;
- QVariant data(const QModelIndex &index, int role) const;
- bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
+ /**
+ * Constructor
+ * @param - model parm struct collectionID, depth, filter, context mode etc
+ */
+ GlxMediaModel( GlxModelParm & modelParm );
- /*
- *for setting external image data to the model.
+ /**
+ * Destructor
+ */
+ ~GlxMediaModel();
+
+ /**
+ * rowCount() - return the number of rows in the model.
+ * @param - parent model index, not used
+ */
+ int rowCount( const QModelIndex &parent = QModelIndex() ) const;
+
+ /**
+ * columnCount() - return 1
+ * @param - parent model index, not used
+ */
+ int columnCount( const QModelIndex &parent = QModelIndex() ) const;
+
+ /**
+ * parent() - return the model index of the child.
+ * It always return invalid model index since no there is no parent
+ */
+ QModelIndex parent( const QModelIndex &child ) const;
+
+ /**
+ * data() - return the data of corresponding role.
+ * @param - model index of interested item.
+ * @param - role of corresponding data.
+ */
+ QVariant data( const QModelIndex &index, int role ) const;
+
+ /**
+ * setData() - to set the data for corresponding item and role.
+ * @param - model index of interested item.
+ * @param - data of the item
+ * @param - role of corresponding data.
+ */
+ bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
+
+ /**
+ * index - create a new model index for an item.
+ * @param - row index of the item.
+ * @param - column index of the item, it is always one.
+ */
+ QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
+
+ /**
+ * addExternalItems() - for setting external image data to the model.
*/
- void addExternalItems(GlxExternalData* externalItems);
- /*
- *for removing all external image data from the model.
- */
+ void addExternalItems( GlxExternalData* externalItems );
+
+ /**
+ * clearExternalItems() - for removing all external image data from the model.
+ */
void clearExternalItems();
- /*
- * for checking if the item is editab
- */
signals :
- void albumTitleAvailable(QString aTitle);
+ /**
+ * albumTitleAvailable() - emit this signal when album title is available.
+ * @parma - album title
+ */
+ void albumTitleAvailable( QString aTitle );
+
+ /**
+ * populated() - emit this signal once medialist is populated
+ */
void populated();
+
+ /**
+ * thumbnailPopulated() - emit the signal once some initial page of thumbnail are loaded
+ * into cache.
+ */
+ void thumbnailPopulated();
+
+ /**
+ * iconAvailable() - emit the signal to update the icon in the cache.
+ * @param - item index
+ * @param - HbIcon
+ * @param - media list context type
+ */
+ void iconAvailable( int itemIndex, HbIcon* itemIcon, GlxTBContextType tbContextType ) const;
+
+ /**
+ * updateDetailsView() - emit the signal to update the details view
+ */
+ void updateDetailsView();
private:
- HbIcon* GetGridIconItem(int itemIndex, GlxTBContextType tbContextType) const;
- HbIcon* GetFsIconItem(int itemIndex,GlxTBContextType tbContextType)const;
- HbIcon* GetExternalIconItem(int itemIndex,GlxTBContextType tbContextType)const;
-/**
- * for setting the attribute context mode will be used mainly for retreiving thumbnail of different sizes.
- */
- void setContextMode(GlxContextMode contextMode);
- /*
- *Removes the context
+ /**
+ * GetGridIconItem() - To fetch the grid size thumbnail
+ * @param - item index
+ * @param - media list context type
+ * @return - return the hbicon of the item
+ */
+ HbIcon* GetGridIconItem( int itemIndex, GlxTBContextType tbContextType ) const;
+
+ /**
+ * GetFsIconItem() - To fetch the full screen size thumbnail
+ * @param - item index
+ * @param - media list context type
+ * @return - return the hbicon of the item
+ */
+ HbIcon* GetFsIconItem( int itemIndex,GlxTBContextType tbContextType )const;
+
+ /**
+ * GetExternalIconItem() - To fetch the grid size thumbnail of external item.
+ * @param - item index
+ * @param - media list context type
+ * @return - return the hbicon of the item
+ */
+ HbIcon* GetExternalIconItem( int itemIndex,GlxTBContextType tbContextType )const;
+
+ /**
+ * setContextMode() - for setting the attribute context mode will be used mainly for
+ * retreiving thumbnail of different sizes.
+ */
+ void setContextMode( GlxContextMode contextMode );
+
+ /**
+ *removeContextMode() - Removes the context
*/
- void removeContextMode(GlxContextMode contextMode);
- void setFocusIndex(const QModelIndex &index);
+ void removeContextMode( GlxContextMode contextMode );
+
+ /**
+ * setFocusIndex() - To set the focus index in medialist
+ * @param - selected item index( focus index )
+ */
+ void setFocusIndex( const QModelIndex &index );
+
+ /**
+ * getFocusIndex() - Retrun the focus index from the medialist.
+ * @return - focus index.
+ */
QModelIndex getFocusIndex() const;
- void setSelectedIndex(const QModelIndex &index);
-
+
+ /**
+ * setSelectedIndex() - To make the item as seleted in media list to perform some coomand.
+ * @param - selected item index
+ */
+ void setSelectedIndex( const QModelIndex &index );
-
-signals :
- void iconAvailable(int itemIndex, HbIcon* itemIcon, GlxTBContextType tbContextType) const;
- /*
- *signal to update the details view
- */
- void updateDetailsView();
+ /**
+ * getCorruptDefaultIcon() - IT will return the corrupt icon if item is corrupted else return the
+ * default item.
+ * @param - item index
+ */
+ HbIcon *getCorruptDefaultIcon ( const QModelIndex &index ) const;
+
+ /**
+ * thumbnailPopulatedCheck() - To check the some initial page of item is loaded into cache or not
+ * @param - loaded thumbnail image index in cache.
+ */
+ void thumbnailPopulatedCheck( int index );
+
public slots:
- void itemUpdated1(int mlIndex, GlxTBContextType tbContextType);
- void itemsAdded(int startIndex, int endIndex);
- void itemsRemoved(int startIndex, int endIndex);
- void itemCorrupted(int itemIndex);
- void albumTitleUpdated(QString aTitle);
+ /**
+ * itemUpdated() - call back fuction, when thumbnail is added into cache.
+ * It remove the icon from the local cache and emit the signal of data change.
+ * @param - item index
+ * @param - media list context type
+ */
+ void itemUpdated( int mlIndex, GlxTBContextType tbContextType );
+
+ /**
+ * itemsAdded() - call back function when new items are added into collection.
+ * @param - start index of the newly added item
+ * @param - end endex of the newlyadd item
+ */
+ void itemsAdded( int startIndex, int endIndex );
+
+ /**
+ * itemsRemoved() - call back function when some item are removed from the collection.
+ * @param - start index of the remove items
+ * @param - end endex of the remove items
+ */
+ void itemsRemoved( int startIndex, int endIndex );
+
+ /**
+ * itemCorrupted() - call back function, when a item is corrupted.
+ * @param - index of the corrupt item
+ */
+ void itemCorrupted( int itemIndex );
+
+ /**
+ * albumTitleUpdated() - call back function, when a album collection title is available.
+ * @param - title of the album.
+ */
+ void albumTitleUpdated( QString aTitle );
+
+ /**
+ * modelpopulated() - callback function, when meida list item is populated.
+ * It set the visual window index and emit the signal to view about it.
+ */
void modelpopulated();
- /*
- *Emits signal to update the details view
+
+ /**
+ * updateDetailItems() - Emits signal to update the details view
*/
void updateDetailItems();
-protected:
private slots:
- void updateItemIcon(int itemIndex, HbIcon* itemIcon, GlxTBContextType tbContextType);
+ /**
+ * updateItemIcon() - update the icon into local cache.
+ * @param - item index
+ * @param - HbIcon
+ * @param - media list context type
+ */
+ void updateItemIcon( int itemIndex, HbIcon* itemIcon, GlxTBContextType tbContextType );
+
private:
GlxMLWrapper* mMLWrapper;
QCache<int, HbIcon> itemIconCache;
QCache<int, HbIcon> itemFsIconCache;
HbIcon* m_DefaultIcon;
+ HbIcon* m_CorruptIcon;
+
GlxContextMode mContextMode;
//for external data to be populated by model
GlxExternalData* mExternalItems;
@@ -122,6 +273,7 @@
int mSubState;
GlxDRMUtilityWrapper* mDRMUtilityWrapper;
int mTempVisibleWindowIndex;
+ bool thumbnailPopulatedFlag;
};