• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.14
  • kdenetwork
  • kget
  • ui
  • linkview
kget_sortfilterproxymodel.h
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
19 
20 #ifndef KGET_SORTFILTERPROXYMODEL_H
21 #define KGET_SORTFILTERPROXYMODEL_H
22 
23 #include <QSortFilterProxyModel>
24 
25 class KGetSortFilterProxyModel : public QSortFilterProxyModel
26 {
27  Q_OBJECT
28 
29  public:
30  explicit KGetSortFilterProxyModel(int sortColumn, QObject *parent = 0);
31  virtual ~KGetSortFilterProxyModel();
32 
33  enum DownloadFilterType {
34  NoFilter,
35  VideoFiles,
36  AudioFiles,
37  CompressedFiles,
38  ImageFiles
39  };
40 
41  enum FilterMode {
42  Contain,
43  DoesNotContain
44  };
45 
46  void setFilterType(int filterType);
47  void setFilterMode(int filterMode);
48  void setFilterColumn(int column);
49  bool showWebContent() const;
50 
51  public slots:
52  void setShowWebContent(bool show);
53  void setShowWebContent(int show);
54 
55  protected:
56  virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
57 
58  private:
62  bool acceptText(const QString &text) const;
63 
68  QString columnText(int row, const QModelIndex &sourceParent) const;
69 
70  private:
71  int m_filterType;
72  FilterMode m_filterMode;
73  int m_column;
74  bool m_showWebContent;
75  QHash<int, QString> m_mimeTypes;
76 };
77 
78 #endif // KGET_SORTFILTERPROXYMODEL_H
QModelIndex
KGetSortFilterProxyModel::DownloadFilterType
DownloadFilterType
Definition: kget_sortfilterproxymodel.h:33
KGetSortFilterProxyModel::filterAcceptsRow
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
Definition: kget_sortfilterproxymodel.cpp:89
KGetSortFilterProxyModel
Definition: kget_sortfilterproxymodel.h:25
KGetSortFilterProxyModel::CompressedFiles
Definition: kget_sortfilterproxymodel.h:37
KGetSortFilterProxyModel::AudioFiles
Definition: kget_sortfilterproxymodel.h:36
KGetSortFilterProxyModel::VideoFiles
Definition: kget_sortfilterproxymodel.h:35
KGetSortFilterProxyModel::Contain
Definition: kget_sortfilterproxymodel.h:42
QHash< int, QString >
QObject
KGetSortFilterProxyModel::NoFilter
Definition: kget_sortfilterproxymodel.h:34
KGetSortFilterProxyModel::ImageFiles
Definition: kget_sortfilterproxymodel.h:38
QString
KGetSortFilterProxyModel::~KGetSortFilterProxyModel
virtual ~KGetSortFilterProxyModel()
Definition: kget_sortfilterproxymodel.cpp:41
KGetSortFilterProxyModel::showWebContent
bool showWebContent() const
Definition: kget_sortfilterproxymodel.cpp:45
KGetSortFilterProxyModel::setShowWebContent
void setShowWebContent(bool show)
Definition: kget_sortfilterproxymodel.cpp:71
QSortFilterProxyModel
KGetSortFilterProxyModel::setFilterType
void setFilterType(int filterType)
Definition: kget_sortfilterproxymodel.cpp:50
KGetSortFilterProxyModel::FilterMode
FilterMode
Definition: kget_sortfilterproxymodel.h:41
KGetSortFilterProxyModel::setFilterMode
void setFilterMode(int filterMode)
Definition: kget_sortfilterproxymodel.cpp:56
KGetSortFilterProxyModel::setFilterColumn
void setFilterColumn(int column)
Definition: kget_sortfilterproxymodel.cpp:83
QObject::parent
QObject * parent() const
KGetSortFilterProxyModel::DoesNotContain
Definition: kget_sortfilterproxymodel.h:43
QSortFilterProxyModel::sortColumn
int sortColumn() const
KGetSortFilterProxyModel::KGetSortFilterProxyModel
KGetSortFilterProxyModel(int sortColumn, QObject *parent=0)
Definition: kget_sortfilterproxymodel.cpp:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal