videocollection/tsrc/stubs/src/videocollectionuiloader.cpp
author hgs
Thu, 01 Apr 2010 23:22:15 +0300
changeset 34 bbb98528c666
child 35 3738fe97f027
permissions -rw-r--r--
201009
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:
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#include <qset.h>
hgs
parents:
diff changeset
    19
#include <qstring.h>
hgs
parents:
diff changeset
    20
#include <hblistview.h>
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include "videocollectionuiloader.h"
hgs
parents:
diff changeset
    23
#include "videolistview.h"
hgs
parents:
diff changeset
    24
#include "videolistwidget.h"
hgs
parents:
diff changeset
    25
#include "videohintwidget.h"
hgs
parents:
diff changeset
    26
#include "videolistselectiondialog.h"
hgs
parents:
diff changeset
    27
hgs
parents:
diff changeset
    28
#include "videocollectionuiloaderdata.h"
hgs
parents:
diff changeset
    29
hgs
parents:
diff changeset
    30
bool VideoCollectionUiLoaderData::mFindFailure = false;
hgs
parents:
diff changeset
    31
bool VideoCollectionUiLoaderData::mFailDialogLoad = false;
hgs
parents:
diff changeset
    32
QStringList VideoCollectionUiLoaderData::mFindFailureNameList;
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
VideoCollectionUiLoader::VideoCollectionUiLoader():
hgs
parents:
diff changeset
    35
    HbDocumentLoader(),
hgs
parents:
diff changeset
    36
    mTimerId(0)
hgs
parents:
diff changeset
    37
{
hgs
parents:
diff changeset
    38
    // not stubbed
hgs
parents:
diff changeset
    39
}
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
VideoCollectionUiLoader::~VideoCollectionUiLoader()
hgs
parents:
diff changeset
    42
{
hgs
parents:
diff changeset
    43
    VideoCollectionUiLoaderData::reset();
hgs
parents:
diff changeset
    44
}
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
void VideoCollectionUiLoader::startLoading(QSet<QString> uiSections,
hgs
parents:
diff changeset
    47
    QObject *receiver,
hgs
parents:
diff changeset
    48
    const char *widgetSlot,
hgs
parents:
diff changeset
    49
    const char *objectSlot)
hgs
parents:
diff changeset
    50
{
hgs
parents:
diff changeset
    51
    Q_UNUSED(uiSections);
hgs
parents:
diff changeset
    52
    Q_UNUSED(receiver);
hgs
parents:
diff changeset
    53
    Q_UNUSED(widgetSlot);
hgs
parents:
diff changeset
    54
    Q_UNUSED(objectSlot);
hgs
parents:
diff changeset
    55
    // not stubbed
hgs
parents:
diff changeset
    56
}
hgs
parents:
diff changeset
    57
hgs
parents:
diff changeset
    58
void VideoCollectionUiLoader::setIsService(bool isService)
hgs
parents:
diff changeset
    59
{
hgs
parents:
diff changeset
    60
    Q_UNUSED(isService);
hgs
parents:
diff changeset
    61
    // not stubbed
hgs
parents:
diff changeset
    62
}
hgs
parents:
diff changeset
    63
hgs
parents:
diff changeset
    64
QGraphicsWidget* VideoCollectionUiLoader::doFindWidget(const QString &name)
hgs
parents:
diff changeset
    65
{
hgs
parents:
diff changeset
    66
    QGraphicsWidget *widget = 0;
hgs
parents:
diff changeset
    67
    widget = HbDocumentLoader::findWidget(name);
hgs
parents:
diff changeset
    68
    return widget;
hgs
parents:
diff changeset
    69
}
hgs
parents:
diff changeset
    70
hgs
parents:
diff changeset
    71
QObject* VideoCollectionUiLoader::doFindObject(const QString &name)
hgs
parents:
diff changeset
    72
{
hgs
parents:
diff changeset
    73
    QObject *object = 0;
hgs
parents:
diff changeset
    74
    object = HbDocumentLoader::findObject(name);
hgs
parents:
diff changeset
    75
    return object;
hgs
parents:
diff changeset
    76
}
hgs
parents:
diff changeset
    77
hgs
parents:
diff changeset
    78
void VideoCollectionUiLoader::addToQueue(Params &params)
hgs
parents:
diff changeset
    79
{
hgs
parents:
diff changeset
    80
    Q_UNUSED(params);
hgs
parents:
diff changeset
    81
    // not stubbed
hgs
parents:
diff changeset
    82
}
hgs
parents:
diff changeset
    83
hgs
parents:
diff changeset
    84
void VideoCollectionUiLoader::initWidget(QGraphicsWidget *widget,
hgs
parents:
diff changeset
    85
    const QString &name)
hgs
parents:
diff changeset
    86
{
hgs
parents:
diff changeset
    87
    Q_UNUSED(widget);
hgs
parents:
diff changeset
    88
    Q_UNUSED(name);
hgs
parents:
diff changeset
    89
    // not stubbed
hgs
parents:
diff changeset
    90
}
hgs
parents:
diff changeset
    91
hgs
parents:
diff changeset
    92
void VideoCollectionUiLoader::initObject(QObject *object,
hgs
parents:
diff changeset
    93
    const QString &name)
hgs
parents:
diff changeset
    94
{
hgs
parents:
diff changeset
    95
    Q_UNUSED(object);
hgs
parents:
diff changeset
    96
    Q_UNUSED(name);
hgs
parents:
diff changeset
    97
    // not stubbed
hgs
parents:
diff changeset
    98
}
hgs
parents:
diff changeset
    99
hgs
parents:
diff changeset
   100
void VideoCollectionUiLoader::timerEvent(QTimerEvent *event)
hgs
parents:
diff changeset
   101
{
hgs
parents:
diff changeset
   102
    Q_UNUSED(event);
hgs
parents:
diff changeset
   103
    // not stubbed
hgs
parents:
diff changeset
   104
}
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
QObject* VideoCollectionUiLoader::createObject(const QString& type,
hgs
parents:
diff changeset
   107
    const QString &name)
hgs
parents:
diff changeset
   108
{
hgs
parents:
diff changeset
   109
    QObject* object = doFindObject(name);
hgs
parents:
diff changeset
   110
    if (!object)
hgs
parents:
diff changeset
   111
    {
hgs
parents:
diff changeset
   112
        if (type == VideoListView::staticMetaObject.className())
hgs
parents:
diff changeset
   113
        {
hgs
parents:
diff changeset
   114
            object = new VideoListView(this);
hgs
parents:
diff changeset
   115
        }
hgs
parents:
diff changeset
   116
        else if (type == VideoListWidget::staticMetaObject.className())
hgs
parents:
diff changeset
   117
        {
hgs
parents:
diff changeset
   118
            object = new VideoListWidget(this);
hgs
parents:
diff changeset
   119
        }
hgs
parents:
diff changeset
   120
        else if ( type == VideoListSelectionDialog::staticMetaObject.className() )
hgs
parents:
diff changeset
   121
        {
hgs
parents:
diff changeset
   122
            if(!VideoCollectionUiLoaderData::mFailDialogLoad)
hgs
parents:
diff changeset
   123
            {
hgs
parents:
diff changeset
   124
                object = new VideoListSelectionDialog(this);
hgs
parents:
diff changeset
   125
                
hgs
parents:
diff changeset
   126
            }
hgs
parents:
diff changeset
   127
            else
hgs
parents:
diff changeset
   128
            {
hgs
parents:
diff changeset
   129
                return 0;
hgs
parents:
diff changeset
   130
            }
hgs
parents:
diff changeset
   131
        }
hgs
parents:
diff changeset
   132
        else if (type == VideoHintWidget::staticMetaObject.className())
hgs
parents:
diff changeset
   133
        {
hgs
parents:
diff changeset
   134
            object = new VideoHintWidget(this);
hgs
parents:
diff changeset
   135
        }
hgs
parents:
diff changeset
   136
        if (object)
hgs
parents:
diff changeset
   137
        {
hgs
parents:
diff changeset
   138
            object->setObjectName(name);
hgs
parents:
diff changeset
   139
hgs
parents:
diff changeset
   140
            if (VideoCollectionUiLoaderData::mFindFailure)
hgs
parents:
diff changeset
   141
            {
hgs
parents:
diff changeset
   142
                if (!VideoCollectionUiLoaderData::mFindFailureNameList.empty())
hgs
parents:
diff changeset
   143
                {
hgs
parents:
diff changeset
   144
                    if (VideoCollectionUiLoaderData::mFindFailureNameList.contains(name))
hgs
parents:
diff changeset
   145
                    {
hgs
parents:
diff changeset
   146
                        delete object;
hgs
parents:
diff changeset
   147
                        object = 0;
hgs
parents:
diff changeset
   148
                    }
hgs
parents:
diff changeset
   149
                }
hgs
parents:
diff changeset
   150
                else
hgs
parents:
diff changeset
   151
                {
hgs
parents:
diff changeset
   152
                    delete object;
hgs
parents:
diff changeset
   153
                    object = 0;
hgs
parents:
diff changeset
   154
                }
hgs
parents:
diff changeset
   155
            }
hgs
parents:
diff changeset
   156
            return object;
hgs
parents:
diff changeset
   157
        }
hgs
parents:
diff changeset
   158
hgs
parents:
diff changeset
   159
        object = HbDocumentLoader::createObject(type, name);
hgs
parents:
diff changeset
   160
    }
hgs
parents:
diff changeset
   161
    
hgs
parents:
diff changeset
   162
    return object;
hgs
parents:
diff changeset
   163
}
hgs
parents:
diff changeset
   164
hgs
parents:
diff changeset
   165
void VideoCollectionUiLoader::runNext()
hgs
parents:
diff changeset
   166
{
hgs
parents:
diff changeset
   167
    // not stubbed
hgs
parents:
diff changeset
   168
}
hgs
parents:
diff changeset
   169
hgs
parents:
diff changeset
   170
bool VideoCollectionUiLoader::isValid(const Params &params)
hgs
parents:
diff changeset
   171
{
hgs
parents:
diff changeset
   172
    Q_UNUSED(params);
hgs
parents:
diff changeset
   173
    // not stubbed
hgs
parents:
diff changeset
   174
    return true;
hgs
parents:
diff changeset
   175
}