KIO
kmimetypechooser.h
Go to the documentation of this file.
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 2001 - 2004 Anders Lund <anders@alweb.dk> 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 version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef KMIMETYPE_CHOOSER_H 00020 #define KMIMETYPE_CHOOSER_H 00021 00022 #include <kio/kio_export.h> 00023 #include <kdialog.h> 00024 #include <kvbox.h> 00025 00026 class QTreeWidgetItem; 00027 00036 class KIO_EXPORT KMimeTypeChooser : public KVBox 00037 { 00038 Q_OBJECT 00039 00040 public: 00044 enum Visuals { 00045 Comments=1, 00046 Patterns=2, 00047 EditButton=4 00048 }; 00063 explicit 00064 KMimeTypeChooser( const QString& text=QString(), 00065 const QStringList &selectedMimeTypes=QStringList(), 00066 const QString &defaultGroup=QString(), 00067 const QStringList &groupsToShow=QStringList(), 00068 int visuals=Comments|Patterns|EditButton, 00069 QWidget *parent=0 ); 00070 ~KMimeTypeChooser(); 00071 00075 QStringList mimeTypes() const; 00079 QStringList patterns() const; 00080 00081 private: 00082 class KMimeTypeChooserPrivate *d; 00083 00084 Q_PRIVATE_SLOT( d, void _k_editMimeType() ) 00085 Q_PRIVATE_SLOT( d, void _k_slotCurrentChanged(QTreeWidgetItem*) ) 00086 Q_PRIVATE_SLOT( d, void _k_slotSycocaDatabaseChanged(QStringList) ) 00087 }; 00088 00111 class KIO_EXPORT KMimeTypeChooserDialog : public KDialog 00112 { 00113 public: 00131 explicit 00132 KMimeTypeChooserDialog( const QString &caption=QString(), 00133 const QString& text=QString(), 00134 const QStringList &selectedMimeTypes=QStringList(), 00135 const QString &defaultGroup=QString(), 00136 const QStringList &groupsToShow=QStringList(), 00137 int visuals=KMimeTypeChooser::Comments|KMimeTypeChooser::Patterns|KMimeTypeChooser::EditButton, 00138 QWidget *parent=0 ); 00139 00143 KMimeTypeChooserDialog( const QString &caption, 00144 const QString& text, 00145 const QStringList &selectedMimeTypes, 00146 const QString &defaultGroup, 00147 QWidget *parent=0 ); 00148 00149 ~KMimeTypeChooserDialog(); 00150 00154 KMimeTypeChooser* chooser(); 00155 00156 private: 00157 class Private; 00158 Private* const d; 00159 }; 00160 #endif // _KMIMETYPE_CHOOSER_H_ 00161 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE 4.6 API Reference