Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / plasma / packagemetadata.h
blob963ff46fd0dcd224f68469e2c0ab5d10b55c3ea8
1 /******************************************************************************
2 * Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org> *
3 * *
4 * This library is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Library General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2 of the License, or (at your option) any later version. *
8 * *
9 * This library is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Library General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Library General Public License *
15 * along with this library; see the file COPYING.LIB. If not, write to *
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301, USA. *
18 *******************************************************************************/
20 #ifndef PACKAGEMETADATA_H
21 #define PACKAGEMETADATA_H
23 #include <QtCore/QString>
25 #include <plasma/plasma_export.h>
27 namespace Plasma
30 class PLASMA_EXPORT PackageMetadata
32 public:
33 /**
34 * Default constructor
35 **/
36 PackageMetadata();
38 /**
39 * Constructs a metadata object using the values in the file at path
41 * @param path path to a metadata.desktop file
42 **/
43 PackageMetadata(const QString& path);
44 ~PackageMetadata();
46 bool isComplete() const;
48 /**
49 * Writes out the metadata to filename, which should be a .desktop
50 * file. It writes out the information in a format that is compatible
51 * with KPluginInfo
52 * @see KPluginInfo
54 * @arg filename path to the file to write to
55 * @arg icon path to the package icon
56 **/
57 void write(const QString& filename, const QString &icon = QString()) const;
59 /**
60 * Reads in metadata from a file, which should be a .desktop
61 * file. It writes out the information in a format that is compatible
62 * with KPluginInfo
63 * @see KPluginInfo
65 * @arg filename path to the file to write to
66 **/
67 void read(const QString &filename);
69 QString name() const;
70 QString description() const;
71 QString serviceType() const;
72 QString author() const;
73 QString email() const;
74 QString version() const;
75 QString website() const;
76 QString license() const;
77 QString application() const;
78 QString requiredVersion() const;
79 QString pluginName() const;
80 QString implementationLanguage() const;
82 QString type() const;
84 void setName(const QString &);
85 void setDescription(const QString &);
86 void setServiceType(const QString &);
87 void setAuthor(const QString &);
88 void setEmail(const QString &);
89 void setVersion(const QString &);
90 void setWebsite(const QString &);
91 void setLicense(const QString &);
92 void setApplication(const QString &);
93 void setRequiredVersion(const QString &);
94 void setType(const QString& type);
95 void setPluginName(const QString& name);
96 void setImplementationLanguage(const QString& language);
98 private:
99 class Private;
100 Private * const d;
104 #endif