homescreensrv_plat/statemodel_api/hsistateprovider.h
author hgs
Fri, 28 May 2010 16:17:03 +0300
changeset 96 5d243a69bdda
parent 85 7feec50967db
permissions -rw-r--r--
201021
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
85
7feec50967db 201003_02
hgs
parents:
diff changeset
     1
/*
7feec50967db 201003_02
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7feec50967db 201003_02
hgs
parents:
diff changeset
     3
* All rights reserved.
7feec50967db 201003_02
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
7feec50967db 201003_02
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
7feec50967db 201003_02
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
7feec50967db 201003_02
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
7feec50967db 201003_02
hgs
parents:
diff changeset
     8
*
7feec50967db 201003_02
hgs
parents:
diff changeset
     9
* Initial Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
7feec50967db 201003_02
hgs
parents:
diff changeset
    11
*
7feec50967db 201003_02
hgs
parents:
diff changeset
    12
* Contributors:
7feec50967db 201003_02
hgs
parents:
diff changeset
    13
*
7feec50967db 201003_02
hgs
parents:
diff changeset
    14
* Description:  State provider interface.
7feec50967db 201003_02
hgs
parents:
diff changeset
    15
*
7feec50967db 201003_02
hgs
parents:
diff changeset
    16
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    17
7feec50967db 201003_02
hgs
parents:
diff changeset
    18
7feec50967db 201003_02
hgs
parents:
diff changeset
    19
#ifndef HSISTATEPROVIDER_H
7feec50967db 201003_02
hgs
parents:
diff changeset
    20
#define HSISTATEPROVIDER_H
7feec50967db 201003_02
hgs
parents:
diff changeset
    21
7feec50967db 201003_02
hgs
parents:
diff changeset
    22
#include <QtPlugin>
7feec50967db 201003_02
hgs
parents:
diff changeset
    23
#include <QList>
7feec50967db 201003_02
hgs
parents:
diff changeset
    24
#include <QString>
7feec50967db 201003_02
hgs
parents:
diff changeset
    25
7feec50967db 201003_02
hgs
parents:
diff changeset
    26
class QState;
7feec50967db 201003_02
hgs
parents:
diff changeset
    27
7feec50967db 201003_02
hgs
parents:
diff changeset
    28
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    29
    \class HsStateToken
7feec50967db 201003_02
hgs
parents:
diff changeset
    30
    \ingroup group_hsstatemodel
7feec50967db 201003_02
hgs
parents:
diff changeset
    31
    \brief Represents a home screen state that can be created.
7feec50967db 201003_02
hgs
parents:
diff changeset
    32
    Home screen states are located in state providers. Each provider
7feec50967db 201003_02
hgs
parents:
diff changeset
    33
    exposes its contained states as state tokens. A token has all
7feec50967db 201003_02
hgs
parents:
diff changeset
    34
    the needed information for state selection and creation.
7feec50967db 201003_02
hgs
parents:
diff changeset
    35
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    36
class HsStateToken
7feec50967db 201003_02
hgs
parents:
diff changeset
    37
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    38
7feec50967db 201003_02
hgs
parents:
diff changeset
    39
public:
7feec50967db 201003_02
hgs
parents:
diff changeset
    40
7feec50967db 201003_02
hgs
parents:
diff changeset
    41
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    42
    The name of the library/plugin that contains the state.
7feec50967db 201003_02
hgs
parents:
diff changeset
    43
 */
7feec50967db 201003_02
hgs
parents:
diff changeset
    44
QString mLibrary;
7feec50967db 201003_02
hgs
parents:
diff changeset
    45
7feec50967db 201003_02
hgs
parents:
diff changeset
    46
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    47
    Uniquely identifies the state.
7feec50967db 201003_02
hgs
parents:
diff changeset
    48
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    49
    QString mUri;
7feec50967db 201003_02
hgs
parents:
diff changeset
    50
7feec50967db 201003_02
hgs
parents:
diff changeset
    51
};
7feec50967db 201003_02
hgs
parents:
diff changeset
    52
7feec50967db 201003_02
hgs
parents:
diff changeset
    53
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    54
    \class IHsStateProvider
7feec50967db 201003_02
hgs
parents:
diff changeset
    55
    \ingroup group_hsstatemodel
7feec50967db 201003_02
hgs
parents:
diff changeset
    56
    \brief Defines a mechanism for retrieving a home screen state.
7feec50967db 201003_02
hgs
parents:
diff changeset
    57
    Interface that defines a mechanism for retrieving a home screen
7feec50967db 201003_02
hgs
parents:
diff changeset
    58
    state. Each home screen state provider implements this interface.
7feec50967db 201003_02
hgs
parents:
diff changeset
    59
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    60
class IHsStateProvider
7feec50967db 201003_02
hgs
parents:
diff changeset
    61
{
7feec50967db 201003_02
hgs
parents:
diff changeset
    62
7feec50967db 201003_02
hgs
parents:
diff changeset
    63
public:
7feec50967db 201003_02
hgs
parents:
diff changeset
    64
7feec50967db 201003_02
hgs
parents:
diff changeset
    65
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    66
    Destructor.    
7feec50967db 201003_02
hgs
parents:
diff changeset
    67
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    68
    virtual ~IHsStateProvider() {}
7feec50967db 201003_02
hgs
parents:
diff changeset
    69
7feec50967db 201003_02
hgs
parents:
diff changeset
    70
public:
7feec50967db 201003_02
hgs
parents:
diff changeset
    71
7feec50967db 201003_02
hgs
parents:
diff changeset
    72
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    73
    Returns contained states as a list of state tokens.    
7feec50967db 201003_02
hgs
parents:
diff changeset
    74
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    75
    virtual QList<HsStateToken> states() = 0;
7feec50967db 201003_02
hgs
parents:
diff changeset
    76
7feec50967db 201003_02
hgs
parents:
diff changeset
    77
/*!
7feec50967db 201003_02
hgs
parents:
diff changeset
    78
    Creates and returns a state based on the given token.
7feec50967db 201003_02
hgs
parents:
diff changeset
    79
    \a aToken Identifies the state to be created.
7feec50967db 201003_02
hgs
parents:
diff changeset
    80
7feec50967db 201003_02
hgs
parents:
diff changeset
    81
    Returns The created state or null in failure cases.
7feec50967db 201003_02
hgs
parents:
diff changeset
    82
*/
7feec50967db 201003_02
hgs
parents:
diff changeset
    83
    virtual QState* createState(const HsStateToken& aToken) = 0;
7feec50967db 201003_02
hgs
parents:
diff changeset
    84
7feec50967db 201003_02
hgs
parents:
diff changeset
    85
};
7feec50967db 201003_02
hgs
parents:
diff changeset
    86
7feec50967db 201003_02
hgs
parents:
diff changeset
    87
Q_DECLARE_INTERFACE(IHsStateProvider, "com.nokia.homescreen.istateprovider/1.0")
7feec50967db 201003_02
hgs
parents:
diff changeset
    88
7feec50967db 201003_02
hgs
parents:
diff changeset
    89
#endif