kio Library API Documentation

KFileFilterCombo Class Reference

Inheritance diagram for KFileFilterCombo:

Inheritance graph
[legend]
Collaboration diagram for KFileFilterCombo:

Collaboration graph
[legend]
List of all members.

Signals

void filterChanged ()

Public Member Functions

 KFileFilterCombo (QWidget *parent=0, const char *name=0)
 ~KFileFilterCombo ()
void setFilter (const QString &filter)
QString currentFilter () const
void setCurrentFilter (const QString &filter)
void setMimeFilter (const QStringList &types, const QString &defaultType)
bool showsAllTypes () const
void setDefaultFilter (const QString &filter)
QString defaultFilter () const

Protected Member Functions

virtual bool eventFilter (QObject *o, QEvent *e)
virtual void virtual_hook (int id, void *data)

Protected Attributes

QStringList filters
bool m_allTypes

Detailed Description

Definition at line 31 of file kfilefiltercombo.h.


Member Function Documentation

QString KFileFilterCombo::currentFilter  )  const
 

Returns:
the current filter, either something like "*.cpp *.h" or the current mimetype, like "text/html", or a list of those, like " "text/html text/plain image/png", all separated with one space.

Definition at line 93 of file kfilefiltercombo.cpp.

References QComboBox::currentItem(), QComboBox::currentText(), filters, QString::find(), QString::left(), and QComboBox::text().

Referenced by KFileDialog::currentFilter(), KFileDialog::setFilter(), KFileDialog::setMimeFilter(), and KFileDialog::slotFilterChanged().

void KFileFilterCombo::setCurrentFilter const QString filter  ) 
 

Sets the current filter.

Filter must match one of the filter items passed before to this widget.

Since:
3.4

Definition at line 110 of file kfilefiltercombo.cpp.

References QComboBox::setCurrentText().

void KFileFilterCombo::setMimeFilter const QStringList types,
const QString defaultType
 

Sets a list of mimetypes.

If defaultType is set, it will be set as the current item. Otherwise, a first item showing all the mimetypes will be created.

Definition at line 116 of file kfilefiltercombo.cpp.

References QComboBox::clear(), QComboBox::currentText(), endl(), filters, QString::fromLatin1(), QComboBox::insertItem(), QString::isEmpty(), kdDebug(), m_allTypes, KMimeType::mimeType(), and KComboBox::setCurrentItem().

Referenced by KFileDialog::setMimeFilter().

bool KFileFilterCombo::showsAllTypes  )  const [inline]
 

Returns:
true if the filter's first item is the list of all mimetypes

Definition at line 65 of file kfilefiltercombo.h.

Referenced by KFileDialog::currentMimeFilter().

void KFileFilterCombo::setDefaultFilter const QString filter  ) 
 

This method allows you to set a default-filter, that is used when an empty filter is set.

Make sure you call this before calling setFilter().

By default, this is set to i18n("*|All Files")

See also:
defaultFilter

Definition at line 179 of file kfilefiltercombo.cpp.

Referenced by KFileDialog::setMode().

QString KFileFilterCombo::defaultFilter  )  const
 

Returns:
the default filter, used when an empty filter is set.
See also:
setDefaultFilter

Definition at line 184 of file kfilefiltercombo.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kio Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Jul 20 12:39:23 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003