CImageHolder Class Reference

#include <ImageHolder.h>

Collaboration diagram for CImageHolder:

Collaboration graph
[legend]

List of all members.

Public Slots

void imageDownloaded (QByteArray imageData)
void imageDownloadProgress (int progress)

Public Member Functions

 CImageHolder (QWidget *parent=0)
virtual ~CImageHolder ()
void setPixmap (const QPixmap &imageItem)
QPixmap pixmap () const
void setOriginalPixmap ()
void setImagePath (const QString &path)

Private Attributes

QString m_ImagePath
CHttpImageDownloaderm_pImageLoader


Detailed Description

CImageHolder is designed for the purpose of holding image wheather they are local image or searched image from http://wwww.google.com.CImageHolder class differentiate between image type i.e. local image or web based image based on the image path set using setImagePath() function.

CImageHolder provide API to place image on the constructed QLabel widget like setPixmap().

CImageHolder also reponds to the event like zooom in and zoom out. On zoom in event it scales the set image to the size of the widget. and on the zoom out event it sets the previous scaled image on the widget so that image loading happens only once for the zoom in event. For zoom in and zoom out event in case of google searched images CImageHolder class uses CHttpImageDownloader class oject to download those images from the internet. Once those images are downloaded from the internet, They are scaled to fit into scaled widget size.

See also:
CHttpImageDownloader
Author:
vishwajeet <vishwajeet.dusane@gmail.com>

Constructor & Destructor Documentation

CImageHolder::CImageHolder ( QWidget *  parent = 0  ) 

CImageHolder::~CImageHolder (  )  [virtual]

References m_pImageLoader.


Member Function Documentation

void CImageHolder::setPixmap ( const QPixmap &  imageItem  ) 

This function set pixmap to the QLabel widget. This pixmap is supposed to be thumbnail size of the original image. While zoom out event occurs this function is called and the thumbnail view of the image is set.

Parameters:
imageItem 

References m_pImageLoader.

Referenced by CustomLabel::imageZoomedOut(), and CustomLabel::setPixmap().

QPixmap CImageHolder::pixmap (  )  const

Returns:
Currently set pixmap of the QLabel widget

void CImageHolder::setOriginalPixmap (  ) 

This function is set the original image to the QLabel. It is called when zoom in event occurs, this way image smooth transmission is done from thumbnail view to original pixmap view.

See also:
setImagePath

References m_ImagePath, m_pImageLoader, and CHttpImageDownloader::setDownloadImageUrl().

Referenced by CustomLabel::imageZoomedIn().

Here is the call graph for this function:

void CImageHolder::setImagePath ( const QString &  path  ) 

This function sets the absolute path of the image or URL of the particular image. Image path is required when zoom in event has occured and smooth image transmission is required from thumbnail view to original image.

Differentiation between local image path and URL is done at runtime when image needs to be changed.

Parameters:
path URL or absolute path to original image
See also:
setOriginalPixmap

References m_ImagePath.

Referenced by CustomLabel::setImagePath().

void CImageHolder::imageDownloaded ( QByteArray  imageData  )  [slot]

This slot is called from CHttpImageDownloader object when image data is downloaded from the web.However it is not guranteed that downloaded data is actual image or not. This is resolved at the time setting up downloaded image on the QLabel. If the downlaoaded image is not able to create QImage object out of it then appropriate text message is set.

Parameters:
imageData downloaded image data from web
See also:
imageDownloadProgress()

Referenced by CImageHolder().

void CImageHolder::imageDownloadProgress ( int  progress  )  [slot]

This slot is called for monitoring download progress of image.

Parameters:
progress download progress in percent
See also:
imageDownloaded()

Referenced by CImageHolder().


Member Data Documentation

QString CImageHolder::m_ImagePath [private]

Referenced by setImagePath(), and setOriginalPixmap().


The documentation for this class was generated from the following files:

Generated on Mon Apr 27 15:25:35 2009 for PictureWall by  doxygen 1.5.6