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

Nepomuk

  • Nepomuk
  • Utils
  • FacetWidget
Public Slots | Signals | Public Member Functions

Nepomuk::Utils::FacetWidget Class Reference
The Facet API

A widget providing a list of facets to add filters to a query. More...

#include <Nepomuk/Utils/FacetWidget>

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

List of all members.

Public Slots

void addFacet (Nepomuk::Utils::Facet *facet)
void clear ()
void setFacets (const QList< Nepomuk::Utils::Facet * > &facets)

Signals

void queryTermChanged (const Nepomuk::Query::Term &term)

Public Member Functions

 FacetWidget (QWidget *parent=0)
 ~FacetWidget ()
Nepomuk::Query::Query extractFacetsFromQuery (const Nepomuk::Query::Query &query)
QList< Facet * > facets () const
Nepomuk::Query::Term queryTerm () const
void setClientQuery (const Nepomuk::Query::Query &query)

Detailed Description

A widget providing a list of facets to add filters to a query.

The basic usage of FacetWidget is rather simple: create a new instance, add facets to it through the addFacet() method, connect to the queryTermChanged() signal, and wait for the user to change the filters.

More sophisticated usage involves extractFacetsFromTerm() or setClientQuery(). For more details see the documentation of FacetModel which provides a similar API since FacetWidget is using it internally.

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

Definition at line 57 of file facetwidget.h.


Constructor & Destructor Documentation

Nepomuk::Utils::FacetWidget::FacetWidget ( QWidget *  parent = 0)

Create a new empty FacetWidget.

Nepomuk::Utils::FacetWidget::~FacetWidget ( )

Destructor.


Member Function Documentation

void Nepomuk::Utils::FacetWidget::addFacet ( Nepomuk::Utils::Facet *  facet) [slot]

Add facet to the widget.

Used to populate the widget with facets. Ownership of facet is transferred to the widget.

void Nepomuk::Utils::FacetWidget::clear ( ) [slot]

Remove all facets from the widget.

Nepomuk::Query::Query Nepomuk::Utils::FacetWidget::extractFacetsFromQuery ( const Nepomuk::Query::Query &  query)

Extract as many facets from a query as possible.

This method is not able to handle all kinds of queries but works well on queries created via queryTerm().

Facets supported by this widget will be extracted from term and configured accordingly.

See also:
FacetModel::extractFacetsFromTerm()
Returns:
The rest term after facets have been extracted.
QList<Facet*> Nepomuk::Utils::FacetWidget::facets ( ) const
Returns:
All Facet instances added via addFacet() and setFacets().
Nepomuk::Query::Term Nepomuk::Utils::FacetWidget::queryTerm ( ) const
Returns:
the query term composed by the facets
void Nepomuk::Utils::FacetWidget::queryTermChanged ( const Nepomuk::Query::Term &  term) [signal]

Emitted whenever the facets change, i.e.

when the user changes the selection or it is changed programmatically via extractFacetsFromQuery()

void Nepomuk::Utils::FacetWidget::setClientQuery ( const Nepomuk::Query::Query &  query)

Can be used to set the full query the client is using (this includes facets created through this widget).

It allows the facet system to disable certain choices that would not change the result set or do not make sense otherwise.

See also:
FacetModel::setClientQuery()
void Nepomuk::Utils::FacetWidget::setFacets ( const QList< Nepomuk::Utils::Facet * > &  facets) [slot]

Set facets as the list of facets used in this widget.

Used to populate the widget with facets. Ownership of the facets is transferred to the widget.


The documentation for this class was generated from the following file:
  • facetwidget.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