LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
standardnamfactory.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2014 Georg Rudoy
4  *
5  * Distributed under the Boost Software License, Version 1.0.
6  * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7  **********************************************************************/
8 
9 #pragma once
10 
11 #include <functional>
12 #include <QtGlobal>
13 #include <QQmlNetworkAccessManagerFactory>
14 #include "qmlconfig.h"
15 
16 class QQmlEngine;
17 
18 namespace LC::Util
19 {
35  class UTIL_QML_API StandardNAMFactory : public QQmlNetworkAccessManagerFactory
36  {
37  const QString Subpath_;
38  public:
42  using CacheSizeGetter_f = std::function<int ()>;
43  private:
44  CacheSizeGetter_f CacheSizeGetter_;
45  public:
58  StandardNAMFactory (QString subpath,
59  CacheSizeGetter_f getter,
60  QQmlEngine *engine = nullptr);
61 
76  QNetworkAccessManager* create (QObject *parent) override;
77  };
78 }
LC::Util
Definition: icoreproxy.h:33
qmlconfig.h
LC::Util::StandardNAMFactory
A standard QML QNetworkAccessManager factory.
Definition: standardnamfactory.h:35
UTIL_QML_API
#define UTIL_QML_API
Definition: qmlconfig.h:16
LC::Util::StandardNAMFactory::CacheSizeGetter_f
std::function< int()> CacheSizeGetter_f
The type of the function used to query the cache size by the factory.
Definition: standardnamfactory.h:42