VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/VBoxDownloaderWgt.h@ 4054

Last change on this file since 4054 was 4054, checked in by vboxsync, 17 years ago

Export to OSE.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 3.5 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VBoxDownloaderWgt class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2007 innotek GmbH
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License as published by the Free Software Foundation,
14 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 * distribution. VirtualBox OSE is distributed in the hope that it will
16 * be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * If you received this file as part of a commercial VirtualBox
19 * distribution, then only the terms of your commercial VirtualBox
20 * license agreement apply instead of the previous paragraph.
21 */
22
23#ifndef __VBoxDownloaderWgt_h__
24#define __VBoxDownloaderWgt_h__
25
26#include "qwidget.h"
27#include "qurl.h"
28class QStatusBar;
29class QAction;
30class QHttpResponseHeader;
31class QHttp;
32class QProgressBar;
33class QToolButton;
34
35/** class VBoxDownloaderWgt
36 *
37 * The VBoxDownloaderWgt class is an QWidget class for Guest Additions
38 * http backgroung downloading. This class is also used to display the
39 * Guest Additions download state through the progress dialog integrated
40 * into the VM console status bar.
41 */
42class VBoxDownloaderWgt : public QWidget
43{
44 Q_OBJECT
45
46public:
47
48 VBoxDownloaderWgt (QStatusBar *aStatusBar, QAction *aAction,
49 const QString &aUrl, const QString &aTarget);
50
51 void languageChange();
52
53private slots:
54
55 /* This slot is used to handle the progress of the file-downloading
56 * procedure. It also checks the downloading status for the file
57 * presence verifying purposes. */
58 void processProgress (int aRead, int aTotal);
59
60 /* This slot is used to handle the finish signal of every operation's
61 * response. It is used to display the errors occurred during the download
62 * operation and for the received-buffer serialization procedure. */
63 void processFinished (int, bool aError);
64
65 /* This slot is used to handle the header responses about the
66 * requested operations. Watches for the header's status-code. */
67 void processResponse (const QHttpResponseHeader &aHeader);
68
69 /* This slot is used to control the connection timeout. */
70 void processTimeout();
71
72 /* This slot is used to process cancel-button clicking signal. */
73 void processAbort();
74
75 /* This slot is used to terminate the downloader, activate the
76 * Install Guest Additions action and removing the downloader's
77 * sub-widgets from the VM Console status-bar. */
78 void suicide();
79
80private:
81
82 /* This function is used to make a request to get a file */
83 void getFile();
84
85 /* This function is used to ask the user about he wants to download the
86 * founded Guest Additions image or not. It also shows the progress-bar
87 * and Cancel-button widgets. */
88 void processFile (int aSize);
89
90 /* This wrapper displays an error message box (unless @aReason is
91 * QString::null) with the cause of the download procedure
92 * termination. After the message box is dismissed, the downloader signals
93 * to close itself on the next event loop iteration. */
94 void abortDownload (const QString &aReason = QString::null);
95
96 QStatusBar *mStatusBar;
97 QUrl mUrl;
98 QString mTarget;
99 QHttp *mHttp;
100 bool mIsChecking;
101 QProgressBar *mProgressBar;
102 QToolButton *mCancelButton;
103 QAction *mAction;
104 int mStatus;
105 bool mConnectDone;
106 bool mSuicide;
107};
108
109#endif
110
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette