imagehandlingutilities/thumbnailmanager/thumbnailmanagerqt/src/thumbnailmanager_qt.cpp
branchRCL_3
changeset 41 9d4d3445ce6e
parent 40 6257223ede8a
child 47 3d743e824514
equal deleted inserted replaced
40:6257223ede8a 41:9d4d3445ce6e
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #include <QSize>
       
    19 #include "thumbnailmanager_qt.h"
       
    20 #include "thumbnailmanager_p_qt.h"
       
    21  
       
    22 Q_DECL_EXPORT ThumbnailManager::ThumbnailManager( QObject* parentPtr ) :
       
    23 QObject( parentPtr ),
       
    24 d( new ThumbnailManagerPrivate() )
       
    25 {
       
    26     d->q_ptr = this; 
       
    27 }
       
    28 
       
    29 
       
    30 Q_DECL_EXPORT ThumbnailManager::~ThumbnailManager()
       
    31 {
       
    32     if( NULL != d ){
       
    33         delete d;
       
    34     }
       
    35 }
       
    36 
       
    37 Q_DECL_EXPORT ThumbnailManager::QualityPreference ThumbnailManager::qualityPreference() const
       
    38 {
       
    39     return d->qualityPreference();
       
    40 }
       
    41 
       
    42 Q_DECL_EXPORT bool ThumbnailManager::setQualityPreference( QualityPreference
       
    43     qualityPreference )
       
    44 {
       
    45     return d->setQualityPreference( qualityPreference );
       
    46 }
       
    47  
       
    48 Q_DECL_EXPORT QSize ThumbnailManager::thumbnailSize() const
       
    49 {
       
    50     return d->thumbnailSize();
       
    51 }
       
    52 
       
    53 Q_DECL_EXPORT bool ThumbnailManager::setThumbnailSize( const QSize& thumbnailSize )
       
    54 {
       
    55     return d->setThumbnailSize( thumbnailSize );
       
    56 }
       
    57 
       
    58 Q_DECL_EXPORT bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize )
       
    59 {
       
    60     return d->setThumbnailSize( thumbnailSize );
       
    61 }
       
    62 
       
    63 Q_DECL_EXPORT ThumbnailManager::ThumbnailMode ThumbnailManager::mode() const
       
    64 {
       
    65     return d->mode();
       
    66 }
       
    67 
       
    68 Q_DECL_EXPORT bool ThumbnailManager::setMode( ThumbnailMode mode )
       
    69 {
       
    70     return d->setMode( mode );
       
    71 }
       
    72 
       
    73 Q_DECL_EXPORT int ThumbnailManager::getThumbnail( const QString& fileName, void * clientData, 
       
    74         int priority )
       
    75 {
       
    76     return d->getThumbnail( fileName, clientData, priority );
       
    77 }
       
    78 
       
    79 Q_DECL_EXPORT int ThumbnailManager::getThumbnail( unsigned long int thumbnailId, void * clientData, 
       
    80         int priority )
       
    81 {
       
    82     return d->getThumbnail( thumbnailId, clientData, priority );
       
    83 }    
       
    84 
       
    85 Q_DECL_EXPORT int ThumbnailManager::setThumbnail( const QPixmap& source, const QString& filename,
       
    86         void * clientData , int priority )
       
    87 {
       
    88     return d->setThumbnail( source, filename, clientData, priority );
       
    89 }
       
    90 
       
    91 Q_DECL_EXPORT int ThumbnailManager::setThumbnail( const QImage& source, const QString& filename,
       
    92         void * clientData , int priority )
       
    93 {
       
    94     return d->setThumbnail( source, filename, clientData, priority );
       
    95 }
       
    96 
       
    97 Q_DECL_EXPORT int ThumbnailManager::setThumbnail( const QString& sourceFileName, const QString& targetFileName,
       
    98         const QString& mimeType, void * clientData , int priority )
       
    99 {
       
   100     return d->setThumbnail( sourceFileName, targetFileName, mimeType, clientData, priority );
       
   101 }
       
   102 
       
   103 Q_DECL_EXPORT void ThumbnailManager::deleteThumbnails( const QString& fileName )
       
   104 {
       
   105     d->deleteThumbnails( fileName );
       
   106 }
       
   107 
       
   108 Q_DECL_EXPORT void ThumbnailManager::deleteThumbnails( unsigned long int thumbnailId )
       
   109 {
       
   110     d->deleteThumbnails( thumbnailId );
       
   111 }
       
   112 
       
   113 Q_DECL_EXPORT bool ThumbnailManager::cancelRequest( int id )
       
   114 {
       
   115     return d->cancelRequest( id );
       
   116 }
       
   117 
       
   118 Q_DECL_EXPORT bool ThumbnailManager::changePriority( int id, int newPriority )
       
   119 {
       
   120     return d->changePriority( id, newPriority );
       
   121 }
       
   122 
       
   123 void ThumbnailManager::connectNotify(const char *signal)
       
   124 {
       
   125     if (QLatin1String(signal) == SIGNAL(thumbnailReady(QPixmap,void*,int,int))) {
       
   126         d->connectionCounterPixmap++;
       
   127     } else if (QLatin1String(signal) == SIGNAL(thumbnailReady(QImage,void*,int,int))) {
       
   128         d->connectionCounterImage++;
       
   129     }
       
   130 }
       
   131 
       
   132 void ThumbnailManager::disconnectNotify(const char *signal)
       
   133 {   
       
   134     if (QLatin1String(signal) == SIGNAL(thumbnailReady(QPixmap,void*,int,int))) {
       
   135         d->connectionCounterPixmap--;
       
   136     } else if (QLatin1String(signal) == SIGNAL(thumbnailReady(QImage,void*,int,int))) {
       
   137         d->connectionCounterImage--;
       
   138     }
       
   139 }
       
   140