videocollection/tsrc/stubs/src/videooperatorservice.cpp
changeset 44 518105d52e45
child 50 21fe8338c6bf
equal deleted inserted replaced
42:17f382c040b1 44:518105d52e45
       
     1 /*
       
     2 * Copyright (c) 2008 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:   VideoOperatorService class implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "videooperatorservice.h"
       
    23 #include "videooperatorservicedata.h"
       
    24 #include "videocollectionviewutils.h"
       
    25 #include "videocollectioncenrepdefs.h"
       
    26 
       
    27 QList<QString> VideoOperatorServiceData::mTitles;
       
    28 QList<QString> VideoOperatorServiceData::mIcons;
       
    29 QList<QString> VideoOperatorServiceData::mUris;
       
    30 QList<int> VideoOperatorServiceData::mUids;
       
    31         
       
    32 int VideoOperatorServiceData::mLoadCallCount = 0;
       
    33 int VideoOperatorServiceData::mTitleCallCount = 0;
       
    34 int VideoOperatorServiceData::mIconResourceCallCount = 0;
       
    35 int VideoOperatorServiceData::mLaunchServiceCallCount = 0;
       
    36 int VideoOperatorServiceData::mLaunchApplicationLCallCount = 0;
       
    37 
       
    38 // ---------------------------------------------------------------------------
       
    39 // Constructor
       
    40 // ---------------------------------------------------------------------------
       
    41 //
       
    42 VideoOperatorService::VideoOperatorService(QObject *parent) : 
       
    43     QObject(parent)
       
    44 {
       
    45     // not stubbed
       
    46 }
       
    47 
       
    48 // ---------------------------------------------------------------------------
       
    49 // load
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 bool VideoOperatorService::load(int titleKey, int iconKey, int serviceUriKey, int appUidKey)
       
    53 {
       
    54     // not stubbed
       
    55     Q_UNUSED(titleKey);
       
    56     Q_UNUSED(iconKey);
       
    57     Q_UNUSED(serviceUriKey);
       
    58     Q_UNUSED(appUidKey);
       
    59     
       
    60     VideoOperatorServiceData::mLoadCallCount++;
       
    61     
       
    62     if(VideoOperatorServiceData::mTitles.count() > 0)
       
    63     {
       
    64         mTitle = VideoOperatorServiceData::mTitles.takeFirst();
       
    65     }
       
    66     if(VideoOperatorServiceData::mIcons.count() > 0)
       
    67     {
       
    68         mIconResource = VideoOperatorServiceData::mIcons.takeFirst();
       
    69     }
       
    70     if(VideoOperatorServiceData::mUris.count() > 0)
       
    71     {
       
    72         mServiceUri = VideoOperatorServiceData::mUris.takeFirst();
       
    73     }
       
    74     if(VideoOperatorServiceData::mUids.count() > 0)
       
    75     {
       
    76         mApplicationUid = VideoOperatorServiceData::mUids.takeFirst();
       
    77     }
       
    78 
       
    79     // Icon is required, either service uri or application uid is required.
       
    80     if(mIconResource.isEmpty() && (mServiceUri.isEmpty() || mApplicationUid > 0))
       
    81     {
       
    82         return false;
       
    83     }    
       
    84     return true;
       
    85 }
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 // title
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 const QString VideoOperatorService::title() const
       
    92 {
       
    93     VideoOperatorServiceData::mTitleCallCount++;
       
    94     return mTitle;
       
    95 }
       
    96 
       
    97 // ---------------------------------------------------------------------------
       
    98 // iconResource
       
    99 // ---------------------------------------------------------------------------
       
   100 //
       
   101 const QString VideoOperatorService::iconResource() const
       
   102 {
       
   103     VideoOperatorServiceData::mIconResourceCallCount++;
       
   104     return mIconResource;
       
   105 }
       
   106 
       
   107 // ---------------------------------------------------------------------------
       
   108 // launchService
       
   109 // ---------------------------------------------------------------------------
       
   110 //
       
   111 void VideoOperatorService::launchService()
       
   112 {
       
   113     VideoOperatorServiceData::mLaunchServiceCallCount++;
       
   114     // not stubbed
       
   115 }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // launchApplicationL
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void VideoOperatorService::launchApplicationL(const TUid uid, TInt viewId)
       
   122 {
       
   123     Q_UNUSED(uid);
       
   124     Q_UNUSED(viewId);
       
   125     VideoOperatorServiceData::mLaunchApplicationLCallCount++;
       
   126     // not stubbed
       
   127 }
       
   128 
       
   129 // End of file.