videocollection/tsrc/stubs/src/videocollectionviewutils.cpp
author hgs
Thu, 01 Apr 2010 23:32:44 +0300
changeset 35 3738fe97f027
parent 34 bbb98528c666
child 36 8aed59de29f9
permissions -rw-r--r--
201011
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
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: video collection view plugin's ui utils class
hgs
parents:
diff changeset
    15
* 
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include "videocollectionviewutils.h"
hgs
parents:
diff changeset
    19
#include "videocollectionviewutilsdata.h"
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
int VideoCollectionViewUtilsData::mLastError = 0;
hgs
parents:
diff changeset
    22
bool VideoCollectionViewUtilsData::mLoadSortingValuesFails = false;
hgs
parents:
diff changeset
    23
bool VideoCollectionViewUtilsData::mGetServiceIconStringsFails = false;
hgs
parents:
diff changeset
    24
int VideoCollectionViewUtilsData::mSortRole = 0;
hgs
parents:
diff changeset
    25
Qt::SortOrder VideoCollectionViewUtilsData::mSortOrder = Qt::AscendingOrder;
hgs
parents:
diff changeset
    26
QString VideoCollectionViewUtilsData::mIconString = "";
hgs
parents:
diff changeset
    27
QString VideoCollectionViewUtilsData::mPressedString = "";
35
hgs
parents: 34
diff changeset
    28
QVariant VideoCollectionViewUtilsData::mLastStatusAdditional = QVariant();
34
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
VideoCollectionViewUtils& VideoCollectionViewUtils::instance()
hgs
parents:
diff changeset
    31
{
hgs
parents:
diff changeset
    32
     static VideoCollectionViewUtils _popupInstance;
hgs
parents:
diff changeset
    33
     return _popupInstance;
hgs
parents:
diff changeset
    34
}
hgs
parents:
diff changeset
    35
hgs
parents:
diff changeset
    36
VideoCollectionViewUtils::VideoCollectionViewUtils():
hgs
parents:
diff changeset
    37
    mSortRole(-1),
hgs
parents:
diff changeset
    38
    mSortOrder(Qt::AscendingOrder)
hgs
parents:
diff changeset
    39
{
hgs
parents:
diff changeset
    40
    // not stubbed
hgs
parents:
diff changeset
    41
}
hgs
parents:
diff changeset
    42
hgs
parents:
diff changeset
    43
VideoCollectionViewUtils::~VideoCollectionViewUtils()
hgs
parents:
diff changeset
    44
{
hgs
parents:
diff changeset
    45
    VideoCollectionViewUtilsData::reset();
hgs
parents:
diff changeset
    46
}
hgs
parents:
diff changeset
    47
hgs
parents:
diff changeset
    48
int VideoCollectionViewUtils::saveSortingValues(int role, Qt::SortOrder order)
hgs
parents:
diff changeset
    49
{
hgs
parents:
diff changeset
    50
    VideoCollectionViewUtilsData::mSortRole = role;
hgs
parents:
diff changeset
    51
    VideoCollectionViewUtilsData::mSortOrder = order;
hgs
parents:
diff changeset
    52
    return 0;
hgs
parents:
diff changeset
    53
}
hgs
parents:
diff changeset
    54
hgs
parents:
diff changeset
    55
int VideoCollectionViewUtils::loadSortingValues(int &role, Qt::SortOrder &order)
hgs
parents:
diff changeset
    56
{
hgs
parents:
diff changeset
    57
    if (VideoCollectionViewUtilsData::mLoadSortingValuesFails)
hgs
parents:
diff changeset
    58
    {
hgs
parents:
diff changeset
    59
        return -1;
hgs
parents:
diff changeset
    60
    }
hgs
parents:
diff changeset
    61
    
hgs
parents:
diff changeset
    62
    role = VideoCollectionViewUtilsData::mSortRole;
hgs
parents:
diff changeset
    63
    order = VideoCollectionViewUtilsData::mSortOrder;
hgs
parents:
diff changeset
    64
    
hgs
parents:
diff changeset
    65
    return 0;
hgs
parents:
diff changeset
    66
}
hgs
parents:
diff changeset
    67
hgs
parents:
diff changeset
    68
int VideoCollectionViewUtils::getServiceIconStrings(QString& icon, 
hgs
parents:
diff changeset
    69
    QString& iconPressed)
hgs
parents:
diff changeset
    70
{
hgs
parents:
diff changeset
    71
    if (VideoCollectionViewUtilsData::mGetServiceIconStringsFails)
hgs
parents:
diff changeset
    72
    {
hgs
parents:
diff changeset
    73
        return -1;
hgs
parents:
diff changeset
    74
    }
hgs
parents:
diff changeset
    75
    
hgs
parents:
diff changeset
    76
    icon = VideoCollectionViewUtilsData::mIconString;
hgs
parents:
diff changeset
    77
    iconPressed = VideoCollectionViewUtilsData::mPressedString;
hgs
parents:
diff changeset
    78
    
hgs
parents:
diff changeset
    79
    return 0;
hgs
parents:
diff changeset
    80
}
hgs
parents:
diff changeset
    81
hgs
parents:
diff changeset
    82
QString VideoCollectionViewUtils::getServiceUriString()
hgs
parents:
diff changeset
    83
{
hgs
parents:
diff changeset
    84
    // not stubbed
hgs
parents:
diff changeset
    85
    return QString();
hgs
parents:
diff changeset
    86
}
hgs
parents:
diff changeset
    87
hgs
parents:
diff changeset
    88
void VideoCollectionViewUtils::initListView(HbListView *view)
hgs
parents:
diff changeset
    89
{
hgs
parents:
diff changeset
    90
    Q_UNUSED(view);
hgs
parents:
diff changeset
    91
    // not stubbed
hgs
parents:
diff changeset
    92
}
hgs
parents:
diff changeset
    93
hgs
parents:
diff changeset
    94
void VideoCollectionViewUtils::sortModel(VideoSortFilterProxyModel *model,
hgs
parents:
diff changeset
    95
    bool async)
hgs
parents:
diff changeset
    96
{
hgs
parents:
diff changeset
    97
    Q_UNUSED(model);
hgs
parents:
diff changeset
    98
    Q_UNUSED(async);
hgs
parents:
diff changeset
    99
    // not stubbed
hgs
parents:
diff changeset
   100
}
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
void VideoCollectionViewUtils::showStatusMsgSlot(int statusCode, QVariant &additional)
hgs
parents:
diff changeset
   103
{
35
hgs
parents: 34
diff changeset
   104
    VideoCollectionViewUtilsData::mLastStatusAdditional = additional;
34
hgs
parents:
diff changeset
   105
    VideoCollectionViewUtilsData::mLastError = statusCode;
hgs
parents:
diff changeset
   106
}