videocollection/videocollectionwrapper/src/videothumbnaildata.cpp
author hgs
Fri, 14 May 2010 15:14:51 +0300
changeset 38 ff53afa8ad05
parent 37 4eb2df7f7cbe
child 50 21fe8338c6bf
permissions -rw-r--r--
201019
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description: VideoThumbnailData class implementation
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
37
hgs
parents: 36
diff changeset
    18
// Version : %version: 26 %
36
hgs
parents: 34
diff changeset
    19
30
hgs
parents:
diff changeset
    20
// INCLUDE FILES
36
hgs
parents: 34
diff changeset
    21
#include "videocollectiontrace.h"
30
hgs
parents:
diff changeset
    22
#include "videothumbnaildata.h"
hgs
parents:
diff changeset
    23
#include "videothumbnaildata_p.h"
hgs
parents:
diff changeset
    24
hgs
parents:
diff changeset
    25
// ================= MEMBER FUNCTIONS =======================
hgs
parents:
diff changeset
    26
//
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    29
// VideoThumbnailData::VideoThumbnailData()
hgs
parents:
diff changeset
    30
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    31
//
hgs
parents:
diff changeset
    32
VideoThumbnailData &VideoThumbnailData::instance()
hgs
parents:
diff changeset
    33
{
36
hgs
parents: 34
diff changeset
    34
	FUNC_LOG;
30
hgs
parents:
diff changeset
    35
    static VideoThumbnailData _thumbnailData;
hgs
parents:
diff changeset
    36
    return _thumbnailData;
hgs
parents:
diff changeset
    37
}
hgs
parents:
diff changeset
    38
hgs
parents:
diff changeset
    39
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    40
// VideoThumbnailData::VideoThumbnailData()
hgs
parents:
diff changeset
    41
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    42
//
hgs
parents:
diff changeset
    43
VideoThumbnailData::VideoThumbnailData() :
hgs
parents:
diff changeset
    44
d_ptr(new VideoThumbnailDataPrivate())
hgs
parents:
diff changeset
    45
{
36
hgs
parents: 34
diff changeset
    46
	FUNC_LOG;
30
hgs
parents:
diff changeset
    47
    connect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)), 
hgs
parents:
diff changeset
    48
            this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
hgs
parents:
diff changeset
    49
}
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    52
// VideoThumbnailData::~VideoThumbnailData()
hgs
parents:
diff changeset
    53
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    54
//
hgs
parents:
diff changeset
    55
VideoThumbnailData::~VideoThumbnailData()
hgs
parents:
diff changeset
    56
{
36
hgs
parents: 34
diff changeset
    57
	FUNC_LOG;
30
hgs
parents:
diff changeset
    58
    disconnect(d_ptr, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)), 
hgs
parents:
diff changeset
    59
            this, SIGNAL(thumbnailsFetched(QList<TMPXItemId>)));
hgs
parents:
diff changeset
    60
    delete d_ptr;
hgs
parents:
diff changeset
    61
}
hgs
parents:
diff changeset
    62
hgs
parents:
diff changeset
    63
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    64
// VideoThumbnailData::removeThumbnail()
hgs
parents:
diff changeset
    65
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    66
//
hgs
parents:
diff changeset
    67
bool VideoThumbnailData::removeThumbnail(TMPXItemId mediaId)
hgs
parents:
diff changeset
    68
{
37
hgs
parents: 36
diff changeset
    69
	INFO_2("VideoThumbnailData::removeThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
30
hgs
parents:
diff changeset
    70
    return d_ptr->removeThumbnail(mediaId);
hgs
parents:
diff changeset
    71
}
hgs
parents:
diff changeset
    72
hgs
parents:
diff changeset
    73
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    74
// VideoThumbnailData::getThumbnail()
hgs
parents:
diff changeset
    75
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    76
//
hgs
parents:
diff changeset
    77
const QIcon* VideoThumbnailData::getThumbnail(TMPXItemId mediaId)
hgs
parents:
diff changeset
    78
{
37
hgs
parents: 36
diff changeset
    79
	INFO_2("VideoThumbnailData::getThumbnail() mediaId (%d, %d)", mediaId.iId1, mediaId.iId2);
30
hgs
parents:
diff changeset
    80
    return d_ptr->getThumbnail(mediaId);
hgs
parents:
diff changeset
    81
}
hgs
parents:
diff changeset
    82
hgs
parents:
diff changeset
    83
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    84
// VideoThumbnailData::startBackgroundFetching()
hgs
parents:
diff changeset
    85
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    86
//
34
hgs
parents: 30
diff changeset
    87
void VideoThumbnailData::startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex)
30
hgs
parents:
diff changeset
    88
{
37
hgs
parents: 36
diff changeset
    89
	INFO_2("VideoThumbnailData::startBackgroundFetching() model: 0x%x, fetchIndex: %d", model, fetchIndex);
34
hgs
parents: 30
diff changeset
    90
    d_ptr->startBackgroundFetching(model, fetchIndex);
30
hgs
parents:
diff changeset
    91
}
hgs
parents:
diff changeset
    92
hgs
parents:
diff changeset
    93
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    94
// VideoThumbnailData::enableBackgroundFetching()
hgs
parents:
diff changeset
    95
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    96
//
hgs
parents:
diff changeset
    97
void VideoThumbnailData::enableBackgroundFetching(bool enable)
hgs
parents:
diff changeset
    98
{
37
hgs
parents: 36
diff changeset
    99
    INFO_1("VideoThumbnailData::enableBackgroundFetching() enable: %d", enable);
30
hgs
parents:
diff changeset
   100
    d_ptr->enableBackgroundFetching(enable);
hgs
parents:
diff changeset
   101
}
hgs
parents:
diff changeset
   102
hgs
parents:
diff changeset
   103
// -----------------------------------------------------------------------------
34
hgs
parents: 30
diff changeset
   104
// VideoThumbnailData::enableThumbnailCreation()
hgs
parents: 30
diff changeset
   105
// -----------------------------------------------------------------------------
hgs
parents: 30
diff changeset
   106
//
hgs
parents: 30
diff changeset
   107
void VideoThumbnailData::enableThumbnailCreation(bool enable)
hgs
parents: 30
diff changeset
   108
{
37
hgs
parents: 36
diff changeset
   109
    INFO_1("VideoThumbnailData::enableThumbnailCreation() enable: %d", enable);
34
hgs
parents: 30
diff changeset
   110
    d_ptr->enableThumbnailCreation(enable);
hgs
parents: 30
diff changeset
   111
}
hgs
parents: 30
diff changeset
   112
hgs
parents: 30
diff changeset
   113
// -----------------------------------------------------------------------------
30
hgs
parents:
diff changeset
   114
// VideoThumbnailData::freeThumbnailData()
hgs
parents:
diff changeset
   115
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   116
//
hgs
parents:
diff changeset
   117
void VideoThumbnailData::freeThumbnailData()
hgs
parents:
diff changeset
   118
{
36
hgs
parents: 34
diff changeset
   119
	FUNC_LOG;
30
hgs
parents:
diff changeset
   120
    d_ptr->freeThumbnailData();
hgs
parents:
diff changeset
   121
}
hgs
parents:
diff changeset
   122
hgs
parents:
diff changeset
   123
// End of file