51
|
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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef FOTAFULLSCREENDIALOG_H
|
|
19 |
#define FOTAFULLSCREENDIALOG_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
|
|
23 |
#include <QWidget>
|
|
24 |
#include <QtGui/QWidget>
|
|
25 |
#include <QtGui>
|
|
26 |
#include <hbdialog.h>
|
|
27 |
#include <hbdocumentloader.h>
|
|
28 |
#include <hbprogressbar.h>
|
|
29 |
#include <hbdataform.h>
|
|
30 |
#include <hbdataformmodel.h>
|
|
31 |
#include <hbpushbutton.h>
|
|
32 |
#include <hblabel.h>
|
|
33 |
|
|
34 |
#include "FotaDlClient.h"
|
|
35 |
#include "FotaServer.h"
|
|
36 |
|
|
37 |
enum TFotaWarningType
|
|
38 |
{
|
|
39 |
EHbFotaDownload = 1, EHbFotaUpdate, EHbFotaLowBattery
|
|
40 |
};
|
|
41 |
|
|
42 |
// CLASS DECLARATION
|
|
43 |
|
|
44 |
/**
|
|
45 |
* FotaFullscreenDialog
|
|
46 |
*
|
|
47 |
*/
|
|
48 |
class FotaFullscreenDialog : public QObject
|
|
49 |
{
|
|
50 |
Q_OBJECT
|
|
51 |
|
|
52 |
public:
|
|
53 |
|
|
54 |
FotaFullscreenDialog(CFotaServer* aObserver);
|
|
55 |
|
|
56 |
~FotaFullscreenDialog();
|
|
57 |
|
|
58 |
/**
|
|
59 |
* This function updates the details of the update to the fullscreen dialog.
|
|
60 |
* @param size - The total size of the update package.
|
|
61 |
* @param version - The version of the soeftware that is being updated.
|
|
62 |
* @param aName - the package name of the current update.
|
|
63 |
* @return void
|
|
64 |
*/
|
|
65 |
void SetSoftwareDetails(int size, const QString version,
|
|
66 |
const QString aName);
|
|
67 |
|
|
68 |
/**
|
|
69 |
* This function updates the download progress bar to the progress value passed.
|
|
70 |
* @param aType - the state in which the firmware update is in(downloading or donwload complete)
|
|
71 |
* @return void
|
|
72 |
*/
|
|
73 |
void SetWarningDetails(TFotaWarningType aType);
|
|
74 |
|
|
75 |
/**
|
|
76 |
* This function updates the download progress bar to the progress value passed.
|
|
77 |
* @param aProgress - the progress value to be update to the progress bar.
|
|
78 |
* @return void
|
|
79 |
*/
|
|
80 |
void UpdateProgressBar(TInt aProgress);
|
|
81 |
|
|
82 |
/**
|
|
83 |
* Used to change the warnings and softkeys required for the update dialog
|
|
84 |
* @param void
|
|
85 |
* @return void
|
|
86 |
*/
|
|
87 |
void ShowUpdateDialog();
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Used to refresh the dialog when the content of the dialog content changes.
|
|
91 |
* @param void
|
|
92 |
* @return void
|
|
93 |
*/
|
|
94 |
void Close();
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Used to disable the RSK of the dialog when resume dialogs
|
|
98 |
* @param aVal - to enable or disable the key
|
|
99 |
* @return void
|
|
100 |
*/
|
|
101 |
void DisableRSK(TBool aVal);
|
|
102 |
|
|
103 |
bool IsLSKEnabled();
|
|
104 |
|
|
105 |
void SetVisible(TBool aVisible);
|
|
106 |
|
|
107 |
private:
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Used to refresh the dialog when the content of the dialog changes.
|
|
111 |
* @param void
|
|
112 |
* @return void
|
|
113 |
*/
|
|
114 |
void RefreshDialog();
|
|
115 |
|
|
116 |
public slots:
|
|
117 |
|
|
118 |
/**
|
|
119 |
* Slot to be called when user selects the Left soft key.
|
|
120 |
* @param void
|
|
121 |
* @return void
|
|
122 |
*/
|
|
123 |
void LSKSelected();
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Slot to be called when user selects the Right soft key.
|
|
127 |
* @param void
|
|
128 |
* @return void
|
|
129 |
*/
|
|
130 |
void RSKSelected();
|
|
131 |
|
|
132 |
/**
|
|
133 |
* Slot to be called when the dialog is about to get closed.
|
|
134 |
* @param void
|
|
135 |
* @return void
|
|
136 |
*/
|
|
137 |
void aboutToClose();
|
|
138 |
|
|
139 |
private:
|
|
140 |
|
|
141 |
// dialog instance
|
|
142 |
HbDialog * idialog;
|
|
143 |
|
|
144 |
//document loader to load the widgets
|
|
145 |
HbDocumentLoader iloader;
|
|
146 |
|
|
147 |
//progress bar for updating download progress
|
|
148 |
HbProgressBar * iprogressBar;
|
|
149 |
|
|
150 |
// Fota server instance to send the keypress event
|
|
151 |
CFotaServer* iServer;
|
|
152 |
|
|
153 |
// LSK of the dialog
|
|
154 |
HbPushButton * iPrimaryAction;
|
|
155 |
|
|
156 |
// RSK of the dialog
|
|
157 |
HbPushButton * iSecondaryAction;
|
|
158 |
|
|
159 |
// Flag to differentiate from keypress and dialog timeout case.
|
|
160 |
TBool iClicked;
|
|
161 |
|
|
162 |
// Warning note displayed in the full screen dialog
|
|
163 |
HbLabel *iInstallNote;
|
|
164 |
|
|
165 |
// Warning note displayed in the full screen dialog
|
|
166 |
HbLabel *iRestartNote;
|
|
167 |
|
|
168 |
// Warning note displayed in the full screen dialog
|
|
169 |
HbLabel *iRestartIcon;
|
|
170 |
|
|
171 |
// Warning note displayed in the full screen dialog
|
|
172 |
HbLabel *iEmergencyNote;
|
|
173 |
|
|
174 |
// Warning note displayed in the full screen dialog
|
|
175 |
HbLabel *iEmergencyIcon;
|
|
176 |
|
|
177 |
// Warning note displayed in the full screen dialog
|
|
178 |
HbLabel *iChargerNote;
|
|
179 |
|
|
180 |
HbLabel *iChargerIcon;
|
|
181 |
|
|
182 |
// To display the state of the download above progress bar
|
|
183 |
HbLabel *iDownloadState;
|
|
184 |
|
|
185 |
// Fullscreen dialog title.
|
|
186 |
HbLabel *iTitle;
|
|
187 |
// Firmware details that is to be shwon in full screen dialog.
|
|
188 |
HbLabel *iSwDetails;
|
|
189 |
};
|
|
190 |
|
|
191 |
#endif // CLASSNAME_H
|