• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
packagestructure.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright 2007 by Aaron Seigo <aseigo@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*******************************************************************************/
19
20#ifndef PLASMA_PACKAGESTRUCTURE_H
21#define PLASMA_PACKAGESTRUCTURE_H
22
23#include <QtCore/QStringList>
24#include <QtCore/QSharedData>
25
26#include <kgenericfactory.h>
27#include <klocale.h>
28#include <ksharedptr.h>
29
30#include <plasma/version.h>
31#include "packagemetadata.h"
32
33class KConfigBase;
34
35namespace Plasma
36{
37
38class PackageStructurePrivate;
39
72class PLASMA_EXPORT PackageStructure : public QObject, public QSharedData
73{
74 Q_OBJECT
75
76public:
77 typedef KSharedPtr<PackageStructure> Ptr;
78
84 explicit PackageStructure(QObject *parent = 0,
85 const QString &type = i18nc("A non-functional package", "Invalid"));
86
90 virtual ~PackageStructure();
91
95 PackageStructure &operator=(const PackageStructure &rhs);
96
105 static PackageStructure::Ptr load(const QString &packageFormat);
106
110 QString type() const;
111
115 QList<const char*> directories() const;
116
120 QList<const char*> requiredDirectories() const;
121
125 QList<const char*> files() const;
126
130 QList<const char*> requiredFiles() const;
131
143 void addDirectoryDefinition(const char *key, const QString &path, const QString &name);
144
156 void addFileDefinition(const char *key, const QString &path, const QString &name);
157
163 void removeDefinition(const char *key);
164
169 QString path(const char *key) const;
170
177 QStringList searchPath(const char *key) const;
178
186 QStringList entryList(const char *key);
187
191 QString name(const char *key) const;
192
201 void setRequired(const char *key, bool required);
202
206 bool isRequired(const char *key) const;
207
215 void setDefaultMimetypes(QStringList mimetypes);
216
225 void setMimetypes(const char *key, QStringList mimetypes);
226
230 QStringList mimetypes(const char *key) const;
231
236 void setPath(const QString &path);
237
241 QString path() const;
242
246 void read(const KConfigBase *config);
247
251 void write(KConfigBase *config) const;
252
262 virtual bool installPackage(const QString &archivePath, const QString &packageRoot);
263
271 virtual bool uninstallPackage(const QString &packageName, const QString &packageRoot);
272
285 virtual void createNewWidgetBrowser(QWidget *parent = 0);
286
291 KDE_DEPRECATED QString contentsPrefix() const;
292
298 QStringList contentsPrefixPaths() const;
299
303 QString defaultPackageRoot() const;
304
308 QString servicePrefix() const;
309
313 void setServicePrefix(const QString &servicePrefix);
314
318 virtual PackageMetadata metadata();
319
324 bool allowExternalPaths() const;
325
326Q_SIGNALS:
330 void newWidgetBrowserFinished();
331
332protected:
338 void setAllowExternalPaths(bool allow);
339
349 KDE_DEPRECATED void setContentsPrefix(const QString &prefix);
350
362 void setContentsPrefixPaths(const QStringList &prefixPaths);
363
367 void setDefaultPackageRoot(const QString &packageRoot);
368
373 virtual void pathChanged();
374
375private:
376 PackageStructurePrivate * const d;
377};
378
382#define K_EXPORT_PLASMA_PACKAGESTRUCTURE(libname, classname) \
383K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
384K_EXPORT_PLUGIN(factory("plasma_packagestructure_" #libname)) \
385K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
386
387} // Plasma namespace
388#endif
Plasma::PackageMetadata
Provides metadata for a Package.
Definition: packagemetadata.h:40
Plasma::PackageStructure
A description of the expected file structure of a given package type.
Definition: packagestructure.h:73
Plasma::PackageStructure::newWidgetBrowserFinished
void newWidgetBrowserFinished()
Emitted when the new widget browser process completes.
Plasma::PackageStructure::Ptr
KSharedPtr< PackageStructure > Ptr
Definition: packagestructure.h:77
QObject
QSharedData
QWidget
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
packagemetadata.h
version.h
<Plasma/Version>
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal