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

Nepomuk

  • Nepomuk
  • Utils
  • SearchWidget
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
Nepomuk::Utils::SearchWidget Class Reference

#include <Nepomuk/Utils/SearchWidget>

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

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 &current)
 
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 aoszk.nosp@m.ar@g.nosp@m.mail..nosp@m.com, Sebastian Trueg trueg.nosp@m.@kde.nosp@m..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
void Nepomuk::Utils::SearchWidget::currentResourceChanged ( const Nepomuk::Resource &  previous,
const Nepomuk::Resource &  current 
)
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 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Nepomuk

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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