• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

packagestructure.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 *   Copyright 2007 by Aaron Seigo <aseigo@kde.org>                        *
00003 *                                                                             *
00004 *   This library is free software; you can redistribute it and/or             *
00005 *   modify it under the terms of the GNU Library General Public               *
00006 *   License as published by the Free Software Foundation; either              *
00007 *   version 2 of the License, or (at your option) any later version.          *
00008 *                                                                             *
00009 *   This library is distributed in the hope that it will be useful,           *
00010 *   but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00011 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          *
00012 *   Library General Public License for more details.                          *
00013 *                                                                             *
00014 *   You should have received a copy of the GNU Library General Public License *
00015 *   along with this library; see the file COPYING.LIB.  If not, write to      *
00016 *   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,      *
00017 *   Boston, MA 02110-1301, USA.                                               *
00018 *******************************************************************************/
00019 
00020 #ifndef PACKAGESTRUCTURE_H
00021 #define PACKAGESTRUCTURE_H
00022 
00023 #include <QtCore/QStringList>
00024 #include <QtCore/QSharedData>
00025 
00026 #include <KDE/KGenericFactory>
00027 #include <KDE/KLocale>
00028 #include <KDE/KSharedPtr>
00029 
00030 #include <plasma/version.h>
00031 
00032 class KConfigBase;
00033 
00034 namespace Plasma
00035 {
00036 
00037 class PackageStructurePrivate;
00038 
00069 class PLASMA_EXPORT PackageStructure : public QObject, public QSharedData
00070 {
00071     Q_OBJECT
00072 
00073 public:
00074     typedef KSharedPtr<PackageStructure> Ptr;
00075 
00081     explicit PackageStructure(QObject *parent = 0, const QString &type = i18n("Invalid"));
00082 
00086     virtual ~PackageStructure();
00087 
00091     PackageStructure& operator=(const PackageStructure& rhs);
00092 
00101     static PackageStructure::Ptr load(const QString &packageFormat);
00102 
00106     QString type() const;
00107 
00111     QList<const char*> directories() const;
00112 
00116     QList<const char*> requiredDirectories() const;
00117 
00121     QList<const char*> files() const;
00122 
00126     QList<const char*> requiredFiles() const;
00127 
00136     void addDirectoryDefinition(const char* key, const QString& path, const QString& name);
00137 
00146     void addFileDefinition(const char* key, const QString& path, const QString& name);
00147 
00151     QString path(const char* key) const;
00152 
00156     QString name(const char* key) const;
00157 
00166     void setRequired(const char* key, bool required);
00167 
00171     bool isRequired(const char* key) const;
00172 
00180     void setDefaultMimetypes(QStringList mimetypes);
00181 
00190     void setMimetypes(const char* key, QStringList mimetypes);
00191 
00195     QStringList mimetypes(const char* key) const;
00196 
00201     void setPath(const QString &path);
00202 
00206     QString path() const;
00207 
00211     void read(const KConfigBase *config);
00212 
00216     void write(KConfigBase *config) const;
00217 
00227     virtual bool installPackage(const QString &archivePath, const QString &packageRoot);
00228 
00236     virtual bool uninstallPackage(const QString& packageName, const QString& packageRoot);
00237 
00241     QString contentsPrefix() const;
00242 
00243 protected:
00252     void setContentsPrefix(const QString &prefix);
00253 
00258     virtual void pathChanged();
00259 
00260 private:
00261     PackageStructurePrivate * const d;
00262 };
00263 
00267 #define K_EXPORT_PLASMA_PACKAGESTRUCTURE(libname, classname) \
00268 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00269 K_EXPORT_PLUGIN(factory("plasma_packagestructure_" #libname)) \
00270 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
00271 
00272 } // Plasma namespace
00273 #endif

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal