LeechCraft 0.6.70-17335-ge406ffdcaf
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
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
16class QQmlEngine;
17
18namespace 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
72 QNetworkAccessManager* create (QObject *parent) override;
73 };
74}
StandardNAMFactory(QString subpath, CacheSizeGetter_f getter, QQmlEngine *engine=nullptr)
Constructs a new StandardNAMFactory.
QNetworkAccessManager * create(QObject *parent) override
Creates the network access manager with the given parent.
std::function< int()> CacheSizeGetter_f
The type of the function used to query the cache size by the factory.
#define UTIL_QML_API
Definition qmlconfig.h:16