.TH "KIconViewSearchLine" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KIconViewSearchLine \- This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kiconviewsearchline.h>\fP
.PP
Inherits \fBKLineEdit\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "virtual void \fBupdateSearch\fP (const \fBQString\fP &s=QString::null)"
.br
.ti -1c
.RI "void \fBsetCaseSensitive\fP (bool cs)"
.br
.ti -1c
.RI "void \fBsetIconView\fP (\fBQIconView\fP *iv)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKIconViewSearchLine\fP (\fBQWidget\fP *parent=0, \fBQIconView\fP *iconView=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKIconViewSearchLine\fP (\fBQWidget\fP *parent, const char *name)"
.br
.ti -1c
.RI "virtual \fB~KIconViewSearchLine\fP ()"
.br
.ti -1c
.RI "bool \fBcaseSensitive\fP () const "
.br
.ti -1c
.RI "\fBQIconView\fP * \fBiconView\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBqueueSearch\fP (const \fBQString\fP &s)"
.br
.ti -1c
.RI "void \fBactivateSearch\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBitemMatches\fP (const \fBQIconViewItem\fP *item, const \fBQString\fP &s) const "
.br
.ti -1c
.RI "void \fBinit\fP (\fBQIconView\fP *iconView=0)"
.br
.ti -1c
.RI "void \fBhideItem\fP (\fBQIconViewItem\fP *item)"
.br
.ti -1c
.RI "void \fBshowItem\fP (\fBQIconViewItem\fP *item)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search. 

No changes to the application other than instantiating this class with an appropriate \fBQIconView\fP should be needed.
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 38 of file kiconviewsearchline.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KIconViewSearchLine::KIconViewSearchLine (\fBQWidget\fP * parent = \fC0\fP, \fBQIconView\fP * iconView = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs a KIconViewSearchLine with \fIiconView\fP being the \fBQIconView\fP to be filtered. 
.PP
If \fIiconView\fP is null then the widget will be disabled until a iconview is set with \fBsetIconView()\fP. 
.PP
Definition at line 57 of file kiconviewsearchline.cpp.
.PP
References iconView(), and init().
.SS "KIconViewSearchLine::KIconViewSearchLine (\fBQWidget\fP * parent, const char * name)"
.PP
Constructs a KIconViewSearchLine without any \fBQIconView\fP to filter. 
.PP
The \fBQIconView\fP object has to be set later with \fBsetIconView()\fP. 
.PP
Definition at line 66 of file kiconviewsearchline.cpp.
.PP
References init().
.SS "KIconViewSearchLine::~\fBKIconViewSearchLine\fP ()\fC [virtual]\fP"
.PP
Destroys the KIconViewSearchLine. 
.PP
Definition at line 73 of file kiconviewsearchline.cpp.
.PP
References clear().
.SH "Member Function Documentation"
.PP 
.SS "bool KIconViewSearchLine::caseSensitive () const"
.PP
Returns true if the search is case sensitive. 
.PP
This defaults to false.
.PP
\fBSee also:\fP
.RS 4
\fBsetCaseSensitive()\fP 
.RE
.PP

.PP
Definition at line 79 of file kiconviewsearchline.cpp.
.PP
Referenced by itemMatches().
.SS "\fBQIconView\fP * KIconViewSearchLine::iconView () const"
.PP
Returns the iconview that is currently filtered by the search. 
.PP
\fBSee also:\fP
.RS 4
\fBsetIconView()\fP 
.RE
.PP

.PP
Definition at line 84 of file kiconviewsearchline.cpp.
.PP
Referenced by init(), and KIconViewSearchLine().
.SS "void KIconViewSearchLine::updateSearch (const \fBQString\fP & s = \fCQString::null\fP)\fC [virtual, slot]\fP"
.PP
Updates search to only make visible the items that match \fIs\fP. 
.PP
If \fIs\fP is null then the line edit's text will be used. 
.PP
Definition at line 92 of file kiconviewsearchline.cpp.
.PP
References QValueList::begin(), QIconView::currentItem(), QValueList::end(), QIconView::ensureItemVisible(), QIconView::firstItem(), hideItem(), itemMatches(), QIconViewItem::nextItem(), showItem(), QIconView::sort(), and QLineEdit::text().
.PP
Referenced by activateSearch().
.SS "void KIconViewSearchLine::setCaseSensitive (bool cs)\fC [slot]\fP"
.PP
Make the search case sensitive or case insensitive. 
.PP
\fBSee also:\fP
.RS 4
caseSenstive() 
.RE
.PP

.PP
Definition at line 164 of file kiconviewsearchline.cpp.
.SS "void KIconViewSearchLine::setIconView (\fBQIconView\fP * iv)\fC [slot]\fP"
.PP
Sets the \fBQIconView\fP that is filtered by this search line. 
.PP
If \fIlv\fP is null then the widget will be disabled.
.PP
\fBSee also:\fP
.RS 4
\fBiconView()\fP 
.RE
.PP

.PP
Definition at line 169 of file kiconviewsearchline.cpp.
.SS "void KIconViewSearchLine::clear ()\fC [virtual, slot]\fP"
.PP
Clear line edit and empty hiddenItems, returning elements to iconView. 
.PP
Reimplemented from \fBKLineEdit\fP.
.PP
Definition at line 137 of file kiconviewsearchline.cpp.
.PP
References KLineEdit::clear(), endl(), kdDebug(), and showItem().
.PP
Referenced by ~KIconViewSearchLine().
.SS "bool KIconViewSearchLine::itemMatches (const \fBQIconViewItem\fP * item, const \fBQString\fP & s) const\fC [protected, virtual]\fP"
.PP
Returns true if \fIitem\fP matches the search \fIs\fP. 
.PP
This will be evaluated based on the value of \fBcaseSensitive()\fP. This can be overridden in subclasses to implement more complicated matching schemes. 
.PP
Definition at line 190 of file kiconviewsearchline.cpp.
.PP
References caseSensitive().
.PP
Referenced by updateSearch().
.SS "void KIconViewSearchLine::init (\fBQIconView\fP * iconView = \fC0\fP)\fC [protected]\fP"
.PP
Do initialization common to both constructors. 
.PP
Definition at line 202 of file kiconviewsearchline.cpp.
.PP
References iconView(), queueSearch(), and QLineEdit::textChanged().
.PP
Referenced by KIconViewSearchLine().
.SS "void KIconViewSearchLine::hideItem (\fBQIconViewItem\fP * item)\fC [protected]\fP"
.PP
Hide item. 
.PP
Definition at line 222 of file kiconviewsearchline.cpp.
.PP
References QIconView::takeItem().
.PP
Referenced by updateSearch().
.SS "void KIconViewSearchLine::showItem (\fBQIconViewItem\fP * item)\fC [protected]\fP"
.PP
Show item. 
.PP
Just unhide it, doesn't necessary show it on screen, for that use iconView->ensureItemVisible() 
.PP
Definition at line 231 of file kiconviewsearchline.cpp.
.PP
References endl(), and kdDebug().
.PP
Referenced by clear(), and updateSearch().
.SS "void KIconViewSearchLine::queueSearch (const \fBQString\fP & s)\fC [protected, slot]\fP"
.PP
When keys are pressed a new search string is created and a timer is activated. 
.PP
The most recent search is activated when this timer runs out if another key has not yet been pressed.
.PP
This method makes 
.PP
\fBParameters:\fP
.RS 4
\fIs\fP the most recent search and starts the timer.
.RE
.PP
Together with \fBactivateSearch()\fP this makes it such that searches are not started until there is a short break in the users typing.
.PP
\fBSee also:\fP
.RS 4
\fBactivateSearch()\fP 
.RE
.PP

.PP
Definition at line 247 of file kiconviewsearchline.cpp.
.PP
References activateSearch(), and QTimer::singleShot().
.PP
Referenced by init().
.SS "void KIconViewSearchLine::activateSearch ()\fC [protected, slot]\fP"
.PP
When the timer started with \fBqueueSearch()\fP expires this slot is called. 
.PP
If there has been another timer started then this slot does nothing. However if there are no other pending searches this starts the icon view search.
.PP
\fBSee also:\fP
.RS 4
\fBqueueSearch()\fP 
.RE
.PP

.PP
Definition at line 254 of file kiconviewsearchline.cpp.
.PP
References updateSearch().
.PP
Referenced by queueSearch().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
