• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • kio
  • kio
kprotocolmanager.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1999 Torben Weis <weis@kde.org>
3 Copyright (C) 2000- Waldo Bastain <bastain@kde.org>
4 Copyright (C) 2000- Dawit Alemayehu <adawit@kde.org>
5 Copyright (C) 2008 Jarosław Staniek <staniek@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License version 2 as published by the Free Software Foundation.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21#ifndef KPROTOCOLMANAGER_H
22#define KPROTOCOLMANAGER_H
23
24#include <QtCore/QStringList>
25
26#include <kio/global.h>
27#include "kprotocolinfo.h"
28
29class KSharedConfig;
30template<class T>
31class KSharedPtr;
32typedef KSharedPtr<KSharedConfig> KSharedConfigPtr;
33namespace KIO
34{
35 class SlaveConfigPrivate;
36} // namespace KIO
37
59class KIO_EXPORT KProtocolManager
60{
61public:
62
63
64/*=========================== USER-AGENT SETTINGS ===========================*/
65
66
72 static QString defaultUserAgent();
73
86 static QString defaultUserAgent(const QString &keys);
87
102 static QString userAgentForApplication( const QString &appName, const QString& appVersion,
103 const QStringList& extraInfo = QStringList() );
104
116 static QString userAgentForHost( const QString &hostname );
117
118 /*
119 * Returns system name, version and machine type, for example "Windows", "5.1", "i686".
120 * This information can be used for constructing custom user-agent strings.
121 *
122 * @param systemName system name
123 * @param systemVersion system version
124 * @param machine machine type
125
126 * @return true if system name, version and machine type has been provided
127 *
128 * @since 4.1
129 */
130 static bool getSystemNameVersionAndMachine(
131 QString& systemName, QString& systemVersion, QString& machine );
132
133
134/*=========================== TIMEOUT CONFIG ================================*/
135
136
143 static int readTimeout();
144
151 static int connectTimeout();
152
159 static int proxyConnectTimeout();
160
167 static int responseTimeout();
168
169
170/*=============================== PROXY CONFIG ==============================*/
171
172
178 static bool useProxy();
179
185 static bool useReverseProxy();
186
195 enum ProxyType
196 {
197 NoProxy,
198 ManualProxy,
199 PACProxy,
200 WPADProxy,
201 EnvVarProxy
202 };
203
208 static ProxyType proxyType();
209
216 enum ProxyAuthMode
217 {
218 Prompt,
219 Automatic
220 };
221
228 static ProxyAuthMode proxyAuthMode();
229
236 static QString noProxyFor();
237
246 static QString proxyFor( const QString& protocol );
247
262 static QString proxyForUrl( const KUrl& url );
263
280 static QStringList proxiesForUrl( const KUrl& url );
281
287 static void badProxy( const QString & proxy );
288
293 static QString proxyConfigScript();
294
295
296/*========================== CACHE CONFIG ===================================*/
297
298
305 static bool useCache();
306
313 static int maxCacheAge();
314
325 static int maxCacheSize(); // Maximum cache size in Kb.
326
331 static QString cacheDir();
332
337 static KIO::CacheControl cacheControl();
338
339
340/*============================ DOWNLOAD CONFIG ==============================*/
341
347 static bool autoResume();
348
354 static bool markPartial();
355
366 static int minimumKeepSize();
367
368
369 /*============================ NETWORK CONNECTIONS ==========================*/
374 static bool persistentProxyConnection();
375
380 static bool persistentConnections();
381
382
383 /*===================== PROTOCOL CAPABILITIES ===============================*/
384
400 static bool supportsListing( const KUrl &url );
401
411 static bool supportsReading( const KUrl &url );
412
422 static bool supportsWriting( const KUrl &url );
423
433 static bool supportsMakeDir( const KUrl &url );
434
444 static bool supportsDeleting( const KUrl &url );
445
455 static bool supportsLinking( const KUrl &url );
456
467 static bool supportsMoving( const KUrl &url );
468
478 static bool supportsOpening( const KUrl &url );
479
492 static bool canCopyFromFile( const KUrl &url );
493
506 static bool canCopyToFile( const KUrl &url );
507
520 static bool canRenameFromFile( const KUrl &url );
521
534 static bool canRenameToFile( const KUrl &url );
535
547 static bool canDeleteRecursive( const KUrl &url );
548
564 static KProtocolInfo::FileNameUsedForCopying fileNameUsedForCopying( const KUrl &url );
565
574 static QString defaultMimetype( const KUrl& url );
575
586 static KProtocolInfo::Type inputType( const KUrl &url );
587
598 static KProtocolInfo::Type outputType( const KUrl &url );
599
612 static QStringList listing( const KUrl &url );
613
614
628 static bool isSourceProtocol( const KUrl &url );
629
641 static QString protocolForArchiveMimetype( const QString& mimeType );
642
643 /*=============================== OTHERS ====================================*/
644
645
650 static void reparseConfiguration();
651
662 static QString slaveProtocol(const KUrl &url, QString &proxy);
663
669 static QString slaveProtocol(const KUrl &url, QStringList &proxy);
670
676 static QString acceptLanguagesHeader();
677
683 static QString charsetFor(const KUrl& url);
684
685private:
686 friend class KIO::SlaveConfigPrivate;
687
692 KDE_NO_EXPORT static KSharedConfigPtr config();
693};
694#endif
KProtocolManager
Provides information about I/O (Internet, etc.) settings chosen/set by the end user.
Definition: kprotocolmanager.h:60
KProtocolManager::ProxyAuthMode
ProxyAuthMode
Proxy authorization modes.
Definition: kprotocolmanager.h:217
KProtocolManager::Prompt
@ Prompt
Definition: kprotocolmanager.h:218
KProtocolManager::ProxyType
ProxyType
Types of proxy configuration.
Definition: kprotocolmanager.h:196
KProtocolManager::ManualProxy
@ ManualProxy
Definition: kprotocolmanager.h:198
KProtocolManager::NoProxy
@ NoProxy
Definition: kprotocolmanager.h:197
KProtocolManager::PACProxy
@ PACProxy
Definition: kprotocolmanager.h:199
KProtocolManager::WPADProxy
@ WPADProxy
Definition: kprotocolmanager.h:200
KSharedConfig
KSharedPtr
KUrl
global.h
kprotocolinfo.h
KSharedConfigPtr
KSharedPtr< KSharedConfig > KSharedConfigPtr
Definition: kprotocolmanager.h:32
config
KSharedConfigPtr config()
KIO
A namespace for KIO globals.
Definition: kbookmarkmenu.h:55
KIO::CacheControl
CacheControl
Specifies how to use the cache.
Definition: global.h:331
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal