• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

Plasma

ktreeviewsearchline.h

Go to the documentation of this file.
00001 /*
00002    Copyright (c) 2003 Scott Wheeler <wheeler@kde.org>
00003    Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
00004    Copyright (c) 2006 Hamish Rodda <rodda@kde.org>
00005    Copyright 2007 Pino Toscano <pino@kde.org>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License version 2 as published by the Free Software Foundation.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KTREEVIEWSEARCHLINE_H
00023 #define KTREEVIEWSEARCHLINE_H
00024 
00025 #include <klineedit.h>
00026 
00027 class QModelIndex;
00028 class QTreeView;
00029 
00038 class KTreeViewSearchLine : public KLineEdit
00039 {
00040     Q_OBJECT
00041 
00042     Q_PROPERTY( Qt::CaseSensitivity caseSensitity READ caseSensitivity WRITE setCaseSensitivity )
00043     Q_PROPERTY( bool keepParentsVisible READ keepParentsVisible WRITE setKeepParentsVisible )
00044 
00045 
00046   public:
00054     explicit KTreeViewSearchLine( QWidget *parent = 0, QTreeView *treeView = 0 );
00055 
00063     KTreeViewSearchLine( QWidget *parent, const QList<QTreeView *> &treeViews );
00064 
00065 
00069     virtual ~KTreeViewSearchLine();
00070 
00076     Qt::CaseSensitivity caseSensitivity() const;
00077 
00084     QList<int> searchColumns() const;
00085 
00092     bool keepParentsVisible() const;
00093 
00100     QTreeView *treeView() const;
00101 
00108     QList<QTreeView *> treeViews() const;
00109 
00110   public Q_SLOTS:
00117     void addTreeView( QTreeView *treeView );
00118 
00126     void removeTreeView( QTreeView *treeView );
00127 
00132     virtual void updateSearch( const QString &pattern = QString() );
00133 
00139     void setCaseSensitivity( Qt::CaseSensitivity caseSensitivity );
00140 
00151     void setKeepParentsVisible( bool value );
00152 
00162     void setSearchColumns( const QList<int> &columns );
00163 
00171     void setTreeView( QTreeView *treeView );
00172 
00180     void setTreeViews( const QList<QTreeView *> &treeViews );
00181 
00182 
00183   protected:
00189     virtual bool itemMatches( const QModelIndex &item, int row, const QString &pattern ) const;
00190 
00194     virtual void contextMenuEvent( QContextMenuEvent* );
00195 
00200     virtual void updateSearch( QTreeView *treeView );
00201 
00206     virtual void connectTreeView( QTreeView* );
00207 
00211     virtual void disconnectTreeView( QTreeView* );
00212 
00227     virtual bool canChooseColumnsCheck();
00228 
00229   protected Q_SLOTS:
00243     void queueSearch( const QString &search );
00244 
00253     void activateSearch();
00254 
00255   private:
00256     class Private;
00257     Private* const d;
00258 
00259     Q_PRIVATE_SLOT( d, void rowsInserted( const QModelIndex&, int, int ) const )
00260     Q_PRIVATE_SLOT( d, void treeViewDeleted( QObject* ) )
00261     Q_PRIVATE_SLOT( d, void slotColumnActivated( QAction* ) )
00262     Q_PRIVATE_SLOT( d, void slotAllVisibleColumns() )
00263 };
00264 
00269 class KTreeViewSearchLineWidget : public QWidget
00270 {
00271     Q_OBJECT
00272 
00273   public:
00278     explicit KTreeViewSearchLineWidget( QWidget *parent = 0, QTreeView *treeView = 0 );
00279 
00283     ~KTreeViewSearchLineWidget();
00284 
00288     KTreeViewSearchLine *searchLine() const;
00289 
00290   protected Q_SLOTS:
00297     virtual void createWidgets();
00298 
00299   protected:
00307     virtual KTreeViewSearchLine *createSearchLine( QTreeView *treeView ) const;
00308 
00309   private:
00310     class Private;
00311     Private* const d;
00312 };
00313 
00314 #endif

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal