Plasma
package.h
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * Copyright 2007 by Aaron Seigo <aseigo@kde.org> * 00003 * Copyright 2007 by Riccardo Iaconelli <riccardo@kde.org> * 00004 * * 00005 * This library is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU Library General Public * 00007 * License as published by the Free Software Foundation; either * 00008 * version 2 of the License, or (at your option) any later version. * 00009 * * 00010 * This library is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00013 * Library General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU Library General Public License * 00016 * along with this library; see the file COPYING.LIB. If not, write to * 00017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00018 * Boston, MA 02110-1301, USA. * 00019 *******************************************************************************/ 00020 00021 #ifndef PLASMA_PACKAGE_H 00022 #define PLASMA_PACKAGE_H 00023 00024 #include <QtCore/QStringList> 00025 00026 #include <plasma/plasma.h> 00027 #include <plasma/packagestructure.h> 00028 #include <plasma/plasma_export.h> 00029 00030 namespace Plasma 00031 { 00032 00039 class PackageMetadata; 00040 class PackagePrivate; 00041 00042 class PLASMA_EXPORT Package 00043 { 00044 public: 00049 explicit Package(); 00050 00058 Package(const QString &packageRoot, const QString &package, 00059 PackageStructure::Ptr structure); 00060 00067 Package(const QString &packagePath, PackageStructure::Ptr structure); 00068 00073 Package(const Package &other); 00074 00075 ~Package(); 00076 00081 Package &operator=(const Package &rhs); 00082 00087 bool isValid() const; 00088 00097 QString filePath(const char *fileType, const QString &filename) const; 00098 00107 QString filePath(const char *fileType) const; 00108 00116 QStringList entryList(const char *fileType) const; 00117 00121 PackageMetadata metadata() const; 00122 00128 void setPath(const QString &path); 00129 00134 void publish(AnnouncementMethods methods, const QString &name); 00135 00139 void unpublish(const QString &name = QString()); 00140 00144 bool isPublished() const; 00145 00149 const QString path() const; 00150 00154 const PackageStructure::Ptr structure() const; 00155 00160 QString contentsHash() const; 00161 00169 static QStringList listInstalled(const QString &packageRoot); 00170 00178 static QStringList listInstalledPaths(const QString &packageRoot); 00179 00192 static bool installPackage(const QString &package, 00193 const QString &packageRoot, 00194 const QString &servicePrefix); 00195 00206 static bool uninstallPackage(const QString &package, 00207 const QString &packageRoot, 00208 const QString &servicePrefix); 00209 00216 static bool registerPackage(const PackageMetadata &data, const QString &iconPath); 00217 00228 static bool createPackage(const PackageMetadata &metadata, 00229 const QString &source, 00230 const QString &destination, 00231 const QString &icon = QString()); 00232 00233 private: 00234 PackagePrivate * const d; 00235 00236 friend class Applet; 00237 friend class AppletPrivate; 00238 }; 00239 00240 } // Namespace 00241 00242 Q_DECLARE_METATYPE(Plasma::Package) 00243 #endif 00244
KDE 4.6 API Reference