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: State provider interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef HSISTATEPROVIDER_H |
|
20 #define HSISTATEPROVIDER_H |
|
21 |
|
22 #include <QtPlugin> |
|
23 #include <QList> |
|
24 #include <QString> |
|
25 |
|
26 class QState; |
|
27 |
|
28 /*! |
|
29 \class HsStateToken |
|
30 \ingroup group_hsstatemodel |
|
31 \brief Represents a home screen state that can be created. |
|
32 Home screen states are located in state providers. Each provider |
|
33 exposes its contained states as state tokens. A token has all |
|
34 the needed information for state selection and creation. |
|
35 */ |
|
36 class HsStateToken |
|
37 { |
|
38 |
|
39 public: |
|
40 |
|
41 /*! |
|
42 The name of the library/plugin that contains the state. |
|
43 */ |
|
44 QString mLibrary; |
|
45 |
|
46 /*! |
|
47 Uniquely identifies the state. |
|
48 */ |
|
49 QString mUri; |
|
50 |
|
51 }; |
|
52 |
|
53 /*! |
|
54 \class IHsStateProvider |
|
55 \ingroup group_hsstatemodel |
|
56 \brief Defines a mechanism for retrieving a home screen state. |
|
57 Interface that defines a mechanism for retrieving a home screen |
|
58 state. Each home screen state provider implements this interface. |
|
59 */ |
|
60 class IHsStateProvider |
|
61 { |
|
62 |
|
63 public: |
|
64 |
|
65 /*! |
|
66 Destructor. |
|
67 */ |
|
68 virtual ~IHsStateProvider() {} |
|
69 |
|
70 public: |
|
71 |
|
72 /*! |
|
73 Returns contained states as a list of state tokens. |
|
74 */ |
|
75 virtual QList<HsStateToken> states() = 0; |
|
76 |
|
77 /*! |
|
78 Creates and returns a state based on the given token. |
|
79 \a aToken Identifies the state to be created. |
|
80 |
|
81 Returns The created state or null in failure cases. |
|
82 */ |
|
83 virtual QState* createState(const HsStateToken& aToken) = 0; |
|
84 |
|
85 }; |
|
86 |
|
87 Q_DECLARE_INTERFACE(IHsStateProvider, "com.nokia.homescreen.istateprovider/1.0") |
|
88 |
|
89 #endif |
|