|
1 /* |
|
2 * Copyright (c) 2010 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: Device dialog plugin for SIF UI dialogs. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef SIFUIDIALOG_H |
|
19 #define SIFUIDIALOG_H |
|
20 |
|
21 #include <hbdialog.h> // HbDialog |
|
22 #include <hbdevicedialoginterface.h> // HbDeviceDialogInterface |
|
23 #include "sifuidialogdefinitions.h" // enum SifUiDeviceDialogType |
|
24 #include <qmobilityglobal.h> // QTM namespace macros |
|
25 |
|
26 class HbTranslator; |
|
27 class SifUiDialogTitleWidget; |
|
28 class SifUiDialogContentWidget; |
|
29 class HbIndicator; |
|
30 |
|
31 QTM_BEGIN_NAMESPACE |
|
32 class QValueSpaceSubscriber; |
|
33 QTM_END_NAMESPACE |
|
34 |
|
35 |
|
36 /** |
|
37 * SW Install notification widget class. |
|
38 */ |
|
39 class SifUiDialog : public HbDialog, public HbDeviceDialogInterface |
|
40 { |
|
41 Q_OBJECT |
|
42 |
|
43 public: // constructor and destructor |
|
44 SifUiDialog(const QVariantMap ¶meters); |
|
45 virtual ~SifUiDialog(); |
|
46 |
|
47 public: // new functions |
|
48 static SifUiDeviceDialogType dialogType(const QVariantMap ¶meters); |
|
49 |
|
50 public: // from HbDeviceDialogInterface |
|
51 bool setDeviceDialogParameters(const QVariantMap ¶meters); |
|
52 int deviceDialogError() const; |
|
53 void closeDeviceDialog(bool byClient); |
|
54 HbDialog *deviceDialogWidget() const; |
|
55 |
|
56 signals: |
|
57 void deviceDialogClosed(); |
|
58 void deviceDialogData(const QVariantMap &data); |
|
59 |
|
60 protected: // from HbPopup (via HbDialog) |
|
61 void hideEvent(QHideEvent *event); |
|
62 void showEvent(QShowEvent *event); |
|
63 |
|
64 private: // new functions |
|
65 bool isInstallIndicatorActive(); |
|
66 bool constructDialog(const QVariantMap ¶meters); |
|
67 bool updateFromParameters(const QVariantMap ¶meters); |
|
68 void updateButtons(const QVariantMap ¶meters); |
|
69 void prepareForErrorDetails(const QVariantMap ¶meters); |
|
70 bool displayAdditionalQuery(const QVariantMap ¶meters); |
|
71 bool displayGrantCapabilitiesQuery(const QVariantMap ¶meters); |
|
72 bool displaySelectLanguageQuery(const QVariantMap ¶meters); |
|
73 bool displaySelectOptionsQuery(const QVariantMap ¶meters); |
|
74 void sendResult(SifUiDeviceDialogReturnValue value); |
|
75 |
|
76 private slots: |
|
77 void handleInstallAccepted(); |
|
78 void handleInstallCancelled(); |
|
79 void handleMemorySelectionChanged(const QChar &driveLetter); |
|
80 void handleHidePressed(); |
|
81 void handleShowInstalled(); |
|
82 void handleErrorDetails(); |
|
83 void handleCapabilitiesGranted(); |
|
84 void handleAdditionalDialogClosed(); |
|
85 void handleLanguageSelected(int index); |
|
86 void handleOptionsDialogClosed(int code); |
|
87 |
|
88 private: |
|
89 Q_DISABLE_COPY(SifUiDialog) |
|
90 |
|
91 HbTranslator *mCommonTranslator; |
|
92 HbTranslator *mSifUITranslator; |
|
93 int mLastDialogError; |
|
94 bool mShowEventReceived; |
|
95 SifUiDeviceDialogType mDialogType; |
|
96 SifUiDialogTitleWidget *mTitle; |
|
97 SifUiDialogContentWidget *mContent; |
|
98 QString mErrorDetails; |
|
99 int mErrorCode; |
|
100 int mExtendedErrorCode; |
|
101 HbAction *mPrimaryAction; |
|
102 HbAction *mSecondaryAction; |
|
103 QVariantMap mResultMap; |
|
104 HbIndicator *mIndicator; |
|
105 |
|
106 QTM_PREPEND_NAMESPACE(QValueSpaceSubscriber) *mSubscriber; |
|
107 }; |
|
108 |
|
109 #endif // SIFUIDIALOG_H |