KConfig

kdesktopfile.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 1999 Pietro Iglio <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 #ifndef KDESKTOPFILE_H
8 #define KDESKTOPFILE_H
9 
10 #include <kconfig.h>
11 
12 class KConfigGroup;
13 class KDesktopFilePrivate;
14 
26 class KCONFIGCORE_EXPORT KDesktopFile : public KConfig
27 {
28 public:
41  explicit KDesktopFile(QStandardPaths::StandardLocation resourceType, const QString &fileName);
42 
52  explicit KDesktopFile(const QString &fileName);
53 
59  virtual ~KDesktopFile();
60 
70  static bool isDesktopFile(const QString &path);
71 
86  static bool isAuthorizedDesktopFile(const QString &path);
87 
92  static QString locateLocal(const QString &path);
93 
94  KConfigGroup desktopGroup() const;
95 
100  QString readType() const;
101 
106  QString readIcon() const;
107 
112  QString readName() const;
113 
118  QString readComment() const;
119 
124  QString readGenericName() const;
125 
130  QString readPath() const;
131 
136  QString readDevice() const;
137 
142  QString readUrl() const;
143 
148  QStringList readActions() const;
149 
155  QStringList readMimeTypes() const;
156 
161  KConfigGroup actionGroup(const QString &group);
162 
163  const KConfigGroup actionGroup(const QString &group) const;
164 
170  bool hasActionGroup(const QString &group) const;
171 
178  bool hasLinkType() const;
179 
184  bool hasApplicationType() const;
185 
190  bool hasDeviceType() const;
191 
197  bool tryExec() const;
198 
203  QString readDocPath() const;
204 
205 #if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(5, 42)
206 
213  KCONFIGCORE_DEPRECATED_VERSION(5, 42, "Not recommended, Desktop Menu Specification defines another mechanism")
214  QStringList sortOrder() const;
215 #endif
216 
223  bool noDisplay() const;
224 
234  KDesktopFile *copyTo(const QString &file) const;
235 
236  QString fileName() const;
237 
238  QStandardPaths::StandardLocation resource() const;
239 
240 protected:
244 // virtual void virtual_hook( int id, void* data );
245 private:
246 
247  Q_DISABLE_COPY(KDesktopFile)
248 
249  Q_DECLARE_PRIVATE(KDesktopFile)
250 };
251 
252 #endif
KConfig * copyTo(const QString &file, KConfig *config=nullptr) const
Copies all entries from this config object to a new config object that will save itself to file...
Definition: kconfig.cpp:529
KDE Desktop File Management.
Definition: kdesktopfile.h:26
A class for one specific group in a KConfig object.
Definition: kconfiggroup.h:38
The central class of the KDE configuration data system.
Definition: kconfig.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 5 2020 22:48:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.