kiconviewsearchline.h
00001 /* 00002 This file is part of the KDE libraries 00003 Copyright (c) 2004 Gustavo Sverzut Barbieri <gsbarbieri@users.sourceforge.net> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KICONVIEWSEARCHLINE_H 00021 #define KICONVIEWSEARCHLINE_H 00022 00023 #include <klineedit.h> 00024 #include <qvaluelist.h> 00025 00026 class QIconView; 00027 class QIconViewItem; 00028 00038 class KDEUI_EXPORT KIconViewSearchLine : public KLineEdit 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 00051 KIconViewSearchLine( QWidget *parent = 0, 00052 QIconView *iconView = 0, 00053 const char *name = 0 ); 00054 00059 KIconViewSearchLine( QWidget *parent, const char *name ); 00060 00064 virtual ~KIconViewSearchLine(); 00065 00071 bool caseSensitive() const; 00072 00078 QIconView *iconView() const; 00079 00080 00081 public slots: 00086 virtual void updateSearch( const QString &s = QString::null ); 00087 00093 void setCaseSensitive( bool cs ); 00094 00101 void setIconView( QIconView *iv ); 00102 00103 00107 void clear(); 00108 00109 00110 protected: 00116 virtual bool itemMatches( const QIconViewItem *item, 00117 const QString &s ) const; 00118 00119 00123 void init( QIconView *iconView = 0 ); 00124 00128 void hideItem( QIconViewItem *item ); 00129 00136 void showItem( QIconViewItem *item ); 00137 00138 00139 protected slots: 00153 void queueSearch( const QString &s ); 00154 00163 void activateSearch(); 00164 00165 00166 private slots: 00170 void iconViewDeleted(); 00171 00172 00173 private: 00174 class KIconViewSearchLinePrivate; 00175 KIconViewSearchLinePrivate *d; 00176 }; 00177 00178 00179 #endif /* KICONVIEWSEARCHLINE_H */