1 | /* $Id: UINetworkCustomer.h 78665 2019-05-22 15:27:01Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UINetworkCustomer class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef FEQT_INCLUDED_SRC_net_UINetworkCustomer_h
|
---|
19 | #define FEQT_INCLUDED_SRC_net_UINetworkCustomer_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* Qt includes: */
|
---|
25 | #include <QObject>
|
---|
26 |
|
---|
27 | /* GUI includes: */
|
---|
28 | #include "UILibraryDefs.h"
|
---|
29 | #include "UINetworkDefs.h"
|
---|
30 |
|
---|
31 | /* Forward declarations: */
|
---|
32 | class UINetworkReply;
|
---|
33 | class QUrl;
|
---|
34 |
|
---|
35 | /** Interface to access UINetworkManager protected functionality. */
|
---|
36 | class SHARED_LIBRARY_STUFF UINetworkCustomer : public QObject
|
---|
37 | {
|
---|
38 | Q_OBJECT;
|
---|
39 |
|
---|
40 | public:
|
---|
41 |
|
---|
42 | /** Constructs network customer passing @a pParent to the base-class.
|
---|
43 | * @param fForceCall Brings whether this customer has forced privelegies. */
|
---|
44 | UINetworkCustomer(QObject *pParent = 0, bool fForceCall = true);
|
---|
45 |
|
---|
46 | /** Returns whether this customer has forced privelegies. */
|
---|
47 | bool isItForceCall() const { return m_fForceCall; }
|
---|
48 |
|
---|
49 | /** Handles network reply progress for @a iReceived amount of bytes among @a iTotal. */
|
---|
50 | virtual void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal) = 0;
|
---|
51 | /** Handles network reply canceling for a passed @a pReply. */
|
---|
52 | virtual void processNetworkReplyCanceled(UINetworkReply *pReply) = 0;
|
---|
53 | /** Handles network reply finishing for a passed @a pReply. */
|
---|
54 | virtual void processNetworkReplyFinished(UINetworkReply *pReply) = 0;
|
---|
55 |
|
---|
56 | /** Returns description of the current network operation. */
|
---|
57 | virtual const QString description() const { return QString(); }
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | /** Creates network-request of the passed @a type on the basis of the passed @a urls, @a strTarget and the @a requestHeaders. */
|
---|
62 | void createNetworkRequest(UINetworkRequestType enmType, const QList<QUrl> urls, const QString &strTarget = QString(),
|
---|
63 | const UserDictionary requestHeaders = UserDictionary());
|
---|
64 |
|
---|
65 | private:
|
---|
66 |
|
---|
67 | /** Holds whether this customer has forced privelegies. */
|
---|
68 | bool m_fForceCall;
|
---|
69 | };
|
---|
70 |
|
---|
71 | #endif /* !FEQT_INCLUDED_SRC_net_UINetworkCustomer_h */
|
---|
72 |
|
---|