libkdepim Library API Documentation

KPIM::KListViewSearchLine Class Reference

This class makes it easy to add a search line for filtering the items in a listview based on a simple text search. More...

#include <klistviewsearchline_pimcopy.h>

List of all members.

Public Slots

virtual void updateSearch (const QString &s=QString::null)
void setCaseSensitive (bool cs)
void setKeepParentsVisible (bool v)
void setSearchColumns (const QValueList< int > &columns)
void setListView (KListView *lv)

Public Member Functions

 KListViewSearchLine (QWidget *parent=0, KListView *listView=0, const char *name=0)
virtual ~KListViewSearchLine ()
bool caseSensitive () const
QValueList< int > searchColumns () const
bool keepParentsVisible () const
KListView * listView () const

Protected Slots

void queueSearch (const QString &search)
void activateSearch ()

Protected Member Functions

virtual bool itemMatches (const QListViewItem *item, const QString &s) const
virtual QPopupMenucreatePopupMenu ()


Detailed Description

This class makes it easy to add a search line for filtering the items in a listview based on a simple text search.

No changes to the application other than instantiating this class with an appropriate KListView should be needed.

Definition at line 37 of file klistviewsearchline_pimcopy.h.


Constructor & Destructor Documentation

KPIM::KListViewSearchLine::KListViewSearchLine QWidget parent = 0,
KListView *  listView = 0,
const char *  name = 0
 

Constructs a KListViewSearchLine with listView being the KListView to be filtered.

If listView is null then the widget will be disabled until a listview is set with setListView(). Definition at line 55 of file klistviewsearchline_pimcopy.cpp.

KPIM::KListViewSearchLine::~KListViewSearchLine  )  [virtual]
 

Destroys the KListViewSearchLine.

Definition at line 76 of file klistviewsearchline_pimcopy.cpp.


Member Function Documentation

bool KPIM::KListViewSearchLine::caseSensitive  )  const
 

Returns true if the search is case sensitive.

This defaults to false.

See also:
setCaseSensitive()
Definition at line 81 of file klistviewsearchline_pimcopy.cpp.

QValueList< int > KPIM::KListViewSearchLine::searchColumns  )  const
 

Returns the current list of columns that will be searched.

If the returned list is empty all columns will be searched.

See also:
setSearchColumns
Definition at line 86 of file klistviewsearchline_pimcopy.cpp.

bool KPIM::KListViewSearchLine::keepParentsVisible  )  const
 

If this is true (the default) then the parents of matched items will also be shown.

See also:
setKeepParentsVisible()
Definition at line 91 of file klistviewsearchline_pimcopy.cpp.

KListView * KPIM::KListViewSearchLine::listView  )  const
 

Returns the listview that is currently filtered by the search.

See also:
setListView()
Definition at line 96 of file klistviewsearchline_pimcopy.cpp.

void KPIM::KListViewSearchLine::updateSearch const QString s = QString::null  )  [virtual, slot]
 

Updates search to only make visible the items that match s.

If s is null then the line edit's text will be used. Definition at line 105 of file klistviewsearchline_pimcopy.cpp.

void KPIM::KListViewSearchLine::setCaseSensitive bool  cs  )  [slot]
 

Make the search case sensitive or case insensitive.

See also:
caseSenstive()
Definition at line 146 of file klistviewsearchline_pimcopy.cpp.

void KPIM::KListViewSearchLine::setKeepParentsVisible bool  v  )  [slot]
 

When a search is active on a list that's organized into a tree view if a parent or ancesestor of an item is does not match the search then it will be hidden and as such so too will any children that match.

If this is set to true (the default) then the parents of matching items will be shown.

See also:
keepParentsVisible
Definition at line 151 of file klistviewsearchline_pimcopy.cpp.

void KPIM::KListViewSearchLine::setSearchColumns const QValueList< int > &  columns  )  [slot]
 

Sets the list of columns to be searched.

The default is to search all, which can be restored by passing columns as an empty list.

See also:
searchColumns
Definition at line 156 of file klistviewsearchline_pimcopy.cpp.

void KPIM::KListViewSearchLine::setListView KListView *  lv  )  [slot]
 

Sets the KListView that is filtered by this search line.

If lv is null then the widget will be disabled.

See also:
listView()
Definition at line 161 of file klistviewsearchline_pimcopy.cpp.

bool KPIM::KListViewSearchLine::itemMatches const QListViewItem item,
const QString s
const [protected, virtual]
 

Returns true if item matches the search s.

This will be evaluated based on the value of caseSensitive(). This can be overridden in subclasses to implement more complicated matching schemes. Definition at line 188 of file klistviewsearchline_pimcopy.cpp.

QPopupMenu * KPIM::KListViewSearchLine::createPopupMenu  )  [protected, virtual]
 

Re-implemented for internal reasons.

API not affected.

See QLineEdit::mousePressEvent(). Definition at line 216 of file klistviewsearchline_pimcopy.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:50:29 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003