00001 /********************************************************************** 00002 ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of the Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 #ifndef MIMETYPE_H 00021 #define MIMETYPE_H 00022 00023 #include <qstringlist.h> 00024 #include <qpixmap.h> 00025 #include <qlist.h> 00026 00027 class AppLnk; 00028 class DocLnk; 00029 class QStringList; 00030 class MimeTypeData; 00031 class AppLnkSet; 00032 00033 class MimeType 00034 { 00035 public: 00036 MimeType( const QString& ext_or_id ); 00037 MimeType( const DocLnk& ); 00038 00039 QString id() const; 00040 QString description() const; 00041 QPixmap pixmap() const; 00042 QPixmap bigPixmap() const; 00043 00044 // DON'T define this yourself! 00045 #ifdef QTOPIA_INTERNAL_MIMEEXT 00046 QString extension() const; 00047 QStringList extensions() const; 00048 QList<AppLnk> applications() const; 00049 #endif 00050 00051 const AppLnk* application() const; 00052 00053 static QString appsFolderName(); 00054 static void updateApplications(); 00055 00056 // These shouldn't be needed 00057 static void clear(); 00058 static void registerApp( const AppLnk& ); 00059 00060 private: 00061 static void updateApplications(AppLnkSet* folder); 00062 static void loadExtensions(); 00063 static void loadExtensions(const QString&); 00064 void init( const QString& ext_or_id ); 00065 class Private; 00066 static Private* d; 00067 static Private& data(); 00068 static MimeTypeData* data(const QString& id); 00069 QString i; 00070 }; 00071 00072 #endif
1.4.2