3 * This file is part of the KDE libraries
4 * Copyright (c) 2001 Waldo Bastian <bastian@kde.org>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License version 2 as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef KIO_SLAVE_CONFIG_H
22 #define KIO_SLAVE_CONFIG_H
24 #include <QtCore/QObject>
25 #include <kio/global.h>
29 class SlaveConfigPrivate
;
33 * This class manages the configuration for io-slaves based on protocol
34 * and host. The Scheduler makes use of this class to configure the slave
35 * whenever it has to connect to a new host.
37 * You only need to use this class if you want to override specific
38 * configuration items of an io-slave when the io-slave is used by
41 * Normally io-slaves are being configured by "kio_<protocol>rc"
42 * configuration files. Groups defined in such files are treated as host
43 * or domain specification. Configuration items defined in a group are
44 * only applied when the slave is connecting with a host that matches with
45 * the host and/or domain specified by the group.
47 class KIO_EXPORT SlaveConfig
: public QObject
51 static SlaveConfig
*self();
54 * Configure slaves of type @p protocol by setting @p key to @p value.
55 * If @p host is specified the configuration only applies when dealing
58 * Changes made to the slave configuration only apply to slaves
59 * used by the current process.
61 void setConfigData(const QString
&protocol
, const QString
&host
, const QString
&key
, const QString
&value
);
64 * Configure slaves of type @p protocol with @p config.
65 * If @p host is specified the configuration only applies when dealing
68 * Changes made to the slave configuration only apply to slaves
69 * used by the current process.
71 void setConfigData(const QString
&protocol
, const QString
&host
, const MetaData
&config
);
74 * Query slave configuration for slaves of type @p protocol when
75 * dealing with @p host.
77 MetaData
configData(const QString
&protocol
, const QString
&host
);
80 * Query a specific configuration key for slaves of type @p protocol when
81 * dealing with @p host.
83 QString
configData(const QString
&protocol
, const QString
&host
, const QString
&key
);
86 * Undo any changes made by calls to setConfigData.
91 * This signal is raised when a slave of type @p protocol deals
92 * with @p host for the first time.
94 * Your application can use this signal to make some last minute
95 * configuration changes with setConfigData based on the
98 void configNeeded(const QString
&protocol
, const QString
&host
);
102 SlaveConfigPrivate
* const d
;