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

digikam

Digikam::AlbumFilterModel

Digikam::AlbumFilterModel Class Reference

#include <albumfiltermodel.h>

Inheritance diagram for Digikam::AlbumFilterModel:
Inheritance graph
[legend]

List of all members.

Public Types

enum  MatchResult {
  NoMatch = 0, TitleMatch, ParentMatch, ChildMatch,
  SpecialMatch
}

Public Slots

void setSearchTextSettings (const SearchTextSettings &settings)

Signals

void filterChanged ()
void hasSearchResult (bool hasResult)
void searchTextSettingsAboutToChange (bool searched, bool willSearch)
void searchTextSettingsChanged (bool wasSearching, bool searched)

Public Member Functions

 AlbumFilterModel (QObject *parent=0)
Album * albumForIndex (const QModelIndex &index) const
QModelIndex indexForAlbum (Album *album) const
virtual bool isFiltering () const
QModelIndex mapFromSourceAlbumModel (const QModelIndex &index) const
QModelIndex mapToSourceAlbumModel (const QModelIndex &index) const
MatchResult matchResult (const QModelIndex &index) const
QModelIndex rootAlbumIndex () const
SearchTextSettings searchTextSettings () const
void setSourceAlbumModel (AlbumFilterModel *source)
void setSourceAlbumModel (AbstractAlbumModel *source)
AbstractAlbumModel * sourceAlbumModel () const

Protected Member Functions

virtual bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const
virtual bool lessThan (const QModelIndex &left, const QModelIndex &right) const
virtual bool matches (Album *album) const
MatchResult matchResult (Album *album) const
virtual void setSourceModel (QAbstractItemModel *model)

Protected Attributes

AlbumFilterModel * m_chainedModel
SearchTextSettings m_settings

Detailed Description

Definition at line 40 of file albumfiltermodel.h.


Member Enumeration Documentation

enum Digikam::AlbumFilterModel::MatchResult
Enumerator:
NoMatch 

This enum can be used as a boolean value if match/no match only is needed.

TitleMatch 
ParentMatch 
ChildMatch 
SpecialMatch 

Definition at line 75 of file albumfiltermodel.h.


Constructor & Destructor Documentation

Digikam::AlbumFilterModel::AlbumFilterModel ( QObject *  parent = 0  ) 

Definition at line 44 of file albumfiltermodel.cpp.


Member Function Documentation

Album * Digikam::AlbumFilterModel::albumForIndex ( const QModelIndex &  index  )  const

Convenience methods.

Definition at line 150 of file albumfiltermodel.cpp.

bool Digikam::AlbumFilterModel::filterAcceptsRow ( int  source_row,
const QModelIndex &  source_parent 
) const [protected, virtual]

Definition at line 220 of file albumfiltermodel.cpp.

void Digikam::AlbumFilterModel::filterChanged (  )  [signal]

Indicates that a new filter was applied to the model.

void Digikam::AlbumFilterModel::hasSearchResult ( bool  hasResult  )  [signal]

Indicates whether the newly applied filter results in a search result or not.

Parameters:
hasResult true if the new filter matches any album, else false
QModelIndex Digikam::AlbumFilterModel::indexForAlbum ( Album *  album  )  const

Definition at line 155 of file albumfiltermodel.cpp.

bool Digikam::AlbumFilterModel::isFiltering (  )  const [virtual]

Returns if the currently applied filters will result in any filtering.

Returns:
true if the current selected filter could result in any filtering without checking if this really happens.

Reimplemented in Digikam::CheckableAlbumFilterModel, and Digikam::SearchFilterModel.

Definition at line 101 of file albumfiltermodel.cpp.

bool Digikam::AlbumFilterModel::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const [protected, virtual]

Definition at line 228 of file albumfiltermodel.cpp.

QModelIndex Digikam::AlbumFilterModel::mapFromSourceAlbumModel ( const QModelIndex &  index  )  const

Definition at line 143 of file albumfiltermodel.cpp.

QModelIndex Digikam::AlbumFilterModel::mapToSourceAlbumModel ( const QModelIndex &  index  )  const

Definition at line 136 of file albumfiltermodel.cpp.

bool Digikam::AlbumFilterModel::matches ( Album *  album  )  const [protected, virtual]

This method provides the basic match checking algorithm.

Return true if this single album matches the current criteria. This method can be overridden to provide custom filtering.

Parameters:
album album to tell if it matches the filter criteria or not.

Reimplemented in Digikam::CheckableAlbumFilterModel, and Digikam::SearchFilterModel.

Definition at line 165 of file albumfiltermodel.cpp.

AlbumFilterModel::MatchResult Digikam::AlbumFilterModel::matchResult ( Album *  album  )  const [protected]

Returns if the filter matches this album (same logic as filterAcceptsRow).

An album matches if the search text settings are found in a parent album's title, in the album's title or in a child album's title, or if it is a special album (root) that is never filtered out.

Definition at line 183 of file albumfiltermodel.cpp.

AlbumFilterModel::MatchResult Digikam::AlbumFilterModel::matchResult ( const QModelIndex &  index  )  const

Returns the MatchResult of an index of this model.

Never returns NoMatch for a valid index, because in this case, the index would rather be filtered out.

Definition at line 178 of file albumfiltermodel.cpp.

QModelIndex Digikam::AlbumFilterModel::rootAlbumIndex (  )  const

Definition at line 160 of file albumfiltermodel.cpp.

SearchTextSettings Digikam::AlbumFilterModel::searchTextSettings (  )  const

Returns the settings currently used for filtering.

Returns:
current settings for filtering.

Definition at line 106 of file albumfiltermodel.cpp.

void Digikam::AlbumFilterModel::searchTextSettingsAboutToChange ( bool  searched,
bool  willSearch 
) [signal]

This signal indicates that a new SearchTextSettings arrived and is about to be applied to the model.

Parameters:
searched true if filtering by text was enabled before applying the new settings
willSearch true if the new settings can result in any filtering by text, else false.
void Digikam::AlbumFilterModel::searchTextSettingsChanged ( bool  wasSearching,
bool  searched 
) [signal]

Indicates that new search text settings were applied.

Parameters:
wasSearching true if this is not a new search that
searched true if the new settings result in any filtering
void Digikam::AlbumFilterModel::setSearchTextSettings ( const SearchTextSettings &  settings  )  [slot]

Accepts new settings used for filtering and applies them to the model.

Parameters:
settings new settings to apply. An empty text will be interpreted as no filtering

Definition at line 58 of file albumfiltermodel.cpp.

void Digikam::AlbumFilterModel::setSourceAlbumModel ( AlbumFilterModel *  source  ) 

Definition at line 117 of file albumfiltermodel.cpp.

void Digikam::AlbumFilterModel::setSourceAlbumModel ( AbstractAlbumModel *  source  ) 

Reimplemented in Digikam::CheckableAlbumFilterModel, and Digikam::SearchFilterModel.

Definition at line 111 of file albumfiltermodel.cpp.

void Digikam::AlbumFilterModel::setSourceModel ( QAbstractItemModel *  model  )  [protected, virtual]

Use setSourceAlbumModel.

See also:
setSourceAlbumModel
Parameters:
model source model

Reimplemented from QSortFilterProxyModel.

Definition at line 123 of file albumfiltermodel.cpp.

AbstractAlbumModel * Digikam::AlbumFilterModel::sourceAlbumModel (  )  const

Reimplemented in Digikam::CheckableAlbumFilterModel.

Definition at line 129 of file albumfiltermodel.cpp.


Member Data Documentation

AlbumFilterModel* Digikam::AlbumFilterModel::m_chainedModel [protected]

Definition at line 170 of file albumfiltermodel.h.

SearchTextSettings Digikam::AlbumFilterModel::m_settings [protected]

Definition at line 169 of file albumfiltermodel.h.


The documentation for this class was generated from the following files:
  • albumfiltermodel.h
  • albumfiltermodel.cpp

digikam

Skip menu "digikam"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • digikam
Generated for API Reference by doxygen 1.5.9-20090814
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