• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

/home/bifh7/cs2009q3-i386/work/libthumbnailer-0.1.18+0m6/src/include/thumbnailer.h

00001 /*
00002  * Copyright (C) 2009 Nokia Corporation.
00003  *
00004  * Contact: Marius Vollmer <marius.vollmer@nokia.com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public License
00008  * version 2.1 as published by the Free Software Foundation.
00009  *
00010  * This library is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00018  * 02110-1301 USA
00019  *
00020  */
00021 
00022 /*
00023  * thumbnailer.h
00024  *
00025  *  Created on: Oct 26, 2009
00026  * Modified on: Nov 10, 2009
00027  *     Authors: iridian, wiecheck
00028  */
00029 #ifndef __THUMBNAILER_H__
00030 #define __THUMBNAILER_H__
00031 
00032 #include <QtCore/QObject>
00033 #include <QtCore/QString>
00034 #include <QtCore/QUrl>
00035 #include <QtCore/QMultiHash>
00036 #include <QtGui/QPixmap>
00037 #include <QSize>
00038 #include "mediaartinfo.h"
00039 
00040 namespace Thumbnails {
00041 
00042 /*
00043  Private data for each, separate Thumbnailer instance.
00044  */
00045 struct ThumbnailerPrivate;
00046 
00136 class Thumbnailer : public QObject {
00137 Q_OBJECT
00138 /* **************************************************************************
00139  *      STATIC FUNCTIONS:
00140  * **************************************************************************/
00141 public:
00149 
00156         static void move    ( const QList<QUrl>& from, const QList<QUrl>& to );
00157 
00164         static void copy    ( const QList<QUrl>& from, const QList<QUrl>& to );
00165 
00169         static void remove  ( const QList<QUrl>& fileUris );
00170 
00177         static void cleanup ( const QString& prefix, unsigned before );
00179 
00190 
00202         static QMultiHash<QString, QString> getSupported  ();
00203 
00212         static QStringList                  getSchedulers ();
00213 
00222         static const QString                noopScheduler;
00223 
00230         static const QString                defaultFlavor;
00231 
00247         static QStringList                  getFlavors ();
00248 
00255         static QSize                        getFlavorSize (const QString& flavor);
00257 
00269         static QUrl getThumbnailPath ( const QUrl& uri, const QString& flavor );
00270 /* **************************************************************************
00271  *      CONSTRUCTOR & DESTRUCTOR:
00272  * **************************************************************************/
00273 public:
00293         ~Thumbnailer ();
00294 
00303          Thumbnailer ( QUrl    defaultUri    = QUrl(),
00304                        QPixmap defaultPixmap = QPixmap() );
00305 
00306 /* **************************************************************************
00307  *      CURRENT SETTINGS OF THE OBJECT:
00308  * **************************************************************************/
00309 public:
00321         void    setDefaultURI    ( QUrl uri );
00322 
00328         void    setDefaultPixmap ( QPixmap pixmap );
00329 
00335         QUrl    defaultURI    () const;
00336 
00342         QPixmap defaultPixmap () const;
00344 
00345 /* **************************************************************************
00346  *      MAKING & CANCELING THE REQUEST:
00347  * **************************************************************************/
00348 public:
00362         void cancel  ( bool sendRemainingSignals = true, bool unqueueFromTumbler = true );
00363         
00402         bool request ( QList<QUrl> &uris,
00403                        QStringList &mimeTypes,
00404                        bool sendPixmap = false,
00405                        QString flavor = QString(),
00406                        QString scheduler = QString(),
00407                        bool autoCancel = false,
00408                        bool sendRemainingSignals = true );
00409 
00440         bool request ( QList<MediaArt::Info> &media,
00441                        bool sendPixmap = false,
00442                        QString flavor = QString(),
00443                        QString scheduler = QString(),
00444                        bool autoCancel = false,
00445                        bool sendRemainingSignals = true );
00446 
00447 /* **************************************************************************
00448  *      SIGNALS:
00449  * **************************************************************************/
00450 Q_SIGNALS:
00455         void started  ();
00456 
00471         void finished (int left);
00472 
00486         void thumbnail        ( const QUrl& uri,
00487                                 const QUrl& thumbnailUri,
00488                                 const QPixmap& pixmap,
00489                                 const QString& flavor );
00490 
00503         void thumbnail        ( const MediaArt::Info& media,
00504                                 const QUrl& thumbnailUri,
00505                                 const QPixmap& pixmap,
00506                                 const QString& flavor );
00507 
00524         void defaultThumbnail ( const QUrl& uri,
00525                                 const QUrl& thumbnailUri,
00526                                 const QPixmap& pixmap,
00527                                 const QString& flavor );
00528 
00543         void defaultThumbnail ( const MediaArt::Info& media,
00544                                 const QUrl& thumbnailUri,
00545                                 const QPixmap& pixmap,
00546                                 const QString& flavor );
00547 
00553         void dequeued ( const QUrl& uri );
00554 
00560         void dequeued ( const MediaArt::Info& media );
00561 
00574         void error    ( const QString& error,
00575                         const QUrl& uri,
00576                         const QUrl& defaultUri = QUrl(),
00577                         const QPixmap& defaultPixmap = QPixmap() );
00578 
00589         void error    ( const QString& error,
00590                         const MediaArt::Info& media,
00591                         const QUrl& defaultUri = QUrl(),
00592                         const QPixmap& defaultPixmap = QPixmap() );
00593 
00594 /* PRIVATE AREA */
00595 private:
00596         friend class Thumbnails::ThumbnailerPrivate;
00597         Thumbnails::ThumbnailerPrivate *priv;
00598 #ifdef TESTING_CODE
00599 // code only for unit testing
00600 public:
00601         Thumbnails::ThumbnailerPrivate* getPrivateData() { return priv; }
00602 #endif
00603 };
00604 
00605 } // end of the Thumbnails namespace
00606 
00607 
00608 #endif

Generated on Tue Jun 28 2011 11:52:35 for thumbnailer by  doxygen 1.7.1