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 |
/**
|
73
|
45 |
* HbFotaFullscreenDialog
|
51
|
46 |
*
|
|
47 |
*/
|
73
|
48 |
class HbFotaFullscreenDialog : public QObject
|
51
|
49 |
{
|
|
50 |
Q_OBJECT
|
|
51 |
|
|
52 |
public:
|
|
53 |
|
73
|
54 |
/**
|
|
55 |
* Constructor to construct the fullscreen dialog.
|
|
56 |
* @param aObserver - Observer to notify the user inputs from the fullscreen dialog
|
|
57 |
* @return void
|
|
58 |
*/
|
|
59 |
HbFotaFullscreenDialog(CFotaServer* aObserver);
|
51
|
60 |
|
73
|
61 |
|
|
62 |
/**
|
|
63 |
* Destructor for the full screen dialog
|
|
64 |
* @return void
|
|
65 |
*/
|
|
66 |
~HbFotaFullscreenDialog();
|
51
|
67 |
|
|
68 |
/**
|
|
69 |
* This function updates the details of the update to the fullscreen dialog.
|
|
70 |
* @param size - The total size of the update package.
|
|
71 |
* @param version - The version of the soeftware that is being updated.
|
|
72 |
* @param aName - the package name of the current update.
|
|
73 |
* @return void
|
|
74 |
*/
|
73
|
75 |
void setSoftwareDetails(int size, const QString version,
|
51
|
76 |
const QString aName);
|
|
77 |
|
|
78 |
/**
|
|
79 |
* This function updates the download progress bar to the progress value passed.
|
|
80 |
* @param aType - the state in which the firmware update is in(downloading or donwload complete)
|
|
81 |
* @return void
|
|
82 |
*/
|
73
|
83 |
void setWarningDetails(TFotaWarningType aType);
|
51
|
84 |
|
|
85 |
/**
|
|
86 |
* This function updates the download progress bar to the progress value passed.
|
|
87 |
* @param aProgress - the progress value to be update to the progress bar.
|
|
88 |
* @return void
|
|
89 |
*/
|
73
|
90 |
void updateProgressBar(TInt aProgress);
|
51
|
91 |
|
|
92 |
/**
|
|
93 |
* Used to change the warnings and softkeys required for the update dialog
|
|
94 |
* @param void
|
|
95 |
* @return void
|
|
96 |
*/
|
73
|
97 |
void showUpdateDialog();
|
51
|
98 |
|
|
99 |
/**
|
|
100 |
* Used to refresh the dialog when the content of the dialog content changes.
|
|
101 |
* @param void
|
|
102 |
* @return void
|
|
103 |
*/
|
73
|
104 |
void close();
|
51
|
105 |
|
|
106 |
/**
|
|
107 |
* Used to disable the RSK of the dialog when resume dialogs
|
|
108 |
* @param aVal - to enable or disable the key
|
|
109 |
* @return void
|
|
110 |
*/
|
73
|
111 |
void disableRSK(TBool aVal);
|
51
|
112 |
|
73
|
113 |
/**
|
|
114 |
* Used to determine if the LSK of the dialog is enabled or not.
|
|
115 |
* @return bool: returns if LSK id enabled or disabled.
|
|
116 |
*/
|
|
117 |
bool isLSKEnabled();
|
51
|
118 |
|
73
|
119 |
/**
|
|
120 |
* Used to set the fullscreen dialog visible
|
|
121 |
* @param aVisible - To set the visibility to true/false.
|
|
122 |
* @return void
|
|
123 |
*/
|
|
124 |
void setVisible(TBool aVisible);
|
51
|
125 |
|
|
126 |
private:
|
|
127 |
|
|
128 |
/**
|
|
129 |
* Used to refresh the dialog when the content of the dialog changes.
|
|
130 |
* @param void
|
|
131 |
* @return void
|
|
132 |
*/
|
73
|
133 |
void refreshDialog();
|
51
|
134 |
|
|
135 |
public slots:
|
|
136 |
|
|
137 |
/**
|
|
138 |
* Slot to be called when user selects the Left soft key.
|
|
139 |
* @param void
|
|
140 |
* @return void
|
|
141 |
*/
|
73
|
142 |
void lSKSelected();
|
51
|
143 |
|
|
144 |
/**
|
|
145 |
* Slot to be called when user selects the Right soft key.
|
|
146 |
* @param void
|
|
147 |
* @return void
|
|
148 |
*/
|
73
|
149 |
void rSKSelected();
|
51
|
150 |
|
|
151 |
/**
|
|
152 |
* Slot to be called when the dialog is about to get closed.
|
|
153 |
* @param void
|
|
154 |
* @return void
|
|
155 |
*/
|
|
156 |
void aboutToClose();
|
|
157 |
|
|
158 |
private:
|
|
159 |
|
|
160 |
// dialog instance
|
73
|
161 |
HbDialog * m_dialog;
|
51
|
162 |
|
|
163 |
//document loader to load the widgets
|
73
|
164 |
HbDocumentLoader m_loader;
|
51
|
165 |
|
|
166 |
//progress bar for updating download progress
|
73
|
167 |
HbProgressBar * m_progressBar;
|
51
|
168 |
|
|
169 |
// Fota server instance to send the keypress event
|
73
|
170 |
CFotaServer* m_Server;
|
51
|
171 |
|
|
172 |
// LSK of the dialog
|
73
|
173 |
HbPushButton * m_PrimaryAction;
|
51
|
174 |
|
|
175 |
// RSK of the dialog
|
73
|
176 |
HbPushButton * m_SecondaryAction;
|
51
|
177 |
|
|
178 |
// Flag to differentiate from keypress and dialog timeout case.
|
73
|
179 |
TBool m_Clicked;
|
51
|
180 |
|
|
181 |
// Warning note displayed in the full screen dialog
|
73
|
182 |
HbLabel *m_InstallNote;
|
51
|
183 |
|
|
184 |
// Warning note displayed in the full screen dialog
|
73
|
185 |
HbLabel *m_RestartNote;
|
51
|
186 |
|
|
187 |
// Warning note displayed in the full screen dialog
|
73
|
188 |
HbLabel *m_RestartIcon;
|
51
|
189 |
|
|
190 |
// Warning note displayed in the full screen dialog
|
73
|
191 |
HbLabel *m_EmergencyNote;
|
51
|
192 |
|
|
193 |
// Warning note displayed in the full screen dialog
|
73
|
194 |
HbLabel *m_EmergencyIcon;
|
51
|
195 |
|
|
196 |
// Warning note displayed in the full screen dialog
|
73
|
197 |
HbLabel *m_ChargerNote;
|
51
|
198 |
|
73
|
199 |
// Variable which holds the charger icon from the docml.
|
|
200 |
HbLabel *m_ChargerIcon;
|
51
|
201 |
|
|
202 |
// To display the state of the download above progress bar
|
73
|
203 |
HbLabel *m_DownloadState;
|
51
|
204 |
|
|
205 |
// Fullscreen dialog title.
|
73
|
206 |
HbLabel *m_Title;
|
51
|
207 |
// Firmware details that is to be shwon in full screen dialog.
|
73
|
208 |
HbLabel *m_SwDetails;
|
51
|
209 |
};
|
|
210 |
|
|
211 |
#endif // CLASSNAME_H
|