| 1 | /* |
| 2 | This file is part of the KDE libraries |
| 3 | SPDX-FileCopyrightText: 1999 Matthias Ettrich <ettrich@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 6 | */ |
| 7 | |
| 8 | #ifndef KCONFIGGUI_H |
| 9 | #define KCONFIGGUI_H |
| 10 | |
| 11 | #include <kconfiggui_export.h> |
| 12 | |
| 13 | #include <QString> |
| 14 | |
| 15 | class KConfig; |
| 16 | |
| 17 | /*! |
| 18 | * \namespace KConfigGui |
| 19 | * \inmodule KConfigGui |
| 20 | * |
| 21 | * \brief Interface-related functions. |
| 22 | */ |
| 23 | namespace KConfigGui |
| 24 | { |
| 25 | /*! |
| 26 | * Returns the current application session config object. |
| 27 | * |
| 28 | * \note If Qt is built without session manager support, i.e. |
| 29 | * QT_NO_SESSIONMANAGER is defined, this by default will return |
| 30 | * nullptr, unless a custom config has been set via |
| 31 | * setSessionConfig. |
| 32 | * |
| 33 | * Returns a pointer to the application's instance specific |
| 34 | * KConfig object. |
| 35 | */ |
| 36 | KCONFIGGUI_EXPORT KConfig *sessionConfig(); |
| 37 | |
| 38 | /*! |
| 39 | * Replaces the current application session config object. |
| 40 | * |
| 41 | * \a id new session id |
| 42 | * |
| 43 | * \a key new session key |
| 44 | * |
| 45 | * \since 5.11 |
| 46 | */ |
| 47 | KCONFIGGUI_EXPORT void setSessionConfig(const QString &id, const QString &key); |
| 48 | |
| 49 | /*! |
| 50 | * Indicates if a session config has been created for that application |
| 51 | * (i.e.\ if sessionConfig() got called at least once) |
| 52 | * |
| 53 | * Returns \c true if a sessionConfig object was created, \c false otherwise |
| 54 | */ |
| 55 | KCONFIGGUI_EXPORT bool hasSessionConfig(); |
| 56 | } |
| 57 | |
| 58 | #endif // KCONFIGGUI_H |
| 59 | |