kutils Library API Documentation

kcmoduleinfo.h

00001 /*
00002   Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
00003   Copyright (c) 2000 Matthias Elter <elter@kde.org>
00004   Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org>
00005   Copyright (c) 2003 Matthias Kretz <kretz@kde.org>
00006 
00007   This file is part of the KDE project
00008   
00009   This library is free software; you can redistribute it and/or
00010   modify it under the terms of the GNU Library General Public
00011   License version 2, as published by the Free Software Foundation.
00012 
00013   This library is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016   Library General Public License for more details.
00017 
00018   You should have received a copy of the GNU Library General Public License
00019   along with this library; see the file COPYING.LIB.  If not, write to
00020   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021   Boston, MA 02111-1307, USA.
00022 */
00023 
00024 #ifndef KCMODULEINFO_H
00025 #define KCMODULEINFO_H
00026 
00027 #include <kservice.h>
00028 #include <kdemacros.h>
00029 
00030 class QPixmap;
00031 class QString;
00032 class QStringList;
00033 
00044 class KCModuleInfo
00045 {
00046 
00047 public:
00048 
00053   KCModuleInfo(const QString& desktopFile);
00054 
00058   KCModuleInfo( KService::Ptr moduleInfo );
00059 
00060   KCModuleInfo( const KCModuleInfo &rhs );
00061   KCModuleInfo &operator=( const KCModuleInfo &rhs );
00062   bool operator==( const KCModuleInfo &rhs ) const;
00063   bool operator!=( const KCModuleInfo &rhs ) const;
00064   ~KCModuleInfo();
00065 
00069   QString fileName() const { return _fileName; };
00070 
00074   const QStringList &keywords() const { return _keywords; };
00075 
00076   // changed from name() to avoid ambiguity with QObject::name() on multiple inheritance
00080   QString moduleName() const { return _name; };
00081 
00085   KService::Ptr service() const { return _service; };
00086 
00090   QString comment() const { return _comment; };
00091 
00095   QString icon() const { return _icon; };
00096 
00100   QString docPath() const;
00101 
00105   QString library() const { return _lib; };
00106 
00110   QString handle() const;
00111 
00116   int weight() const;
00117 
00121   bool needsRootPrivileges() const;
00122 
00127   bool isHiddenByDefault() const KDE_DEPRECATED;
00128 
00129 protected:
00130 
00131   void setKeywords(const QStringList &k) { _keywords = k; };
00132   void setName(const QString &name) { _name = name; };
00133   void setComment(const QString &comment) { _comment = comment; };
00134   void setIcon(const QString &icon) { _icon = icon; };
00135   void setLibrary(const QString &lib) { _lib = lib; };
00136   void setHandle(const QString &handle) { _handle = handle; };
00137   void setWeight(int weight) { _weight = weight; };
00138   void setNeedsRootPrivileges(bool needsRootPrivileges)
00139   { _needsRootPrivileges = needsRootPrivileges; };
00140   void setIsHiddenByDefault(bool isHiddenByDefault)
00141   { _isHiddenByDefault = isHiddenByDefault; };
00142   void setDocPath(const QString &p) { _doc = p; };
00143   void loadAll();
00144 
00145 private:
00146   void init(KService::Ptr s);
00147 
00148 private:
00149 
00150   // when adding members, don't forget to take care about them in the assignment
00151   // operator
00152   QStringList _keywords;
00153   QString     _name, _icon, _lib, _handle, _fileName, _doc, _comment;
00154   bool        _needsRootPrivileges : 1; 
00155   bool        _isHiddenByDefault : 1;
00156   bool        _allLoaded : 1;
00157   int         _weight;
00158 
00159   KService::Ptr _service;
00160 
00161   class KCModuleInfoPrivate;
00162   KCModuleInfoPrivate *d;
00163   
00164 };
00165 
00166 #endif // KCMODULEINFO_H
00167 
00168 // vim: ts=2 sw=2 et
KDE Logo
This file is part of the documentation for kutils Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:35:50 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003