homescreensrv_plat/servicemodel_api/hsiserviceprovider.h
changeset 66 32469d7d46ff
parent 61 8e5041d13c84
child 73 4bc7b118b3df
equal deleted inserted replaced
61:8e5041d13c84 66:32469d7d46ff
     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:  HsService provider interface.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef HSISERVICEPROVIDER_H
       
    20 #define HSISERVICEPROVIDER_H
       
    21 
       
    22 #include <QtPlugin>
       
    23 #include <QList>
       
    24 #include <QString>
       
    25 
       
    26 /**
       
    27  * @ingroup group_hsservicemodel group_service_api_candidates
       
    28  * @brief Represents a home screen service that can be created. 
       
    29  * 
       
    30  * Home screen services are located in service providers. Each provider
       
    31  * exposes its contained services as service tokens. A token has all
       
    32  * the needed information for service selection and creation.
       
    33  *
       
    34  * @lib ?library
       
    35  * @since S60 ?S60_version
       
    36  */
       
    37 class HsServiceToken
       
    38 {
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43      * The name of the library/plugin that contains the service.
       
    44      */
       
    45     QString mLibrary;
       
    46 
       
    47     /**
       
    48      * Uniquely identifies the service.
       
    49      */
       
    50     QString mUri;
       
    51 
       
    52 };
       
    53 
       
    54 
       
    55 class IHsPlatformServiceAdapter;
       
    56 
       
    57 /**
       
    58  * @ingroup group_hsservicemodel group_service_api_candidates
       
    59  * @brief Defines a mechanism for retrieving a home screen service.
       
    60  * 
       
    61  * Interface that defines a mechanism for retrieving a home screen
       
    62  * service. Each home screen service provider implements this interface. 
       
    63  *
       
    64  * @lib ?library
       
    65  * @since S60 ?S60_version
       
    66  */
       
    67 class IHsServiceProvider
       
    68 {
       
    69 
       
    70 public:
       
    71 
       
    72     /**
       
    73      * Destructor.
       
    74      * @since S60 ?S60_version.
       
    75      */
       
    76     virtual ~IHsServiceProvider() {}
       
    77 
       
    78 public:
       
    79 
       
    80     /**
       
    81      * Returns contained services as a list of service tokens.
       
    82      * @since S60 ?S60_version.
       
    83      * @return Contained services as tokens.
       
    84      */
       
    85     virtual QList<HsServiceToken> services() = 0;
       
    86 
       
    87     /**
       
    88      * Creates and returns a service based on the given token.
       
    89      * @since S60 ?S60_version.
       
    90      * @param aToken Identifies the service to be created.
       
    91      * @return The created service or null in failure cases.
       
    92      */
       
    93     virtual IHsPlatformServiceAdapter* createService(const HsServiceToken& aToken) = 0;
       
    94 
       
    95 };
       
    96 
       
    97 Q_DECLARE_INTERFACE(IHsServiceProvider, "com.nokia.homescreen.iserviceprovider/1.0")
       
    98 
       
    99 #endif