KDEGames

kgamethemeselector.h
1 /*
2  SPDX-FileCopyrightText: 2006 Mauricio Piacentini <[email protected]>
3  SPDX-FileCopyrightText: 2007 Matt Williams <[email protected]>
4 
5  SPDX-License-Identifier: GPL-2.0-or-later
6 */
7 
8 #ifndef KGAMETHEMESELECTOR_H
9 #define KGAMETHEMESELECTOR_H
10 
11 // own
12 #include "libkdegamesprivate_export.h"
13 // Qt
14 #include <QWidget>
15 // Std
16 #include <memory>
17 
18 class KGameTheme;
19 class KConfigSkeleton;
20 class KGameThemeSelectorPrivate;
21 
22 #if KDEGAMESPRIVATE_ENABLE_DEPRECATED_SINCE(4, 9)
23 
24 /**
25  * \class KGameThemeSelector kgamethemeselector.h <KGameThemeSelector>
26  *
27  * @short A widget used to select the game's theme
28  *
29  * The most common way to use the theme selector is to add it as page to a KConfigDialog
30  * \code
31  * KConfigDialog *dialog = new KConfigDialog(this, "settings", Settings::self());
32  * dialog->addPage(new KGameThemeSelector(dialog, Settings::self()), i18n("Theme"), "game_theme");
33  * dialog->show();
34  * \endcode
35  * This will create a page in your KConfigDialog with the title "Theme" and using the
36  * "game_theme" icon. By default, the widget will search in the share/apps/appname/themes
37  * directory for .desktop files with a group called "KGameTheme".
38  *
39  * @author Mauricio Piacentini
40  * @deprecated Since 4.9, use KgThemeSelector instead.
41  **/
42 class KDEGAMESPRIVATE_EXPORT KGameThemeSelector : public QWidget
43 {
44  Q_OBJECT
45  public:
46  enum NewStuffState {
47  NewStuffDisableDownload,
48  NewStuffEnableDownload
49  };
50  /**
51  * Load a specific theme file.
52  * @param parent the parent widget
53  * @param config the config
54  * @param knsflags the KNewStuff flags
55  * @param groupName the title of the config group in the theme .desktop file
56  * @param directory subdirectory (of share/apps/appname) to search in
57  * @return true if the theme files and properties could be loaded
58  */
59  KDEGAMESPRIVATE_DEPRECATED_VERSION(4, 9, "Use KgThemeSelector")
60  KGameThemeSelector(QWidget* parent, KConfigSkeleton* config, KGameThemeSelector::NewStuffState knsflags = KGameThemeSelector::NewStuffEnableDownload, const QString &groupName = QStringLiteral("KGameTheme"), const QString &directory = QStringLiteral("themes"));
61  ~KGameThemeSelector() override;
62 
63  private:
64  std::unique_ptr<class KGameThemeSelectorPrivate> const d;
65 
67 };
68 
69 #endif
70 
71 #endif
Class for loading theme files.
Definition: kgametheme.h:40
Q_DISABLE_COPY(Class)
A widget used to select the game&#39;s theme.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Dec 7 2021 22:34:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.