kmimetypechooser.h
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 <tqvbox.h> 00023 #include <kdialogbase.h> 00024 00025 00034 class TDEIO_EXPORT KMimeTypeChooser : public TQVBox 00035 { 00036 Q_OBJECT 00037 00038 public: 00042 enum Visuals { 00043 Comments=1, 00044 Patterns=2, 00045 EditButton=4 00046 }; 00062 KMimeTypeChooser( const TQString& text=TQString::null, 00063 const TQStringList &selectedMimeTypes=0, 00064 const TQString &defaultGroup=TQString::null, 00065 const TQStringList &groupsToShow=TQStringList(), 00066 int visuals=Comments|Patterns|EditButton, 00067 TQWidget *parent=0, const char *name=0 ); 00068 ~KMimeTypeChooser(); 00069 00073 TQStringList mimeTypes() const; 00077 TQStringList patterns() const; 00078 00079 public slots: 00085 void editMimeType(); 00086 00087 private slots: 00091 void slotCurrentChanged(TQListViewItem* i); 00092 00097 void slotSycocaDatabaseChanged(); 00098 00099 private: 00105 void loadMimeTypes( const TQStringList &selected=TQStringList() ); 00106 00107 class KMimeTypeChooserPrivate *d; 00108 }; 00109 00131 class TDEIO_EXPORT KMimeTypeChooserDialog : public KDialogBase 00132 { 00133 public: 00152 KMimeTypeChooserDialog( const TQString &caption=TQString::null, 00153 const TQString& text=TQString::null, 00154 const TQStringList &selectedMimeTypes=TQStringList(), 00155 const TQString &defaultGroup=TQString::null, 00156 const TQStringList &groupsToShow=TQStringList(), 00157 int visuals=KMimeTypeChooser::Comments|KMimeTypeChooser::Patterns|KMimeTypeChooser::EditButton, 00158 TQWidget *parent=0, const char *name=0 ); 00159 00163 KMimeTypeChooserDialog( const TQString &caption, 00164 const TQString& text, 00165 const TQStringList &selectedMimeTypes, 00166 const TQString &defaultGroup, 00167 TQWidget *parent=0, const char *name=0 ); 00168 00169 ~KMimeTypeChooserDialog(); 00170 00174 KMimeTypeChooser* chooser() { return m_chooser; } 00175 00176 private: 00177 KMimeTypeChooser *m_chooser; 00178 }; 00179 #endif // _KMIMETYPE_CHOOSER_H_ 00180 // kate: space-indent on; indent-width 2; replace-tabs on;