ui/uiengine/model/mediamodel/inc/glxmediamodel.h
changeset 69 45459746d5e8
parent 58 383b67fbdb11
child 71 27f2d7aec52a
equal deleted inserted replaced
65:ccee5c4b0de4 69:45459746d5e8
    40 #include <QVector>
    40 #include <QVector>
    41 
    41 
    42 class GLX_MEDIAMODEL_EXPORT GlxMediaModel : public QAbstractItemModel
    42 class GLX_MEDIAMODEL_EXPORT GlxMediaModel : public QAbstractItemModel
    43 {
    43 {
    44 Q_OBJECT
    44 Q_OBJECT
       
    45 friend class TestGlxMediaModel;
       
    46 
    45 public :	
    47 public :	
    46     /**
    48     /**
    47      * Constructor
    49      * Constructor
    48      * @param - model parm struct collectionID, depth, filter, context mode etc
    50      * @param - model parm struct collectionID, depth, filter, context mode etc
    49      */	
    51      */	
    70      * parent() - return the model index of the child.
    72      * parent() - return the model index of the child.
    71      * It always return invalid model index since no there is no parent
    73      * It always return invalid model index since no there is no parent
    72      */
    74      */
    73     QModelIndex parent( const QModelIndex &child ) const;
    75     QModelIndex parent( const QModelIndex &child ) const;
    74     
    76     
       
    77     QVariant itemImageData( const QModelIndex &index, int role ) const;
       
    78     QVariant collectionProperty( int role ) const;
       
    79     QVariant itemProperty( const QModelIndex &index, int role ) const;    
       
    80     
    75     /**
    81     /**
    76      * data() -  return the data of corresponding role.
    82      * data() -  return the data of corresponding role.
    77      * @param - model index of interested item.
    83      * @param - model index of interested item.
    78      * @param - role of corresponding data.
    84      * @param - role of corresponding data.
    79      */
    85      */
    92      * @param - row index of the item.
    98      * @param - row index of the item.
    93      * @param - column index of the item, it is always one.
    99      * @param - column index of the item, it is always one.
    94      */
   100      */
    95     QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
   101     QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
    96 
   102 
    97 	/**
   103 	
    98 	* addExternalItems() - for setting external image data to the model. 
       
    99 	*/
       
   100 	void addExternalItems( GlxExternalData* externalItems );
       
   101 	
       
   102 	/**
       
   103 	 * clearExternalItems() - for removing all external image data from the model. 
       
   104 	 */
       
   105 	void clearExternalItems();
       
   106 
       
   107 signals :
   104 signals :
   108     /**
   105     /**
   109      * albumTitleAvailable() - emit this signal when album title is available.
   106      * albumTitleAvailable() - emit this signal when album title is available.
   110      * @parma - album title
   107      * @parma - album title
   111      */
   108      */
   148      * GetFsIconItem() - To fetch the full screen size thumbnail
   145      * GetFsIconItem() - To fetch the full screen size thumbnail
   149      * @param - item index
   146      * @param - item index
   150      * @param - media list context type
   147      * @param - media list context type
   151      * @return - return the hbicon of the item
   148      * @return - return the hbicon of the item
   152      */	
   149      */	
   153 	HbIcon* GetFsIconItem( int itemIndex,GlxTBContextType tbContextType )const;
   150 	HbIcon* GetFsIconItem( int itemIndex, GlxTBContextType tbContextType )const;
   154 
   151 	
   155     /**
   152 	HbIcon gridToFullscreenIcon( HbIcon * icon, int itemIndex ) const;
   156      * GetExternalIconItem() - To fetch the grid size thumbnail of external item.
   153 	
   157      * @param - item index
   154 	HbIcon getFullScreenIcon( int itemIndex ) const;
   158      * @param - media list context type
   155 	
   159      * @return - return the hbicon of the item
   156 	QImage getFullScreenImage( int itemIndex ) const;
   160      */ 	
   157 
   161 	HbIcon* GetExternalIconItem( int itemIndex,GlxTBContextType tbContextType )const;
       
   162 	
       
   163     /**
   158     /**
   164      * setContextMode() - for setting the attribute context mode will be used mainly for 
   159      * setContextMode() - for setting the attribute context mode will be used mainly for 
   165      * retreiving thumbnail of different sizes.
   160      * retreiving thumbnail of different sizes.
   166      */
   161      */
   167     void setContextMode( GlxContextMode contextMode );
   162     void setContextMode( GlxContextMode contextMode );
   256      * @param - media list context type
   251      * @param - media list context type
   257      */
   252      */
   258     void updateItemIcon( int itemIndex, HbIcon* itemIcon, GlxTBContextType tbContextType );
   253     void updateItemIcon( int itemIndex, HbIcon* itemIcon, GlxTBContextType tbContextType );
   259     
   254     
   260 private:
   255 private:
   261 	GlxMLWrapper* mMLWrapper;	
   256 	GlxMLWrapper* mMLWrapper;
   262 	QCache<int, HbIcon> itemIconCache;
   257     QCache<int, HbIcon> itemIconCache;
   263 	QCache<int, HbIcon> itemFsIconCache;
   258     QCache<int, HbIcon> itemFsIconCache;
   264 	HbIcon* m_DefaultIcon;
   259     HbIcon* m_DefaultIcon;
   265 	HbIcon* m_CorruptIcon;
   260     HbIcon* m_CorruptIcon;
   266 	
   261     GlxContextMode mContextMode;
   267 	GlxContextMode mContextMode;
   262     int mFocusIndex;
   268 	//for external data to be populated by model
   263     int mSubState;
   269 	GlxExternalData* mExternalItems;
   264     GlxDRMUtilityWrapper* mDRMUtilityWrapper;
   270 	QCache<int, HbIcon> itemExternalIconCache;
   265     int mTempVisibleWindowIndex;
   271 	int externalDataCount;
   266     bool thumbnailPopulatedFlag;
   272 	int mFocusIndex;
   267     bool mPaintPage;
   273 	int mSubState;
       
   274 	GlxDRMUtilityWrapper* mDRMUtilityWrapper;
       
   275 	int mTempVisibleWindowIndex;
       
   276 	bool thumbnailPopulatedFlag;
       
   277 	bool mPaintPage;
       
   278 };
   268 };
   279 
   269 
   280 
   270 
   281 #endif /* GLXMEDIAMODEL_H_ */
   271 #endif /* GLXMEDIAMODEL_H_ */