Nepomuk
#include <Nepomuk/Utils/SearchWidget>
Public Types | |
enum | ConfigFlag { NoConfigFlags = 0x0, ShowFacets = 0x1, SearchWhileYouType = 0x2, DefaultConfigFlags = ShowFacets } |
Public Slots | |
void | setBaseQuery (const Nepomuk::Query::Query &query) |
Nepomuk::Query::Query | setQuery (const Nepomuk::Query::Query &query) |
Signals | |
void | currentResourceChanged (const Nepomuk::Resource &previous, const Nepomuk::Resource ¤t) |
void | selectionChanged () |
Public Member Functions | |
SearchWidget (QWidget *parent=0) | |
~SearchWidget () | |
Query::Query | baseQuery () const |
ConfigFlags | configFlags () const |
Resource | currentResource () const |
FacetWidget * | facetWidget () const |
Query::Query | query () const |
QList< Resource > | selectedResources () const |
QAbstractItemView::SelectionMode | selectionMode () const |
void | setConfigFlags (ConfigFlags flags) |
void | setSelectionMode (QAbstractItemView::SelectionMode mode) |
Static Public Member Functions | |
static Nepomuk::Resource | searchResource (QWidget *parent=0, const Nepomuk::Query::Query &baseQuery=Nepomuk::Query::Query(), SearchWidget::ConfigFlags flags=SearchWidget::DefaultConfigFlags) |
static QList< Nepomuk::Resource > | searchResources (QWidget *parent=0, const Nepomuk::Query::Query &baseQuery=Nepomuk::Query::Query(), SearchWidget::ConfigFlags flags=SearchWidget::DefaultConfigFlags) |
Detailed Description
Provides a GUI for searching files or resources of any type.
The SearchWidget combines the different search GUI elements provided in Nepomuk in one widget: a line edit which allows to type in a query and the facet widget.
The SearchWidget allows to specify a base query which is fixed and cannot be changed by the user. This allows to restrict the set of resources searched by the user.
- Since
- 4.6
Definition at line 54 of file searchwidget.h.
Member Enumeration Documentation
The config flags can be used to configure the search widget to fit the needs of the application.
Definition at line 73 of file searchwidget.h.
Constructor & Destructor Documentation
Nepomuk::Utils::SearchWidget::SearchWidget | ( | QWidget * | parent = 0 | ) |
Constructor.
Nepomuk::Utils::SearchWidget::~SearchWidget | ( | ) |
Destructor.
Member Function Documentation
Query::Query Nepomuk::Utils::SearchWidget::baseQuery | ( | ) | const |
- Returns
- the base query set via setBaseQuery().
ConfigFlags Nepomuk::Utils::SearchWidget::configFlags | ( | ) | const |
The config flags set via setConfigFlags().
Resource Nepomuk::Utils::SearchWidget::currentResource | ( | ) | const |
- Returns
- the current resource if any, an invalid resource if none is selected
|
signal |
Emited when current resource is changed.
FacetWidget* Nepomuk::Utils::SearchWidget::facetWidget | ( | ) | const |
The facet widget that is used internally.
By default a predefined set of facets is used. This method can be used to access the FacetWidget in order to change its configuration.
Query::Query Nepomuk::Utils::SearchWidget::query | ( | ) | const |
Construct the query currently used by this widget including the baseQuery(), all facets, and the user desktop query.
|
static |
Creates a dialog embedding a SearchWidget that allows the user to select one resource from the result set.
- Returns
- The Resource the user selected or an invalid one in case there was no result to choose or the user canceled the search.
|
static |
Creates a dialog embedding a SearchWidget that allows the user to select resources from the result set.
- Returns
- The resources the user selected or an empty list in case there was no result to choose or the user canceled the search.
QList<Resource> Nepomuk::Utils::SearchWidget::selectedResources | ( | ) | const |
- Returns
- a list of all selected resources.
|
signal |
Emitted when the selection is changed, ie.
the values returned by currentResource() and selectedResources() have changed.
QAbstractItemView::SelectionMode Nepomuk::Utils::SearchWidget::selectionMode | ( | ) | const |
- Returns
- the selection mode of the view
|
slot |
Set the base query.
The base query is the fixed part of the query which cannot be changed by the user. It allows to restrict the searched set of resources.
Be default the base query is empty, ie. an invalid Query.
- Parameters
-
query The new base query.
Be aware that setting the base query will reset widget's query components.
void Nepomuk::Utils::SearchWidget::setConfigFlags | ( | ConfigFlags | flags | ) |
|
slot |
Set the query currently configured in the widget.
Parts that cannot be converted into facets or a user desktop query string are returned.
- Parameters
-
query The query that the widget should represent after the call.
- Returns
- The rest query which could not be converted into facets and a desktop query.
void Nepomuk::Utils::SearchWidget::setSelectionMode | ( | QAbstractItemView::SelectionMode | mode | ) |
Sets the selection mode of the view to mode
.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.