# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KMimeTypeChooserDialog Class Reference

A Dialog to choose some mimetypes. Provides a checkable tree list of mimetypes, with icons and optinally comments and patterns, and an (optional) button to display the KDE mimetype editor. More...

`#include <kmimetypechooser.h>`

Inheritance diagram for KMimeTypeChooserDialog:

[legend]
Collaboration diagram for KMimeTypeChooserDialog:

[legend]
List of all members.

## Public Member Functions

| KMimeTypeChooserDialog (const QString &caption=QString::null, const QString &text=QString::null, const QStringList &selectedMimeTypes=QStringList(), const QString &defaultGroup=QString::null, const QStringList &groupsToShow=QStringList(), int visuals=KMimeTypeChooser::Comments|KMimeTypeChooser::Patterns|KMimeTypeChooser::EditButton, QWidget *parent=0, const char *name=0)
| KMimeTypeChooserDialog (const QString &caption, const QString &text, const QStringList &selectedMimeTypes, const QString &defaultGroup, QWidget *parent=0, const char *name=0)
KMimeTypeChooser * | chooser ()

## Detailed Description

A Dialog to choose some mimetypes. Provides a checkable tree list of mimetypes, with icons and optinally comments and patterns, and an (optional) button to display the KDE mimetype editor.

Here is an example, using the dialog to set the text of two lineedits:

        QString text = i18n("Select the MimeTypes you want for this file type.");
        QStringList list = QStringList::split( QRegExp("\\s*;\\s*"), leMimetypes->text() );
        KMimeTypeChooserDialog *d = new KMimeTypeChooserDialog( this, 0,
                      i18n("Select Mime Types"), text, list, "text" );
        if ( d->exec() == KDialogBase::Accepted ) {
          leWildcards->setText( d->chooser()->patterns().join(";") );
          leMimetypes->setText( d->chooser()->mimeTypes().join(";") );
        }

Author:
  Anders Lund (anders at alweb dk) dec 19, 2001

Definition at line 131 of file kmimetypechooser.h.

## Constructor & Destructor Documentation

KMimeTypeChooserDialog::KMimeTypeChooserDialog | ( | const QString & | caption = `QString::null`,
|  | const QString & | text = `QString::null`,
|  | const QStringList & | selectedMimeTypes = `QStringList()`,
|  | const QString & | defaultGroup = `QString::null`,
|  | const QStringList & | groupsToShow = `QStringList()`,
|  | int | visuals = `KMimeTypeChooser::Comments|KMimeTypeChooser::Patterns|KMimeTypeChooser::EditButton`,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |

Create a KMimeTypeChooser dialog.

Parameters:

  | caption | The title of the dialog
  | text | A Text to display above the list
  | selectedMimeTypes | A list of mimetype names, theese will be checked in the list if they exist. patterns will be added to the list view.
  | visuals | A OR'd KMimetypeChooser::Visuals enum to decide which data and buttons to display.
  | defaultGroup | The group to open when no groups are selected (like "text"). If not provided, no group is opened. If `groupsToShow` is provided and defaultGroup is not a member of that, it is ignored.
  | groupsToShow | a list of mimetype groups to show. If empty, all groups are shown.
  | parent | The parent widget to use
  | name | The internal name of this object

Definition at line 249 of file kmimetypechooser.cpp.

References KConfigBase::readSizeEntry(), and KDialogBase::setMainWidget().

KMimeTypeChooserDialog::KMimeTypeChooserDialog | ( | const QString & | caption,
|  | const QString & | text,
|  | const QStringList & | selectedMimeTypes,
|  | const QString & | defaultGroup,
|  | QWidget * | parent = `0`,
|  | const char * | name = `0`
| ) |

| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Definition at line 268 of file kmimetypechooser.cpp. References KConfigBase::readSizeEntry(), and KDialogBase::setMainWidget().

## Member Function Documentation

KMimeTypeChooser* KMimeTypeChooserDialog::chooser | ( |  | ) | `[inline]`

Returns:
  a pointer to the KMimeTypeChooser widget

Definition at line 174 of file kmimetypechooser.h.

The documentation for this class was generated from the following files:

- kmimetypechooser.h
- kmimetypechooser.cpp

This file is part of the documentation for kio Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:24:59 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003