digiKam
Digikam::SearchTextBarDb Class Reference
+ Inheritance diagram for Digikam::SearchTextBarDb:

Public Types

enum  HighlightState { NEUTRAL , HAS_RESULT , NO_RESULT }
 
enum  StateSavingDepth { INSTANCE , DIRECT_CHILDREN , RECURSIVE }
 

Public Slots

void slotSearchResult (bool match)
 

Signals

void completerActivated ()
 
void completerHighlighted (int albumId)
 
void signalSearchTextSettings (const SearchTextSettings &settings)
 

Public Member Functions

ModelCompletercompleterModel () const
 
HighlightState getCurrentHighlightState () const
 
StateSavingDepth getStateSavingDepth () const
 
bool hasCaseSensitive () const
 
bool hasTextQueryCompletion () const
 
void loadState ()
 
void saveState ()
 
 SearchTextBarDb (QWidget *const parent, const QString &name, const QString &msg=QString())
 
SearchTextSettings searchTextSettings () const
 
void setCaseSensitive (bool b)
 
virtual void setConfigGroup (const KConfigGroup &group)
 
virtual void setEntryPrefix (const QString &prefix)
 
void setFilterModel (AlbumFilterModel *const filterModel)
 
void setHighlightOnResult (bool highlight)
 
void setModel (AbstractAlbumModel *const model)
 
void setModel (QAbstractItemModel *model, int uniqueIdRole, int displayRole=Qt::DisplayRole)
 
void setSearchTextSettings (const SearchTextSettings &settings)
 
void setStateSavingDepth (const StateSavingDepth depth)
 
void setTextQueryCompletion (bool b)
 
 ~SearchTextBarDb () override
 

Protected Member Functions

void doLoadState () override
 
void doSaveState () override
 
QString entryName (const QString &base) const
 
KConfigGroup getConfigGroup () const
 

Detailed Description

A text input for searching entries with visual feedback. Can be used on Database Models.

Author
Gilles Caulier

Member Enumeration Documentation

◆ HighlightState

Possible highlighting states a SearchTextBar can have.

Enumerator
NEUTRAL 

No highlighting at all. Background is colored in a neutral way according to the theme.

HAS_RESULT 

The background color of the text input indicates that a result was found.

NO_RESULT 

The background color indicates that no result was found.

◆ StateSavingDepth

This enum defines the "depth" of the StateSavingObject::loadState() and StateSavingObject::saveState() methods.

Enumerator
INSTANCE 

Only the instance the saving / restoring was invoked on is saved / restored.

DIRECT_CHILDREN 

The instance itself and all direct children of this instance implementing StateSavingObject are saved / restored.

RECURSIVE 

The instance and all children in the complete hierarchy are saved / restored.

Constructor & Destructor Documentation

◆ SearchTextBarDb()

Digikam::SearchTextBarDb::SearchTextBarDb ( QWidget *const  parent,
const QString &  name,
const QString &  msg = QString() 
)
explicit

◆ ~SearchTextBarDb()

Digikam::SearchTextBarDb::~SearchTextBarDb ( )
override

Member Function Documentation

◆ completerActivated

void Digikam::SearchTextBar::completerActivated ( )
signalinherited

◆ completerHighlighted

void Digikam::SearchTextBar::completerHighlighted ( int  albumId)
signalinherited

◆ completerModel()

ModelCompleter * Digikam::SearchTextBar::completerModel ( ) const
inherited

Referenced by setModel().

◆ doLoadState()

void Digikam::SearchTextBar::doLoadState ( )
overrideprotectedvirtualinherited

Implement this hook method for state loading. Use getConfigGroup() and entryName() for the implementation.

Implements Digikam::StateSavingObject.

References Digikam::StateSavingObject::entryName(), and Digikam::StateSavingObject::getConfigGroup().

◆ doSaveState()

void Digikam::SearchTextBar::doSaveState ( )
overrideprotectedvirtualinherited

Implement this hook method for state saving. Use getConfigGroup() and entryName() for the implementation.

Implements Digikam::StateSavingObject.

References Digikam::StateSavingObject::entryName(), and Digikam::StateSavingObject::getConfigGroup().

◆ entryName()

QString Digikam::StateSavingObject::entryName ( const QString &  base) const
protectedinherited

Always use this method to create config group entry names. This allows to manipulate the entry keys externally by eg. setting a prefix.

Parameters
baseoriginal name planned for the config group entry
Returns
entry name after manipulating it with externally set parameters

Referenced by Digikam::FilterSideBarWidget::doLoadState(), Digikam::AbstractAlbumTreeView::doLoadState(), Digikam::AbstractCheckableAlbumTreeView::doLoadState(), Digikam::LabelsTreeView::doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagCheckView::doLoadState(), Digikam::Sidebar::doLoadState(), Digikam::SearchTextBar::doLoadState(), ShowFoto::ShowfotoFolderViewSideBar::doLoadState(), ShowFoto::ShowfotoStackViewSideBar::doLoadState(), Digikam::FaceScanWidget::doLoadState(), Digikam::FuzzySearchView::doLoadState(), Digikam::GPSSearchView::doLoadState(), Digikam::FilterSideBarWidget::doSaveState(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AbstractCheckableAlbumTreeView::doSaveState(), Digikam::LabelsTreeView::doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagCheckView::doSaveState(), Digikam::Sidebar::doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), and Digikam::GPSSearchView::doSaveState().

◆ getConfigGroup()

KConfigGroup Digikam::StateSavingObject::getConfigGroup ( ) const
protectedinherited

Returns the config group that must be used for state saving and loading.

Returns
config group for state saving and loading

Referenced by Digikam::AlbumFolderViewSideBarWidget::AlbumFolderViewSideBarWidget(), Digikam::DateFolderViewSideBarWidget::DateFolderViewSideBarWidget(), Digikam::FilterSideBarWidget::doLoadState(), Digikam::TagViewSideBarWidget::doLoadState(), Digikam::TimelineSideBarWidget::doLoadState(), Digikam::MapWidgetView::doLoadState(), Digikam::TableView::doLoadState(), Digikam::AbstractAlbumTreeView::doLoadState(), Digikam::AbstractCheckableAlbumTreeView::doLoadState(), Digikam::LabelsTreeView::doLoadState(), Digikam::ImportItemPropertiesSideBarImport::doLoadState(), Digikam::ItemPropertiesSideBar::doLoadState(), Digikam::ItemPropertiesSideBarDB::doLoadState(), Digikam::TagsManager::doLoadState(), Digikam::TagCheckView::doLoadState(), Digikam::Sidebar::doLoadState(), Digikam::SearchTextBar::doLoadState(), ShowFoto::ShowfotoFolderViewSideBar::doLoadState(), ShowFoto::ShowfotoStackViewSideBar::doLoadState(), Digikam::FaceScanWidget::doLoadState(), Digikam::FuzzySearchView::doLoadState(), Digikam::GPSSearchView::doLoadState(), Digikam::FilterSideBarWidget::doSaveState(), Digikam::TagViewSideBarWidget::doSaveState(), Digikam::TimelineSideBarWidget::doSaveState(), Digikam::MapWidgetView::doSaveState(), Digikam::TableView::doSaveState(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AbstractCheckableAlbumTreeView::doSaveState(), Digikam::LabelsTreeView::doSaveState(), Digikam::ImportItemPropertiesSideBarImport::doSaveState(), Digikam::ItemPropertiesSideBar::doSaveState(), Digikam::ItemPropertiesSideBarDB::doSaveState(), Digikam::TagsManager::doSaveState(), Digikam::TagCheckView::doSaveState(), Digikam::Sidebar::doSaveState(), Digikam::SearchTextBar::doSaveState(), ShowFoto::ShowfotoFolderViewSideBar::doSaveState(), ShowFoto::ShowfotoStackViewSideBar::doSaveState(), Digikam::FaceScanWidget::doSaveState(), Digikam::FuzzySearchView::doSaveState(), Digikam::GPSSearchView::doSaveState(), Digikam::FuzzySearchSideBarWidget::FuzzySearchSideBarWidget(), Digikam::GPSSearchSideBarWidget::GPSSearchSideBarWidget(), Digikam::LabelsSideBarWidget::LabelsSideBarWidget(), Digikam::PeopleSideBarWidget::PeopleSideBarWidget(), Digikam::SearchSideBarWidget::SearchSideBarWidget(), Digikam::TagsManager::setupUi(), Digikam::TagViewSideBarWidget::TagViewSideBarWidget(), and Digikam::TimelineSideBarWidget::TimelineSideBarWidget().

◆ getCurrentHighlightState()

SearchTextBar::HighlightState Digikam::SearchTextBar::getCurrentHighlightState ( ) const
inherited

Tells the current highlighting state of the text input indicated via the background color.

Returns
current highlight state

References Digikam::SearchTextBar::HAS_RESULT, Digikam::SearchTextBar::NEUTRAL, and Digikam::SearchTextBar::NO_RESULT.

◆ getStateSavingDepth()

StateSavingObject::StateSavingDepth Digikam::StateSavingObject::getStateSavingDepth ( ) const
inherited

Returns the depth used for state saving or loading. Default is StateSavingDepth::INSTANCE.

Returns
state saving / restoring depth

◆ hasCaseSensitive()

bool Digikam::SearchTextBar::hasCaseSensitive ( ) const
inherited

◆ hasTextQueryCompletion()

bool Digikam::SearchTextBar::hasTextQueryCompletion ( ) const
inherited

◆ loadState()

void Digikam::StateSavingObject::loadState ( )
inherited

◆ saveState()

◆ searchTextSettings()

SearchTextSettings Digikam::SearchTextBar::searchTextSettings ( ) const
inherited

◆ setCaseSensitive()

void Digikam::SearchTextBar::setCaseSensitive ( bool  b)
inherited

Indicate whether this search text bar can be toggled to between case- sensitive and -insensitive or if always case-insensitive shall be used.

Parameters
bif true the user can decide the toggle between case sensitivity, on false every search is case- insensitive

References Digikam::SearchTextBar::signalSearchTextSettings().

◆ setConfigGroup()

void Digikam::StateSavingObject::setConfigGroup ( const KConfigGroup &  group)
virtualinherited

Sets a dedicated config group that will be used to store and reload the state from. If this method is not called, a group based on the object name is used.

You can re-implement this method to pass the group set here to child objects. Don't forget to call this method in your implementation.

Parameters
groupconfig group to use for state saving and restoring

Reimplemented in Digikam::GPSSearchView, Digikam::FuzzySearchView, Digikam::FilterSideBarWidget, and Digikam::DateFolderView.

Referenced by Digikam::ImageWindow::closeEvent(), Digikam::DateFolderView::setConfigGroup(), Digikam::FilterSideBarWidget::setConfigGroup(), Digikam::FuzzySearchView::setConfigGroup(), and Digikam::GPSSearchView::setConfigGroup().

◆ setEntryPrefix()

void Digikam::StateSavingObject::setEntryPrefix ( const QString &  prefix)
virtualinherited

Define a prefix that will be used for every entry in the config group. The default prefix is empty.

You can re-implement this method to pass the prefix set here to child objects. Don't forget to call this method in your implementation.

Parameters
prefixthe prefix to use for the config entries

References prefix.

◆ setFilterModel()

void Digikam::SearchTextBarDb::setFilterModel ( AlbumFilterModel *const  filterModel)

Sets the filter model this text bar shall use to invoke filtering on and reading the result for highlighting from.

Parameters
filterModelfilter model to use for filtering. null means there is no model to use and external connections need to be created with signalSearchTextSettings and slotSearchResult

References Digikam::SearchTextBar::setSearchTextSettings(), Digikam::SearchTextBar::signalSearchTextSettings(), and Digikam::SearchTextBar::slotSearchResult().

Referenced by Digikam::FuzzySearchView::FuzzySearchView().

◆ setHighlightOnResult()

void Digikam::SearchTextBar::setHighlightOnResult ( bool  highlight)
inherited

Tells whether highlighting for found search results shall be used or not (green and red).

Default behavior has highlighting enabled.

Parameters
highlighttrue activates green and red highlighting, with false the normal widget background color will be displayed always

◆ setModel() [1/2]

void Digikam::SearchTextBarDb::setModel ( AbstractAlbumModel *const  model)

Sets the album model this text bar shall use to invoke filtering on and reading the result for highlighting from.

Parameters
modelalbum model to use for filtering. null means there is no model to use and external connections need to be created with signalSearchTextSettings and slotSearchResult

References Digikam::AbstractAlbumModel::AlbumIdRole, Digikam::AbstractAlbumModel::AlbumTitleRole, Digikam::SearchTextBar::completerModel(), and Digikam::ModelCompleter::setItemModel().

◆ setModel() [2/2]

void Digikam::SearchTextBarDb::setModel ( QAbstractItemModel *  model,
int  uniqueIdRole,
int  displayRole = Qt::DisplayRole 
)

If the given model is != null, the model is used to populate the completion for this text field.

Parameters
modelto fill from or null for manual mode
uniqueIdRolea role for which the model will return a unique integer for each entry
displayRolethe role to retrieve the text for completion, default is Qt::DisplayRole.

References Digikam::SearchTextBar::completerModel(), and Digikam::ModelCompleter::setItemModel().

Referenced by Digikam::FuzzySearchView::FuzzySearchView().

◆ setSearchTextSettings()

void Digikam::SearchTextBar::setSearchTextSettings ( const SearchTextSettings settings)
inherited

Referenced by setFilterModel().

◆ setStateSavingDepth()

void Digikam::StateSavingObject::setStateSavingDepth ( const StateSavingDepth  depth)
inherited

Sets the depth used for state saving or loading.

Parameters
depthnew depth to use

◆ setTextQueryCompletion()

void Digikam::SearchTextBar::setTextQueryCompletion ( bool  b)
inherited

◆ signalSearchTextSettings

void Digikam::SearchTextBar::signalSearchTextSettings ( const SearchTextSettings settings)
signalinherited

◆ slotSearchResult

void Digikam::SearchTextBar::slotSearchResult ( bool  match)
slotinherited

Referenced by setFilterModel().


The documentation for this class was generated from the following files: