85
|
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: HsWidget provider interface.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef HSIWIDGETPROVIDER_H
|
|
20 |
#define HSIWIDGETPROVIDER_H
|
|
21 |
|
|
22 |
#include <QtPlugin>
|
|
23 |
#include <QList>
|
|
24 |
#include <QString>
|
|
25 |
#include <QVariant>
|
|
26 |
#include <QMetaType>
|
|
27 |
|
98
|
28 |
|
|
29 |
/*DEPRECATED
|
85
|
30 |
\class HsWidgetToken
|
98
|
31 |
\ingroup group_hswidgetmodel_api
|
85
|
32 |
\brief Represents a home screen widget that can be created.
|
|
33 |
|
|
34 |
Home screen widgets are located in widget providers. Each provider
|
|
35 |
exposes its contained widgets as widget tokens. A token has all
|
|
36 |
the needed information for widget selection and creation.
|
|
37 |
*/
|
|
38 |
class HsWidgetToken
|
|
39 |
{
|
|
40 |
|
|
41 |
public:
|
|
42 |
|
|
43 |
/*!
|
|
44 |
The name of the library/plugin that contains the widget.
|
|
45 |
*/
|
|
46 |
QString mLibrary;
|
|
47 |
|
|
48 |
/*!
|
|
49 |
Uniquely identifies the widget.
|
|
50 |
*/
|
|
51 |
QString mUri;
|
|
52 |
|
|
53 |
/*!
|
|
54 |
Human readable title for GUI purposes.
|
|
55 |
*/
|
|
56 |
QString mTitle;
|
|
57 |
|
|
58 |
/*!
|
|
59 |
Identifies widget's icon if it has one.
|
|
60 |
*/
|
|
61 |
QString mIconUri;
|
|
62 |
|
|
63 |
/*!
|
|
64 |
The description of the widget.
|
|
65 |
*/
|
|
66 |
QString mDescription;
|
|
67 |
|
|
68 |
/*!
|
|
69 |
User data
|
|
70 |
*/
|
|
71 |
QVariant mUserData;
|
|
72 |
|
|
73 |
/*!
|
|
74 |
Uid of the widget
|
|
75 |
*/
|
|
76 |
int mUid;
|
|
77 |
/*!
|
|
78 |
HsWidget preferences.
|
|
79 |
*/
|
|
80 |
QMap<QString,QString> mPreferences;
|
|
81 |
};
|
|
82 |
|
|
83 |
class HsWidget;
|
|
84 |
|
98
|
85 |
/*DEPRECATED
|
85
|
86 |
\class IHsWidgetProvider
|
|
87 |
\ingroup group_hswidgetmodel group_widget_api_candidates
|
|
88 |
\brief Defines a mechanism for retrieving a home screen widget.
|
|
89 |
|
|
90 |
Interface that defines a mechanism for retrieving a home screen
|
|
91 |
widget. Each home screen widget provider implements this interface.
|
|
92 |
*/
|
|
93 |
class IHsWidgetProvider
|
|
94 |
{
|
|
95 |
|
|
96 |
public:
|
|
97 |
|
|
98 |
/*!
|
|
99 |
Destructor.
|
|
100 |
*/
|
|
101 |
virtual ~IHsWidgetProvider() {}
|
|
102 |
|
|
103 |
public:
|
|
104 |
|
|
105 |
/*!
|
|
106 |
Returns contained widgets as a list of widget tokens.
|
|
107 |
*/
|
|
108 |
virtual QList<HsWidgetToken> widgets() = 0;
|
|
109 |
|
|
110 |
/*!
|
|
111 |
Creates and returns a widget based on the given \a token.
|
|
112 |
*/
|
|
113 |
virtual HsWidget *createWidget(const HsWidgetToken &token) = 0;
|
|
114 |
|
|
115 |
};
|
|
116 |
|
|
117 |
Q_DECLARE_METATYPE(HsWidgetToken)
|
|
118 |
Q_DECLARE_INTERFACE(IHsWidgetProvider, "com.nokia.homescreen.iwidgetprovider/1.0")
|
|
119 |
|
|
120 |
#endif
|