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

Plasma

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 PLASMA_PACKAGESTRUCTURE_H
00021 #define PLASMA_PACKAGESTRUCTURE_H
00022 
00023 #include <QtCore/QStringList>
00024 #include <QtCore/QSharedData>
00025 
00026 #include <kgenericfactory.h>
00027 #include <klocale.h>
00028 #include <ksharedptr.h>
00029 
00030 #include <plasma/version.h>
00031 #include "packagemetadata.h"
00032 
00033 class KConfigBase;
00034 
00035 namespace Plasma
00036 {
00037 
00038 class PackageStructurePrivate;
00039 
00072 class PLASMA_EXPORT PackageStructure : public QObject, public QSharedData
00073 {
00074     Q_OBJECT
00075 
00076 public:
00077     typedef KSharedPtr<PackageStructure> Ptr;
00078 
00084     explicit PackageStructure(QObject *parent = 0,
00085                               const QString &type = i18nc("A non-functional package", "Invalid"));
00086 
00090     virtual ~PackageStructure();
00091 
00095     PackageStructure &operator=(const PackageStructure &rhs);
00096 
00105     static PackageStructure::Ptr load(const QString &packageFormat);
00106 
00110     QString type() const;
00111 
00115     QList<const char*> directories() const;
00116 
00120     QList<const char*> requiredDirectories() const;
00121 
00125     QList<const char*> files() const;
00126 
00130     QList<const char*> requiredFiles() const;
00131 
00140     void addDirectoryDefinition(const char *key, const QString &path, const QString &name);
00141 
00150     void addFileDefinition(const char *key, const QString &path, const QString &name);
00151 
00155     QString path(const char *key) const;
00156 
00164     QStringList entryList(const char *key);
00165 
00169     QString name(const char *key) const;
00170 
00179     void setRequired(const char *key, bool required);
00180 
00184     bool isRequired(const char *key) const;
00185 
00193     void setDefaultMimetypes(QStringList mimetypes);
00194 
00203     void setMimetypes(const char *key, QStringList mimetypes);
00204 
00208     QStringList mimetypes(const char *key) const;
00209 
00214     void setPath(const QString &path);
00215 
00219     QString path() const;
00220 
00224     void read(const KConfigBase *config);
00225 
00229     void write(KConfigBase *config) const;
00230 
00240     virtual bool installPackage(const QString &archivePath, const QString &packageRoot);
00241 
00249     virtual bool uninstallPackage(const QString &packageName, const QString &packageRoot);
00250 
00263     virtual void createNewWidgetBrowser(QWidget *parent = 0);
00264 
00268     QString contentsPrefix() const;
00269 
00273     QString defaultPackageRoot() const;
00274 
00278     QString servicePrefix() const;
00279 
00283     void setServicePrefix(const QString &servicePrefix);
00284 
00288     virtual PackageMetadata metadata();
00289 
00294     bool allowExternalPaths() const;
00295 
00296 Q_SIGNALS:
00300     void newWidgetBrowserFinished();
00301 
00302 protected:
00308     void setAllowExternalPaths(bool allow);
00309 
00318     void setContentsPrefix(const QString &prefix);
00319 
00323     void setDefaultPackageRoot(const QString &packageRoot);
00324 
00329     virtual void pathChanged();
00330 
00331 private:
00332     PackageStructurePrivate * const d;
00333 };
00334 
00338 #define K_EXPORT_PLASMA_PACKAGESTRUCTURE(libname, classname) \
00339 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00340 K_EXPORT_PLUGIN(factory("plasma_packagestructure_" #libname)) \
00341 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
00342 
00343 } // Plasma namespace
00344 #endif

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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