KIO

kprotocolmanager.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999 Torben Weis <[email protected]>
4  SPDX-FileCopyrightText: 2000 Waldo Bastain <[email protected]>
5  SPDX-FileCopyrightText: 2000 Dawit Alemayehu <[email protected]>
6  SPDX-FileCopyrightText: 2008 JarosÅ‚aw Staniek <[email protected]>
7 
8  SPDX-License-Identifier: LGPL-2.0-only
9 */
10 
11 #ifndef KPROTOCOLMANAGER_H
12 #define KPROTOCOLMANAGER_H
13 
14 #include <QStringList>
15 
16 #include "kio/global.h" // KIO::CacheControl
17 #include "kiocore_export.h"
18 #include "kprotocolinfo.h"
19 
20 class KSharedConfig;
21 template<class T>
24 namespace KIO
25 {
26 class SlaveConfigPrivate;
27 } // namespace KIO
28 
52 class KIOCORE_EXPORT KProtocolManager
53 {
54 public:
55 
56  /*=========================== USER-AGENT SETTINGS ===========================*/
57 
63  static QString defaultUserAgent();
64 
77  static QString defaultUserAgent(const QString &keys);
78 
93  static QString userAgentForApplication(const QString &appName, const QString &appVersion,
94  const QStringList &extraInfo = QStringList());
95 
107  static QString userAgentForHost(const QString &hostname);
108 
121  static bool getSystemNameVersionAndMachine(
122  QString &systemName, QString &systemVersion, QString &machine);
123 
124  /*=========================== TIMEOUT CONFIG ================================*/
125 
132  static int readTimeout();
133 
140  static int connectTimeout();
141 
148  static int proxyConnectTimeout();
149 
156  static int responseTimeout();
157 
158  /*=============================== PROXY CONFIG ==============================*/
159 
165  static bool useProxy();
166 
172  static bool useReverseProxy();
173 
182  enum ProxyType {
183  NoProxy,
184  ManualProxy,
185  PACProxy,
186  WPADProxy,
187  EnvVarProxy
188  };
189 
194  static ProxyType proxyType();
195 
203  Prompt,
204  Automatic
205  };
206 
213  static ProxyAuthMode proxyAuthMode();
214 
221  static QString noProxyFor();
222 
231  static QString proxyFor(const QString &protocol);
232 
247  static QString proxyForUrl(const QUrl &url);
248 
265  static QStringList proxiesForUrl(const QUrl &url);
266 
272  static void badProxy(const QString &proxy);
273 
278  static QString proxyConfigScript();
279 
280  /*========================== CACHE CONFIG ===================================*/
281 
288  static bool useCache();
289 
296  static int maxCacheAge();
297 
308  static int maxCacheSize(); // Maximum cache size in Kb.
309 
314  static QString cacheDir();
315 
320  static KIO::CacheControl cacheControl();
321 
322  /*============================ DOWNLOAD CONFIG ==============================*/
323 
329  static bool autoResume();
330 
336  static bool markPartial();
337 
348  static int minimumKeepSize();
349 
350  /*============================ NETWORK CONNECTIONS ==========================*/
355  static bool persistentProxyConnection();
356 
361  static bool persistentConnections();
362 
363  /*===================== PROTOCOL CAPABILITIES ===============================*/
364 
380  static bool supportsListing(const QUrl &url);
381 
391  static bool supportsReading(const QUrl &url);
392 
402  static bool supportsWriting(const QUrl &url);
403 
413  static bool supportsMakeDir(const QUrl &url);
414 
424  static bool supportsDeleting(const QUrl &url);
425 
435  static bool supportsLinking(const QUrl &url);
436 
447  static bool supportsMoving(const QUrl &url);
448 
458  static bool supportsOpening(const QUrl &url);
459 
470  static bool supportsTruncating(const QUrl &url);
471 
484  static bool canCopyFromFile(const QUrl &url);
485 
498  static bool canCopyToFile(const QUrl &url);
499 
512  static bool canRenameFromFile(const QUrl &url);
513 
526  static bool canRenameToFile(const QUrl &url);
527 
539  static bool canDeleteRecursive(const QUrl &url);
540 
556  static KProtocolInfo::FileNameUsedForCopying fileNameUsedForCopying(const QUrl &url);
557 
566  static QString defaultMimetype(const QUrl &url);
567 
578  static KProtocolInfo::Type inputType(const QUrl &url);
579 
590  static KProtocolInfo::Type outputType(const QUrl &url);
591 
604  static QStringList listing(const QUrl &url);
605 
619  static bool isSourceProtocol(const QUrl &url);
620 
632  static QString protocolForArchiveMimetype(const QString &mimeType);
633 
634  /*=============================== OTHERS ====================================*/
635 
640  static void reparseConfiguration();
641 
652  static QString slaveProtocol(const QUrl &url, QString &proxy);
653 
659  static QString slaveProtocol(const QUrl &url, QStringList &proxy);
660 
666  static QString acceptLanguagesHeader();
667 
673  static QString charsetFor(const QUrl &url);
674 
675 private:
676  friend class KIO::SlaveConfigPrivate;
677 
682  KIOCORE_NO_EXPORT static QMap<QString, QString> entryMap(const QString &group);
683 };
684 #endif
ProxyAuthMode
Proxy authorization modes.
ProxyType
Types of proxy configuration.
A namespace for KIO globals.
Definition: authinfo.h:21
Provides information about I/O (Internet, etc.) settings chosen/set by the end user.
CacheControl
Specifies how to use the cache.
Definition: global.h:286
Type
Describes the type of a protocol.
Definition: kprotocolinfo.h:81
QCA_EXPORT QString appName()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 23:01:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.