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

Nepomuk

  • Nepomuk
  • Utils
  • SearchWidget
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions

Nepomuk::Utils::SearchWidget Class Reference

Provides a GUI for searching files or resources of any type. More...

#include <Nepomuk/Utils/SearchWidget>

Inheritance diagram for Nepomuk::Utils::SearchWidget:
Inheritance graph
[legend]

List of all members.

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 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.

Author:
Oszkar Ambrus <aoszkar@gmail.com>, Sebastian Trueg <trueg@kde.org>
Since:
4.6

Definition at line 54 of file searchwidget.h.


Member Enumeration Documentation

enum Nepomuk::Utils::SearchWidget::ConfigFlag

The config flags can be used to configure the search widget to fit the needs of the application.

Enumerator:
NoConfigFlags 

no flags, a plain search widget

ShowFacets 

show the facets allowing the user to modify the query

SearchWhileYouType 

enable auto searching while the user is typing in the query (live query)

DefaultConfigFlags 

the default: show facets and disable live query

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
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 Nepomuk::Resource Nepomuk::Utils::SearchWidget::searchResource ( QWidget *  parent = 0,
const Nepomuk::Query::Query &  baseQuery = Nepomuk::Query::Query(),
SearchWidget::ConfigFlags  flags = SearchWidget::DefaultConfigFlags 
) [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 QList<Nepomuk::Resource> Nepomuk::Utils::SearchWidget::searchResources ( QWidget *  parent = 0,
const Nepomuk::Query::Query &  baseQuery = Nepomuk::Query::Query(),
SearchWidget::ConfigFlags  flags = SearchWidget::DefaultConfigFlags 
) [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.
void Nepomuk::Utils::SearchWidget::selectionChanged ( ) [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
void Nepomuk::Utils::SearchWidget::setBaseQuery ( const Nepomuk::Query::Query &  query) [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:
queryThe new base query.

Be aware that setting the base query will reset widget's query components.

void Nepomuk::Utils::SearchWidget::setConfigFlags ( ConfigFlags  flags)

Set the config flags to be used.

Defaults to DefaultConfigFlags.

See also:
configFlags()
Nepomuk::Query::Query Nepomuk::Utils::SearchWidget::setQuery ( const Nepomuk::Query::Query &  query) [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:
queryThe 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:
  • searchwidget.h

Nepomuk

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
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