File indexing completed on 2024-05-12 03:54:27

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 1999 Matthias Ettrich <ettrich@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef KCONFIGGUI_H
0009 #define KCONFIGGUI_H
0010 
0011 #include <kconfiggui_export.h>
0012 
0013 #include <QString>
0014 
0015 class KConfig;
0016 
0017 /**
0018  * Interface-related functions.
0019  */
0020 namespace KConfigGui
0021 {
0022 /**
0023  * Returns the current application session config object.
0024  *
0025  * @note If Qt is built without session manager support, i.e.
0026  * QT_NO_SESSIONMANAGER is defined, this by default will return
0027  * nullptr, unless a custom config  has been set via
0028  * @c setSessionConfig.
0029  *
0030  * @return A pointer to the application's instance specific
0031  * KConfig object.
0032  * @see KConfig
0033  */
0034 KCONFIGGUI_EXPORT KConfig *sessionConfig();
0035 
0036 /**
0037  * Replaces the current application session config object.
0038  *
0039  * @param id  new session id
0040  * @param key new session key
0041  *
0042  * @since 5.11
0043  */
0044 KCONFIGGUI_EXPORT void setSessionConfig(const QString &id, const QString &key);
0045 
0046 /**
0047  * Indicates if a session config has been created for that application
0048  * (i.e.\ if sessionConfig() got called at least once)
0049  *
0050  * @return @c true if a sessionConfig object was created, @c false otherwise
0051  */
0052 KCONFIGGUI_EXPORT bool hasSessionConfig();
0053 }
0054 
0055 #endif // KCONFIGGUI_H