• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

albumthumbnailloader.h

Go to the documentation of this file.
00001 /* ============================================================
00002  *
00003  * This file is a part of digiKam project
00004  * http://www.digikam.org
00005  *
00006  * Date        : 2006-04-14
00007  * Description : Load and cache tag thumbnails
00008  *
00009  * Copyright (C) 2006-2007 by Marcel Wiesweg <marcel.wiesweg@gmx.de>
00010  *
00011  * This program is free software; you can redistribute it
00012  * and/or modify it under the terms of the GNU General
00013  * Public License as published by the Free Software Foundation;
00014  * either version 2, or (at your option)
00015  * any later version.
00016  * 
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * ============================================================ */
00023 
00024 #ifndef TAGTHUMBNAILLOADER_H
00025 #define TAGTHUMBNAILLOADER_H
00026 
00027 // Qt includes.
00028 
00029 #include <QObject>
00030 #include <QPixmap>
00031 
00032 // KDE includes.
00033 
00034 #include <kurl.h>
00035 
00036 class QEvent;
00037 
00038 namespace Digikam
00039 {
00040 
00041 class Album;
00042 class TAlbum;
00043 class PAlbum;
00044 class LoadingDescription;
00045 class AlbumThumbnailLoaderPrivate;
00046 
00047 class AlbumThumbnailLoader : public QObject
00048 {
00049     Q_OBJECT
00050 
00051 public:
00052 
00053     static AlbumThumbnailLoader *instance();
00054 
00060     void setThumbnailSize(int size);
00064     int  thumbnailSize() const;
00065 
00075     enum RelativeSize
00076     {
00077         NormalSize,
00078         SmallerSize
00079     };
00080 
00089     bool getAlbumThumbnail(PAlbum *album);
00090 
00100     QPixmap getAlbumThumbnailDirectly(PAlbum *album);
00101 
00119     bool getTagThumbnail(TAlbum *album, QPixmap &icon);
00120 
00130     QPixmap getTagThumbnailDirectly(TAlbum *album, bool blendIcons = true);
00131 
00137     QPixmap getStandardTagIcon(RelativeSize size = NormalSize);
00138     QPixmap getStandardTagRootIcon(RelativeSize size = NormalSize);
00139     QPixmap getStandardTagIcon(TAlbum *album, RelativeSize size = NormalSize);
00140 
00141     QPixmap getStandardAlbumIcon(RelativeSize size = NormalSize);
00142     QPixmap getStandardAlbumRootIcon(RelativeSize size = NormalSize);
00143     QPixmap getStandardAlbumIcon(PAlbum *album, RelativeSize size = NormalSize);
00144 
00150     QPixmap blendIcons(QPixmap dstIcon, const QPixmap &tagIcon);
00151 
00152 
00153 signals:
00154 
00161     void signalThumbnail(Album *album, const QPixmap&);
00162 
00166     void signalFailed(Album *album);
00167 
00172     void signalReloadThumbnails();
00173 
00174 protected slots:
00175 
00176     void slotGotThumbnailFromIcon(const LoadingDescription &loadingDescription, const QPixmap &pixmap);
00177     void slotIconChanged(Album* album);
00178     void slotDispatchThumbnailInternal(int albumID, const QPixmap &thumbnail);
00179 
00180 signals:
00181 
00182     void signalDispatchThumbnailInternal(int albumID, const QPixmap &thumbnail);
00183 
00184 private:
00185 
00186     friend class AlbumThumbnailLoaderCreator;
00187     AlbumThumbnailLoader();
00188     ~AlbumThumbnailLoader();
00189     AlbumThumbnailLoaderPrivate *d;
00190 
00191     void    addUrl(Album *album, const KUrl &url);
00192     QPixmap loadIcon(const QString &name, int size = 0);
00193     QPixmap createTagThumbnail(const QPixmap &albumThumbnail);
00194     int     computeIconSize(RelativeSize size);
00195     QRect   computeBlendRect(int iconSize);
00196 };
00197 
00198 } // namespace Digikam
00199 
00200 #endif // TAGTHUMBNAILLOADER_H

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • digikam
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal