digiKam
Digikam::AlbumThumbnailLoader Class Reference
+ Inheritance diagram for Digikam::AlbumThumbnailLoader:

Public Types

enum  RelativeSize { NormalSize , SmallerSize }
 

Signals

void signalDispatchThumbnailInternal (int albumID, const QPixmap &thumbnail)
 
void signalFailed (Album *album)
 
void signalReloadThumbnails ()
 
void signalThumbnail (Album *album, const QPixmap &)
 

Public Member Functions

void cleanUp ()
 
bool getAlbumThumbnail (PAlbum *const album)
 
QPixmap getAlbumThumbnailDirectly (PAlbum *const album)
 
QPixmap getFaceThumbnailDirectly (TAlbum *const album)
 
QPixmap getNewTagIcon (RelativeSize size=NormalSize)
 
QPixmap getStandardAlbumIcon (PAlbum *const album, RelativeSize size=NormalSize)
 
QPixmap getStandardAlbumIcon (RelativeSize size=NormalSize)
 
QPixmap getStandardAlbumRootIcon (RelativeSize size=NormalSize)
 
QPixmap getStandardAlbumTrashIcon (RelativeSize size=NormalSize)
 
QPixmap getStandardFaceIcon (TAlbum *const album, RelativeSize size=NormalSize)
 
QPixmap getStandardTagIcon (RelativeSize size=NormalSize)
 
QPixmap getStandardTagIcon (TAlbum *const album, RelativeSize size=NormalSize)
 
QPixmap getStandardTagRootIcon (RelativeSize size=NormalSize)
 
bool getTagThumbnail (TAlbum *const album, QPixmap &icon)
 
QPixmap getTagThumbnailDirectly (TAlbum *const album)
 
void setThumbnailSize (int size, int face)
 
int thumbnailSize () const
 

Static Public Member Functions

static AlbumThumbnailLoaderinstance ()
 

Protected Slots

void slotDispatchThumbnailInternal (int albumID, const QPixmap &thumbnail)
 
void slotGotThumbnailFromIcon (const LoadingDescription &loadingDescription, const QPixmap &pixmap)
 
void slotIconChanged (Album *album)
 

Friends

class AlbumThumbnailLoaderCreator
 

Member Enumeration Documentation

◆ RelativeSize

Album thumbnail size is configurable via the settings menu. Some widgets use smaller icons than other widgets. These widgets do not need to know the currently set icon size from the setup and calculate a smaller size, but can simply request a relatively smaller icon. Depending on the user-chosen icon size, this size may in fact not be smaller than the normal size.

Enumerator
NormalSize 
SmallerSize 

Member Function Documentation

◆ cleanUp()

void Digikam::AlbumThumbnailLoader::cleanUp ( )

◆ getAlbumThumbnail()

bool Digikam::AlbumThumbnailLoader::getAlbumThumbnail ( PAlbum *const  album)

Request thumbnail for given album. The thumbnail will be loaded and returned asynchronously by the signals. If no thumbnail is associated with given album, no action will be taken, and false is returned.

References Digikam::PAlbum::iconId().

◆ getAlbumThumbnailDirectly()

QPixmap Digikam::AlbumThumbnailLoader::getAlbumThumbnailDirectly ( PAlbum *const  album)

Request thumbnail for given album, with slightly different behavior than the above method: If the thumbnail is already available in the cache, it is returned. If the icon is not yet loaded, it will be returned asynchronously by the signals, and a default icon is returned here. If no icon is associated, the default icon is returned.

References getStandardAlbumIcon(), Digikam::Album::globalID(), and Digikam::PAlbum::iconId().

Referenced by Digikam::AlbumModel::decorationRoleData().

◆ getFaceThumbnailDirectly()

QPixmap Digikam::AlbumThumbnailLoader::getFaceThumbnailDirectly ( TAlbum *const  album)

Loads face tag thumbnail, like getTagThumbnailDirectly() but loads thumbnails in the size for faces

References getStandardFaceIcon(), Digikam::Album::globalID(), Digikam::TAlbum::icon(), and Digikam::TAlbum::iconId().

Referenced by Digikam::TagModel::decorationRoleData().

◆ getNewTagIcon()

QPixmap Digikam::AlbumThumbnailLoader::getNewTagIcon ( RelativeSize  size = NormalSize)

◆ getStandardAlbumIcon() [1/2]

◆ getStandardAlbumIcon() [2/2]

QPixmap Digikam::AlbumThumbnailLoader::getStandardAlbumIcon ( RelativeSize  size = NormalSize)

◆ getStandardAlbumRootIcon()

QPixmap Digikam::AlbumThumbnailLoader::getStandardAlbumRootIcon ( RelativeSize  size = NormalSize)

Referenced by getStandardAlbumIcon().

◆ getStandardAlbumTrashIcon()

QPixmap Digikam::AlbumThumbnailLoader::getStandardAlbumTrashIcon ( RelativeSize  size = NormalSize)

Referenced by getStandardAlbumIcon().

◆ getStandardFaceIcon()

QPixmap Digikam::AlbumThumbnailLoader::getStandardFaceIcon ( TAlbum *const  album,
RelativeSize  size = NormalSize 
)

◆ getStandardTagIcon() [1/2]

QPixmap Digikam::AlbumThumbnailLoader::getStandardTagIcon ( RelativeSize  size = NormalSize)

Return standard tag and album icons. The third methods check if album is the root, and returns the standard icon or the root standard icon.

Referenced by getStandardTagIcon(), and getTagThumbnailDirectly().

◆ getStandardTagIcon() [2/2]

QPixmap Digikam::AlbumThumbnailLoader::getStandardTagIcon ( TAlbum *const  album,
RelativeSize  size = NormalSize 
)

◆ getStandardTagRootIcon()

QPixmap Digikam::AlbumThumbnailLoader::getStandardTagRootIcon ( RelativeSize  size = NormalSize)

Referenced by getStandardTagIcon().

◆ getTagThumbnail()

bool Digikam::AlbumThumbnailLoader::getTagThumbnail ( TAlbum *const  album,
QPixmap &  icon 
)

Behaves similar to the above method. Tag thumbnails will be processed as appropriate. Tags may have associated an icon that is loaded synchronously by the system icon loader. In this case, icon is set to this icon, and false is returned. If no icon is associated with the tag, icon is set to null, and false is returned. If a custom icon is associated with the tag, it is loaded asynchronously, icon is set to null, and true is returned. Tag thumbnails are always smaller than album thumbnails - as small as an album thumbnail with SmallerSize. They are supposed to be blended into the standard tag icon obtained below, or used as is when SmallerSize is requested anyway.

Returns
Returns true if icon is loaded asynchronously.

References Digikam::TAlbum::icon(), and Digikam::TAlbum::iconId().

◆ getTagThumbnailDirectly()

QPixmap Digikam::AlbumThumbnailLoader::getTagThumbnailDirectly ( TAlbum *const  album)

Loads tag thumbnail, with slightly different behavior than the above method: If the thumbnail is already available in the cache, it is returned, already blended with the standard icon, if requested. If the icon is not yet loaded, it will be returned asynchronously by the signals (unblended), and a default icon is returned here. If no icon is associated, the default icon is returned.

References getStandardTagIcon(), Digikam::Album::globalID(), Digikam::TAlbum::icon(), and Digikam::TAlbum::iconId().

Referenced by Digikam::TagModel::decorationRoleData().

◆ instance()

◆ setThumbnailSize()

void Digikam::AlbumThumbnailLoader::setThumbnailSize ( int  size,
int  face 
)

Change the size of the thumbnails. If the size differs from the current size, signalReloadThumbnails will be emitted.

References signalReloadThumbnails().

◆ signalDispatchThumbnailInternal

void Digikam::AlbumThumbnailLoader::signalDispatchThumbnailInternal ( int  albumID,
const QPixmap &  thumbnail 
)
signal

Internal signal to dispatch Album thumbnail change.

◆ signalFailed

void Digikam::AlbumThumbnailLoader::signalFailed ( Album album)
signal

This signal is emitted if thumbnail generation for given album failed. Same considerations as above.

Referenced by slotDispatchThumbnailInternal(), and slotGotThumbnailFromIcon().

◆ signalReloadThumbnails

void Digikam::AlbumThumbnailLoader::signalReloadThumbnails ( )
signal

Indicates that all album and tag thumbnails need to be reloaded. This is usually because the icon size has changed in the setup.

Referenced by setThumbnailSize().

◆ signalThumbnail

void Digikam::AlbumThumbnailLoader::signalThumbnail ( Album album,
const QPixmap &   
)
signal

This signal is emitted as soon as a thumbnail has become available for given album. This class is a singleton, so any object connected to this signal might not actually have requested a thumbnail for given url

Referenced by slotDispatchThumbnailInternal(), and slotGotThumbnailFromIcon().

◆ slotDispatchThumbnailInternal

void Digikam::AlbumThumbnailLoader::slotDispatchThumbnailInternal ( int  albumID,
const QPixmap &  thumbnail 
)
protectedslot

◆ slotGotThumbnailFromIcon

◆ slotIconChanged

void Digikam::AlbumThumbnailLoader::slotIconChanged ( Album album)
protectedslot

◆ thumbnailSize()

int Digikam::AlbumThumbnailLoader::thumbnailSize ( ) const

Get the current default icon size

Friends And Related Function Documentation

◆ AlbumThumbnailLoaderCreator

friend class AlbumThumbnailLoaderCreator
friend

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