videocollection/videocollectionwrapper/src/videocollectionwrapper.cpp
author hgs
Fri, 03 Sep 2010 12:37:43 +0300
changeset 58 d2b028fd1f7d
parent 40 13331705e488
permissions -rw-r--r--
201035
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:   VideoCollectionWrapper class implementation
hgs
parents:
diff changeset
    15
* 
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
58
hgs
parents: 40
diff changeset
    18
// Version : %version: 32 %
36
hgs
parents: 34
diff changeset
    19
30
hgs
parents:
diff changeset
    20
// INCLUDE FILES
hgs
parents:
diff changeset
    21
#include <qabstractitemmodel.h>
36
hgs
parents: 34
diff changeset
    22
30
hgs
parents:
diff changeset
    23
#include "videocollectionwrapper.h"
hgs
parents:
diff changeset
    24
#include "videocollectionwrapper_p.h"
58
hgs
parents: 40
diff changeset
    25
#include "videoproxymodelgeneric.h"
36
hgs
parents: 34
diff changeset
    26
#include "videocollectiontrace.h"
30
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    29
// VideoCollectionWrapper::CVideoCollectionWrapper()
hgs
parents:
diff changeset
    30
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    31
//
34
hgs
parents: 30
diff changeset
    32
VideoCollectionWrapper &VideoCollectionWrapper::instance()
30
hgs
parents:
diff changeset
    33
{
36
hgs
parents: 34
diff changeset
    34
	FUNC_LOG;
34
hgs
parents: 30
diff changeset
    35
    static VideoCollectionWrapper _staticWrapper;
30
hgs
parents:
diff changeset
    36
34
hgs
parents: 30
diff changeset
    37
    return _staticWrapper;
30
hgs
parents:
diff changeset
    38
}
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    41
// VideoCollectionWrapper::VideoCollectionWrapper()
hgs
parents:
diff changeset
    42
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    43
//
hgs
parents:
diff changeset
    44
VideoCollectionWrapper::VideoCollectionWrapper() : 
hgs
parents:
diff changeset
    45
    d( new VideoCollectionWrapperPrivate ),
hgs
parents:
diff changeset
    46
    mReferenceCount(0)
hgs
parents:
diff changeset
    47
{
36
hgs
parents: 34
diff changeset
    48
	FUNC_LOG;
30
hgs
parents:
diff changeset
    49
}
hgs
parents:
diff changeset
    50
hgs
parents:
diff changeset
    51
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    52
// CVideoCollectionWrapper::~CVideoCollectionWrapper()
hgs
parents:
diff changeset
    53
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    54
//
hgs
parents:
diff changeset
    55
VideoCollectionWrapper::~VideoCollectionWrapper()
hgs
parents:
diff changeset
    56
{
36
hgs
parents: 34
diff changeset
    57
	FUNC_LOG;
40
hgs
parents: 36
diff changeset
    58
    delete d;    
30
hgs
parents:
diff changeset
    59
}
hgs
parents:
diff changeset
    60
hgs
parents:
diff changeset
    61
// -----------------------------------------------------------------------------
58
hgs
parents: 40
diff changeset
    62
// CVideoCollectionWrapper::getGenericModel()
30
hgs
parents:
diff changeset
    63
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
    64
//
58
hgs
parents: 40
diff changeset
    65
VideoProxyModelGeneric* VideoCollectionWrapper::getGenericModel()
hgs
parents: 40
diff changeset
    66
{
hgs
parents: 40
diff changeset
    67
    FUNC_LOG;
hgs
parents: 40
diff changeset
    68
    if(d)
hgs
parents: 40
diff changeset
    69
    {
hgs
parents: 40
diff changeset
    70
        return d->getGenericModel();
hgs
parents: 40
diff changeset
    71
    }
hgs
parents: 40
diff changeset
    72
    return 0;
hgs
parents: 40
diff changeset
    73
}
hgs
parents: 40
diff changeset
    74
hgs
parents: 40
diff changeset
    75
// -----------------------------------------------------------------------------
hgs
parents: 40
diff changeset
    76
// CVideoCollectionWrapper::getAllVideosModel()
hgs
parents: 40
diff changeset
    77
// -----------------------------------------------------------------------------
hgs
parents: 40
diff changeset
    78
//
hgs
parents: 40
diff changeset
    79
VideoProxyModelGeneric* VideoCollectionWrapper::getAllVideosModel()
30
hgs
parents:
diff changeset
    80
{
36
hgs
parents: 34
diff changeset
    81
	FUNC_LOG;
30
hgs
parents:
diff changeset
    82
    if(d)
hgs
parents:
diff changeset
    83
    {
58
hgs
parents: 40
diff changeset
    84
        return d->getAllVideosModel();
hgs
parents: 40
diff changeset
    85
    }
hgs
parents: 40
diff changeset
    86
    return 0;
hgs
parents: 40
diff changeset
    87
}
hgs
parents: 40
diff changeset
    88
hgs
parents: 40
diff changeset
    89
// -----------------------------------------------------------------------------
hgs
parents: 40
diff changeset
    90
// CVideoCollectionWrapper::getCollectionsModel()
hgs
parents: 40
diff changeset
    91
// -----------------------------------------------------------------------------
hgs
parents: 40
diff changeset
    92
//
hgs
parents: 40
diff changeset
    93
VideoProxyModelGeneric* VideoCollectionWrapper::getCollectionsModel()
hgs
parents: 40
diff changeset
    94
{
hgs
parents: 40
diff changeset
    95
    FUNC_LOG;
hgs
parents: 40
diff changeset
    96
    if(d)
hgs
parents: 40
diff changeset
    97
    {
hgs
parents: 40
diff changeset
    98
        return d->getCollectionsModel();
hgs
parents: 40
diff changeset
    99
    }
hgs
parents: 40
diff changeset
   100
    return 0;
hgs
parents: 40
diff changeset
   101
}
hgs
parents: 40
diff changeset
   102
hgs
parents: 40
diff changeset
   103
// -----------------------------------------------------------------------------
hgs
parents: 40
diff changeset
   104
// CVideoCollectionWrapper::getCollectionContentModel()
hgs
parents: 40
diff changeset
   105
// -----------------------------------------------------------------------------
hgs
parents: 40
diff changeset
   106
//
hgs
parents: 40
diff changeset
   107
VideoProxyModelGeneric* VideoCollectionWrapper::getCollectionContentModel()
hgs
parents: 40
diff changeset
   108
{
hgs
parents: 40
diff changeset
   109
    FUNC_LOG;
hgs
parents: 40
diff changeset
   110
    if(d)
hgs
parents: 40
diff changeset
   111
    {
hgs
parents: 40
diff changeset
   112
        return d->getCollectionContentModel();
30
hgs
parents:
diff changeset
   113
    }
hgs
parents:
diff changeset
   114
    return 0;
hgs
parents:
diff changeset
   115
}
hgs
parents:
diff changeset
   116
hgs
parents:
diff changeset
   117
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   118
// VideoCollectionWrapper::sendAsyncStatus()
hgs
parents:
diff changeset
   119
// -----------------------------------------------------------------------------
hgs
parents:
diff changeset
   120
//
hgs
parents:
diff changeset
   121
void VideoCollectionWrapper::sendAsyncStatus(int statusCode,  QVariant &additional)
hgs
parents:
diff changeset
   122
{
36
hgs
parents: 34
diff changeset
   123
	FUNC_LOG;
30
hgs
parents:
diff changeset
   124
    emit asyncStatus(statusCode, additional);
hgs
parents:
diff changeset
   125
}
hgs
parents:
diff changeset
   126
hgs
parents:
diff changeset
   127
// End of file