videocollection/tsrc/stubs/src/videoservices.cpp
changeset 15 cf5481c2bc0b
child 17 69946d1824c4
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of VideoServices
       
    15 *
       
    16 */
       
    17 
       
    18 #include <qobject.h>
       
    19 #include "videoservices.h"
       
    20 #include "videoserviceurifetch.h"
       
    21 
       
    22 VideoServices *VideoServices::mInstance = 0;
       
    23 
       
    24 VideoServices* VideoServices::instance(QVideoPlayerEngine* engine)
       
    25 {
       
    26     if(!mInstance)
       
    27     {
       
    28         mInstance = new VideoServices(engine);
       
    29     }
       
    30     else if(engine && !mInstance->engine())
       
    31     {
       
    32     	mInstance->setEngine(engine);
       
    33     }
       
    34     mInstance->mReferenceCount++;
       
    35     return mInstance;
       
    36 }
       
    37 
       
    38 void VideoServices::decreaseReferenceCount()
       
    39 {
       
    40     if(mInstance)
       
    41     {
       
    42         if(--mInstance->mReferenceCount == 0)
       
    43         {
       
    44             delete mInstance;
       
    45             mInstance = NULL;
       
    46         }
       
    47     }
       
    48 }
       
    49 
       
    50 void VideoServices::setEngine(QVideoPlayerEngine* engine)
       
    51 {
       
    52     Q_UNUSED(engine);
       
    53     // not stubbed
       
    54 }
       
    55 
       
    56 QVideoPlayerEngine* VideoServices::engine()
       
    57 {
       
    58     // not stubbed
       
    59     return 0;
       
    60 }
       
    61 
       
    62 VideoServices::VideoServices(QVideoPlayerEngine* engine):
       
    63     mReferenceCount(0),
       
    64     mEngine(engine),
       
    65     mCurrentService(VideoServices::ENoService)
       
    66 {
       
    67     mServiceUriFetch = new VideoServiceUriFetch(this);
       
    68 }
       
    69 
       
    70 VideoServices::~VideoServices()
       
    71 {
       
    72     delete mServiceUriFetch;
       
    73 }
       
    74 
       
    75 VideoServices::TVideoService VideoServices::currentService()
       
    76 {
       
    77 	return mCurrentService;
       
    78 }
       
    79 
       
    80 void VideoServices::setCurrentService(VideoServices::TVideoService service)
       
    81 {
       
    82 	mCurrentService = service;
       
    83 }
       
    84 QString VideoServices::contextTitle() const
       
    85 {
       
    86     // not stubbed
       
    87     return QString();
       
    88 }
       
    89 
       
    90 void VideoServices::itemSelected(const QString& item)
       
    91 {
       
    92     Q_UNUSED(item);
       
    93     // not stubbed
       
    94 }
       
    95