kdesktopfile.h
00001 /* This file is part of the KDE libraries 00002 Copyright (c) 1999 Pietro Iglio <iglio@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., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. 00018 */ 00019 // $Id: kdesktopfile.h,v 1.30 2002/09/28 12:28:47 tjansen Exp $ 00020 00021 #ifndef _KDESKTOPFILE_H 00022 #define _KDESKTOPFILE_H 00023 00024 #include "kconfig.h" 00025 00026 class KDesktopFilePrivate; 00027 00036 class KDesktopFile : public KConfig 00037 { 00038 Q_OBJECT 00039 00040 public: 00053 KDesktopFile( const QString &fileName, bool readOnly = false, 00054 const char * resType = "apps"); 00055 00061 virtual ~KDesktopFile(); 00062 00072 static bool isDesktopFile(const QString& path); 00073 00083 static bool isAuthorizedDesktopFile(const QString& path); 00084 00089 QString readType() const; 00090 00095 QString readIcon() const; 00096 00101 QString readName() const; 00102 00107 QString readComment() const; 00108 00113 QString readGenericName() const; 00114 00120 QString readPath() const; 00121 00126 QString readDevice() const; 00127 00132 QString readURL() const; 00133 00138 QStringList readActions() const; 00139 00144 void setActionGroup(const QString &group); 00145 00151 bool hasActionGroup(const QString &group) const; 00152 00159 bool hasLinkType() const; 00160 00165 bool hasApplicationType() const; 00166 00171 bool hasMimeTypeType() const; // funny name :) 00172 00177 bool hasDeviceType() const; 00178 00184 bool tryExec() const; 00185 00190 QString fileName() const; 00191 00196 QString resource() const; 00197 00203 QString readDocPath() const; 00204 00209 QStringList sortOrder() const; 00210 00211 00212 #ifdef KDE_NO_COMPAT 00213 private: 00214 #endif 00215 00218 QString filename() const { return fileName(); }; 00219 00220 private: 00221 00222 // copy-construction and assignment are not allowed 00223 KDesktopFile( const KDesktopFile& ); 00224 KDesktopFile& operator= ( const KDesktopFile& ); 00225 00226 protected: 00227 virtual void virtual_hook( int id, void* data ); 00228 private: 00229 KDesktopFilePrivate *d; 00230 }; 00231 00232 00233 #endif 00234