screensaverapp/runtimeproviders/snsrdefaultruntimeprovider/src/snsrdefaultruntimeprovider.cpp
changeset 39 4e8ebe173323
parent 36 cdae8c6c3876
child 42 517f4fb5ec74
child 46 23b5d6a29cce
equal deleted inserted replaced
36:cdae8c6c3876 39:4e8ebe173323
     1 /*
       
     2 * Copyright (c) 2009 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: Default runtime provider.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "snsrdefaultruntimeprovider.h"
       
    19 
       
    20 #include <QList>
       
    21 
       
    22 #include "snsrdefaultruntime.h"
       
    23 
       
    24 /*!
       
    25     \class SnsrDefaultRuntimeProvider
       
    26     \ingroup group_snsrdefaultruntimeprovider
       
    27     \brief Provides a default implementation of the screensaver runtime.
       
    28 
       
    29     This provider includes a default implementation of the screensaver runtime.
       
    30     The runtime is described in the snsrdefaultruntimeprovider.manifest file.
       
    31 */
       
    32 
       
    33 // Constants
       
    34 const char gFileName [] = "snsrdefaultruntimeprovider.dll";
       
    35 const char gFileUri [] = "screensaver.nokia.com/runtime/defaultruntime";
       
    36 
       
    37 /*!
       
    38     Constructs a new SnsrDefaultRuntimeProvider with parent.
       
    39 */
       
    40 SnsrDefaultRuntimeProvider::SnsrDefaultRuntimeProvider(QObject *parent) :
       
    41     QObject(parent)
       
    42 {
       
    43 }
       
    44 
       
    45 /*!
       
    46     Destructs the class.
       
    47 */
       
    48 SnsrDefaultRuntimeProvider::~SnsrDefaultRuntimeProvider()
       
    49 {
       
    50 }
       
    51 
       
    52 /*!
       
    53     Returns contained runtimes as a list of tokens.
       
    54 */
       
    55 QList<HsRuntimeToken> SnsrDefaultRuntimeProvider::runtimes()
       
    56 {
       
    57     HsRuntimeToken token = {gFileName, gFileUri};
       
    58     return QList<HsRuntimeToken>() << token;
       
    59 }
       
    60 
       
    61 /*!
       
    62     Creates a runtime based on the given token.
       
    63 */
       
    64 HsRuntime *SnsrDefaultRuntimeProvider::createRuntime(const HsRuntimeToken& token)
       
    65 {
       
    66     if ((token.mLibrary == gFileName) && (token.mUri == gFileUri)) {
       
    67         return new SnsrDefaultRuntime();
       
    68     }
       
    69     else {
       
    70         return 0;
       
    71     }
       
    72 }
       
    73 
       
    74 #ifndef COVERAGE_MEASUREMENT
       
    75 Q_EXPORT_PLUGIN2(snsrdefaultruntimeprovider, SnsrDefaultRuntimeProvider)
       
    76 #endif // COVERAGE_MEASUREMENT