# kio Library API Documentation

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

# KMimeTypeChooser Class Reference

This widget provides a checkable list of all available mimetypes, and a list of selected ones, as well as a corresponding list of file extensions, an optional text and an optional edit button (not working yet). More...

`#include <kmimetypechooser.h>`

Inheritance diagram for KMimeTypeChooser:

[legend]
Collaboration diagram for KMimeTypeChooser:

[legend]
List of all members.

## Public Types

enum | Visuals { Comments = 1, Patterns = 2, EditButton = 4 }

## Public Slots

void | editMimeType ()

## Public Member Functions

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

## Detailed Description

This widget provides a checkable list of all available mimetypes, and a list of selected ones, as well as a corresponding list of file extensions, an optional text and an optional edit button (not working yet).

Mime types is presented in a list view, with name, comment and patterns columns.

Author:
  Anders Lund (anders at alweb dk), jan 23, 2002

Definition at line 34 of file kmimetypechooser.h.

## Member Enumeration Documentation

enum KMimeTypeChooser::Visuals

Buttons and data for display.

Enumeration values:

  Comments | Show the Mimetypes Comment field in a column ("HTML Document").
  Patterns | Show the Mimetypes Patterns field in a column ("*.html;*.htm").
  EditButton | Show the "Edit" button, allowing to edit the selected type.

Definition at line 42 of file kmimetypechooser.h.

## Constructor & Destructor Documentation

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

Create a new KMimeTypeChooser.

Parameters:

  | text | A Text to display above the list
  | selectedMimeTypes | A list of mimetype names, theese will be checked in the list if they exist.
  | visuals | A OR'd 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 50 of file kmimetypechooser.cpp.

References QWhatsThis::add(), Comments, EditButton, editMimeType(), and Patterns.

## Member Function Documentation

QStringList KMimeTypeChooser::mimeTypes | ( |  | ) | const

Returns:
  a list of all selected selected mimetypes represented by their name.

Definition at line 217 of file kmimetypechooser.cpp.

QStringList KMimeTypeChooser::patterns | ( |  | ) | const

Returns:
  a list of the fileame patterns associated with all selected mimetypes.

Definition at line 229 of file kmimetypechooser.cpp.

References KMimeType::defaultMimeType(), and KMimeType::mimeType().

void KMimeTypeChooser::editMimeType | ( |  | ) | `[slot]`

| edit the current mimetype Uses KRun to start the KDE mimetype editor for editing the currently selected mimetype. Definition at line 190 of file kmimetypechooser.cpp. References QString::fromLatin1(), KRun::runCommand(), and QListViewItem::text(). Referenced by KMimeTypeChooser().

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