kcmoduleinfo.h
/*
Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
Copyright (c) 2000 Matthias Elter <elter@kde.org>
Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org>
Copyright (c) 2003 Matthias Kretz <kretz@kde.org>
This file is part of the KDE project
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2, as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KCMODULEINFO_H
#define KCMODULEINFO_H
#include <kservice.h>
class QPixmap;
class QString;
class QStringList;
class KUTILS_EXPORT KCModuleInfo
{
public:
KCModuleInfo(const QString& desktopFile);
KCModuleInfo( KService::Ptr moduleInfo );
KCModuleInfo( const KCModuleInfo &rhs );
KCModuleInfo();
KCModuleInfo &operator=( const KCModuleInfo &rhs );
bool operator==( const KCModuleInfo &rhs ) const;
bool operator!=( const KCModuleInfo &rhs ) const;
~KCModuleInfo();
QString fileName() const { return _fileName; }
const QStringList &keywords() const { return _keywords; }
QString factoryName() const;
QString moduleName() const { return _name; }
// changed from name() to avoid ambiguity with QObject::name() on multiple inheritance
KService::Ptr service() const { return _service; }
QString comment() const { return _comment; }
QString icon() const { return _icon; }
QString docPath() const;
QString library() const { return _lib; }
QString handle() const;
int weight() const;
bool needsRootPrivileges() const;
bool isHiddenByDefault() const KDE_DEPRECATED;
bool needsTest() const;
protected:
void setKeywords(const QStringList &keyword) { _keywords = keyword; }
void setName(const QString &name) { _name = name; }
void setComment(const QString &comment) { _comment = comment; }
void setIcon(const QString &icon) { _icon = icon; }
void setLibrary(const QString &lib) { _lib = lib; }
void setHandle(const QString &handle) { _handle = handle; }
void setWeight(int weight) { _weight = weight; }
void setNeedsTest( bool val );
void setNeedsRootPrivileges(bool needsRootPrivileges)
{ _needsRootPrivileges = needsRootPrivileges; }
void setIsHiddenByDefault(bool isHiddenByDefault)
{ _isHiddenByDefault = isHiddenByDefault; }
void setDocPath(const QString &p) { _doc = p; }
void loadAll();
private:
void init(KService::Ptr s);
private:
// KDE4 These needs to be moved to KCModuleInfoPrivate
QStringList _keywords;
QString _name, _icon, _lib, _handle, _fileName, _doc, _comment;
bool _needsRootPrivileges : 1;
bool _isHiddenByDefault : 1;
bool _allLoaded : 1;
int _weight;
KService::Ptr _service;
class KCModuleInfoPrivate;
KCModuleInfoPrivate *d;
};
#endif // KCMODULEINFO_H
// vim: ts=2 sw=2 et
KCModuleInfo::setComment
void setComment(const QString &comment)
Sets the object's name.
Definition: kcmoduleinfo.h:208
KCModuleInfo::setHandle
void setHandle(const QString &handle)
Sets the factory name.
Definition: kcmoduleinfo.h:226
KCModuleInfo::setName
void setName(const QString &name)
Sets the object's name.
Definition: kcmoduleinfo.h:202
KCModuleInfo::comment
QString comment() const
Definition: kcmoduleinfo.h:142
KCModuleInfo::setLibrary
void setLibrary(const QString &lib)
Set the object's library.
Definition: kcmoduleinfo.h:220
KCModuleInfo::setDocPath
void setDocPath(const QString &p)
Sets the object's documentation path.
Definition: kcmoduleinfo.h:262
KCModuleInfo::setIsHiddenByDefault
void setIsHiddenByDefault(bool isHiddenByDefault)
Definition: kcmoduleinfo.h:255
KCModuleInfo::fileName
QString fileName() const
Definition: kcmoduleinfo.h:113
KCModuleInfo::setWeight
void setWeight(int weight)
Sets the object's weight property which determines in what order modules will be displayed.
Definition: kcmoduleinfo.h:234
KCModuleInfo::keywords
const QStringList & keywords() const
Definition: kcmoduleinfo.h:118
KCModuleInfo::setNeedsRootPrivileges
void setNeedsRootPrivileges(bool needsRootPrivileges)
Toggles whether the represented module needs root privileges.
Definition: kcmoduleinfo.h:249
KCModuleInfo::library
QString library() const
Definition: kcmoduleinfo.h:157
KCModuleInfo
A class that provides information about a KCModule.
Definition: kcmoduleinfo.h:49
KCModuleInfo::setIcon
void setIcon(const QString &icon)
Sets the object's icon.
Definition: kcmoduleinfo.h:214
KCModuleInfo::service
KService::Ptr service() const
Definition: kcmoduleinfo.h:137
KCModuleInfo::icon
QString icon() const
Definition: kcmoduleinfo.h:147
KCModuleInfo::moduleName
QString moduleName() const
Definition: kcmoduleinfo.h:131

KDE Home | KDE Accessibility Home | Description of Access Keys