13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include <qsize.h> |
18 #include <QSize> |
19 #include "thumbnailmanager_qt.h" |
19 #include "thumbnailmanager_qt.h" |
20 #include "thumbnailmanager_p_qt.h" |
20 #include "thumbnailmanager_p_qt.h" |
21 |
21 |
22 EXPORT_C ThumbnailManager::ThumbnailManager( QObject* parentPtr ) : |
22 Q_DECL_EXPORT ThumbnailManager::ThumbnailManager( QObject* parentPtr ) : |
23 QObject( parentPtr ), |
23 QObject( parentPtr ), |
24 d( new ThumbnailManagerPrivate() ) |
24 d( new ThumbnailManagerPrivate() ) |
25 { |
25 { |
26 QObject::connect( d, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ), |
26 QObject::connect( d, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ), |
27 this, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ) ); |
27 this, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ) ); |
|
28 QObject::connect( d, SIGNAL( thumbnailReady( QImage , void * , int , int ) ), |
|
29 this, SIGNAL( thumbnailReady( QImage , void * , int , int ) ) ); |
28 } |
30 } |
29 |
31 |
30 |
32 |
31 EXPORT_C ThumbnailManager::~ThumbnailManager() |
33 Q_DECL_EXPORT ThumbnailManager::~ThumbnailManager() |
32 { |
34 { |
33 QObject::disconnect( d, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ), |
35 QObject::disconnect( d, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ), |
34 this, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ) ); |
36 this, SIGNAL( thumbnailReady( QPixmap , void * , int , int ) ) ); |
|
37 QObject::disconnect( d, SIGNAL( thumbnailReady( QImage , void * , int , int ) ), |
|
38 this, SIGNAL( thumbnailReady( QImage , void * , int , int ) ) ); |
35 if( NULL != d ){ |
39 if( NULL != d ){ |
36 delete d; |
40 delete d; |
37 } |
41 } |
38 } |
42 } |
39 |
43 |
40 EXPORT_C ThumbnailManager::QualityPreference ThumbnailManager::qualityPreference() const |
44 Q_DECL_EXPORT ThumbnailManager::QualityPreference ThumbnailManager::qualityPreference() const |
41 { |
45 { |
42 return d->qualityPreference(); |
46 return d->qualityPreference(); |
43 } |
47 } |
44 |
48 |
45 EXPORT_C bool ThumbnailManager::setQualityPreference( QualityPreference |
49 Q_DECL_EXPORT bool ThumbnailManager::setQualityPreference( QualityPreference |
46 qualityPreference ) |
50 qualityPreference ) |
47 { |
51 { |
48 return d->setQualityPreference( qualityPreference ); |
52 return d->setQualityPreference( qualityPreference ); |
49 } |
53 } |
50 |
54 |
51 EXPORT_C QSize ThumbnailManager::thumbnailSize() const |
55 Q_DECL_EXPORT QSize ThumbnailManager::thumbnailSize() const |
52 { |
56 { |
53 return d->thumbnailSize(); |
57 return d->thumbnailSize(); |
54 } |
58 } |
55 |
59 |
56 EXPORT_C bool ThumbnailManager::setThumbnailSize( const QSize& thumbnailSize ) |
60 Q_DECL_EXPORT bool ThumbnailManager::setThumbnailSize( const QSize& thumbnailSize ) |
57 { |
61 { |
58 return d->setThumbnailSize( thumbnailSize ); |
62 return d->setThumbnailSize( thumbnailSize ); |
59 } |
63 } |
60 |
64 |
61 EXPORT_C bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize ) |
65 Q_DECL_EXPORT bool ThumbnailManager::setThumbnailSize( ThumbnailSize thumbnailSize ) |
62 { |
66 { |
63 return d->setThumbnailSize( thumbnailSize ); |
67 return d->setThumbnailSize( thumbnailSize ); |
64 } |
68 } |
65 |
69 |
66 EXPORT_C ThumbnailManager::ThumbnailMode ThumbnailManager::mode() const |
70 Q_DECL_EXPORT ThumbnailManager::ThumbnailMode ThumbnailManager::mode() const |
67 { |
71 { |
68 return d->mode(); |
72 return d->mode(); |
69 } |
73 } |
70 |
74 |
71 EXPORT_C bool ThumbnailManager::setMode( ThumbnailMode mode ) |
75 Q_DECL_EXPORT bool ThumbnailManager::setMode( ThumbnailMode mode ) |
72 { |
76 { |
73 return d->setMode( mode ); |
77 return d->setMode( mode ); |
74 } |
78 } |
75 |
79 |
76 EXPORT_C int ThumbnailManager::getThumbnail( const QString& fileName, void * clientData, |
80 Q_DECL_EXPORT int ThumbnailManager::getThumbnail( const QString& fileName, void * clientData, |
77 int priority ) |
81 int priority ) |
78 { |
82 { |
79 return d->getThumbnail( fileName, clientData, priority ); |
83 return d->getThumbnail( fileName, clientData, priority ); |
80 } |
84 } |
81 |
85 |
82 EXPORT_C int ThumbnailManager::getThumbnail( unsigned long int thumbnailId, void * clientData, |
86 Q_DECL_EXPORT int ThumbnailManager::getThumbnail( unsigned long int thumbnailId, void * clientData, |
83 int priority ) |
87 int priority ) |
84 { |
88 { |
85 return d->getThumbnail( thumbnailId, clientData, priority ); |
89 return d->getThumbnail( thumbnailId, clientData, priority ); |
86 } |
90 } |
87 |
91 |
88 EXPORT_C int ThumbnailManager::setThumbnail( const QPixmap& source, const QString& filename, |
92 Q_DECL_EXPORT int ThumbnailManager::setThumbnail( const QPixmap& source, const QString& filename, |
89 void * clientData , int priority ) |
93 void * clientData , int priority ) |
90 { |
94 { |
91 return d->setThumbnail( source, filename, clientData, priority ); |
95 return d->setThumbnail( source, filename, clientData, priority ); |
92 } |
96 } |
93 |
97 |
94 EXPORT_C int ThumbnailManager::setThumbnail( const QImage& source, const QString& filename, |
98 Q_DECL_EXPORT int ThumbnailManager::setThumbnail( const QImage& source, const QString& filename, |
95 void * clientData , int priority ) |
99 void * clientData , int priority ) |
96 { |
100 { |
97 return d->setThumbnail( source, filename, clientData, priority ); |
101 return d->setThumbnail( source, filename, clientData, priority ); |
98 } |
102 } |
99 |
103 |
100 EXPORT_C void ThumbnailManager::deleteThumbnails( const QString& fileName ) |
104 Q_DECL_EXPORT void ThumbnailManager::deleteThumbnails( const QString& fileName ) |
101 { |
105 { |
102 d->deleteThumbnails( fileName ); |
106 d->deleteThumbnails( fileName ); |
103 } |
107 } |
104 |
108 |
105 EXPORT_C void ThumbnailManager::deleteThumbnails( unsigned long int thumbnailId ) |
109 Q_DECL_EXPORT void ThumbnailManager::deleteThumbnails( unsigned long int thumbnailId ) |
106 { |
110 { |
107 d->deleteThumbnails( thumbnailId ); |
111 d->deleteThumbnails( thumbnailId ); |
108 } |
112 } |
109 |
113 |
110 EXPORT_C bool ThumbnailManager::cancelRequest( int id ) |
114 Q_DECL_EXPORT bool ThumbnailManager::cancelRequest( int id ) |
111 { |
115 { |
112 return d->cancelRequest( id ); |
116 return d->cancelRequest( id ); |
113 } |
117 } |
114 |
118 |
115 EXPORT_C bool ThumbnailManager::changePriority( int id, int newPriority ) |
119 Q_DECL_EXPORT bool ThumbnailManager::changePriority( int id, int newPriority ) |
116 { |
120 { |
117 return d->changePriority( id, newPriority ); |
121 return d->changePriority( id, newPriority ); |
118 } |
122 } |
119 |
123 |
|
124 void ThumbnailManager::connectNotify(const char *signal) |
|
125 { |
|
126 if (QLatin1String(signal) == SIGNAL(thumbnailReady(QPixmap,void*,int,int))) { |
|
127 d->connectionCounterPixmap++; |
|
128 } else if (QLatin1String(signal) == SIGNAL(thumbnailReady(QImage,void*,int,int))) { |
|
129 d->connectionCounterImage++; |
|
130 } |
|
131 } |
|
132 |
|
133 void ThumbnailManager::disconnectNotify(const char *signal) |
|
134 { |
|
135 if (QLatin1String(signal) == SIGNAL(thumbnailReady(QPixmap,void*,int,int))) { |
|
136 d->connectionCounterPixmap--; |
|
137 } else if (QLatin1String(signal) == SIGNAL(thumbnailReady(QImage,void*,int,int))) { |
|
138 d->connectionCounterImage--; |
|
139 } |
|
140 } |