|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbCore module of the UI Extensions for Mobile. |
|
8 ** |
|
9 ** GNU Lesser General Public License Usage |
|
10 ** This file may be used under the terms of the GNU Lesser General Public |
|
11 ** License version 2.1 as published by the Free Software Foundation and |
|
12 ** appearing in the file LICENSE.LGPL included in the packaging of this file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** Public License version 2.1 requirements will be met: |
|
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
16 ** |
|
17 ** In addition, as a special exception, Nokia gives you certain additional |
|
18 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
20 ** |
|
21 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 |
|
26 #ifndef HBDEVICEDIALOGSERVER_P_H |
|
27 #define HBDEVICEDIALOGSERVER_P_H |
|
28 |
|
29 #include <hbglobal.h> |
|
30 |
|
31 #include <QVariantMap> |
|
32 #include <QObject> |
|
33 #include <QtGlobal> |
|
34 |
|
35 #include "hbindicatorclientinfo_p.h" |
|
36 |
|
37 class HbMainWindow; |
|
38 class HbDeviceDialogServerPrivate; |
|
39 class HbDeviceDialogManager; |
|
40 #if defined(Q_OS_SYMBIAN) |
|
41 class RMessage2; |
|
42 #endif // Q_OS_SYMBIAN |
|
43 |
|
44 class HB_CORE_PRIVATE_EXPORT HbDeviceDialogServer: public QObject |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 |
|
50 #if defined(Q_OS_SYMBIAN) |
|
51 typedef RMessage2 ClientCredentials; |
|
52 #else // Q_OS_SYMBIAN |
|
53 typedef int ClientCredentials; // not used |
|
54 #endif // Q_OS_SYMBIAN |
|
55 |
|
56 struct Parameters { |
|
57 const QString &mType; // in |
|
58 const ClientCredentials &mClientCredentials; // in |
|
59 Parameters(const QString &type, const ClientCredentials &cred) : |
|
60 mType(type), mClientCredentials(cred){} |
|
61 }; |
|
62 struct DialogParameters : public Parameters { |
|
63 const QVariantMap &mData; // in |
|
64 quintptr mClientTag; // in |
|
65 int mError; // out |
|
66 DialogParameters(const QString &type, const ClientCredentials &cred, |
|
67 const QVariantMap &data, quintptr clientTag) : |
|
68 Parameters(type, cred), mData(data), mClientTag(clientTag), mError(0){} |
|
69 }; |
|
70 struct IndicatorParameters : public Parameters { |
|
71 const QVariant &mData; // in |
|
72 IndicatorParameters(const QString &type, const ClientCredentials &cred, |
|
73 const QVariant &data) : Parameters(type, cred), mData(data){} |
|
74 }; |
|
75 |
|
76 public: |
|
77 HbDeviceDialogServer(); |
|
78 virtual ~HbDeviceDialogServer(); |
|
79 |
|
80 void setMainWindow(HbMainWindow *mainWindow); |
|
81 int showDeviceDialog(DialogParameters ¶meters); |
|
82 int updateDeviceDialog(int identifier, const QVariantMap &data); |
|
83 int closeDeviceDialog(int identifier); |
|
84 void deviceDialogClientClosing(quintptr sessionTag); |
|
85 int activateIndicator(IndicatorParameters ¶meters); |
|
86 int deactivateIndicator(IndicatorParameters ¶meters); |
|
87 QList<IndicatorClientInfo> indicatorClientInfoList() const; |
|
88 |
|
89 public slots: |
|
90 void deviceDialogUpdate(int identifier, const QVariantMap &data) const; |
|
91 void deviceDialogClosed(int identifier, int closeReason); |
|
92 void indicatorActivated(const QList<IndicatorClientInfo> &indicatorInfoList); |
|
93 void indicatorUpdated(const QList<IndicatorClientInfo> &indicatorInfoList); |
|
94 void indicatorRemoved(const QList<IndicatorClientInfo> &indicatorInfoList); |
|
95 |
|
96 private: |
|
97 HbDeviceDialogManager *iManager; |
|
98 HbDeviceDialogServerPrivate *d_ptr; |
|
99 Q_DECLARE_PRIVATE_D( d_ptr, HbDeviceDialogServer ) |
|
100 |
|
101 }; |
|
102 |
|
103 #endif // HBDEVICEDIALOGSERVER_P_H |