Nepomuk
#include <Nepomuk/Utils/SimpleFacet>
Public Slots | |
void | addTerm (const QString &text, const Nepomuk::Query::Term &queryTerm) |
void | addTerm (const KGuiItem &item, const Nepomuk::Query::Term &queryTerm) |
void | clear () |
void | clearSelection () |
bool | selectFromTerm (const Nepomuk::Query::Term &queryTerm) |
void | setSelected (int index, bool selected=true) |
Public Slots inherited from Nepomuk::Utils::Facet | |
virtual void | clearSelection ()=0 |
virtual bool | selectFromTerm (const Nepomuk::Query::Term &queryTerm)=0 |
void | setClientQuery (const Nepomuk::Query::Query &query) |
virtual void | setSelected (int index, bool selected=true)=0 |
Public Member Functions | |
SimpleFacet (QObject *parent=0) | |
~SimpleFacet () | |
int | count () const |
KGuiItem | guiItem (int index) const |
bool | isSelected (int index) const |
Query::Term | queryTerm () const |
SelectionMode | selectionMode () const |
void | setSelectionMode (SelectionMode mode) |
Query::Term | termAt (int index) const |
Public Member Functions inherited from Nepomuk::Utils::Facet | |
Facet (QObject *parent=0) | |
virtual | ~Facet () |
Query::Query | clientQuery () const |
virtual QString | text (int index) const |
Additional Inherited Members | |
Public Types inherited from Nepomuk::Utils::Facet | |
enum | SelectionMode { MatchAll, MatchAny, MatchOne } |
Signals inherited from Nepomuk::Utils::Facet | |
void | layoutChanged (Nepomuk::Utils::Facet *facet) |
void | queryTermChanged (Nepomuk::Utils::Facet *facet, const Nepomuk::Query::Term &queryTerm) |
void | selectionChanged (Nepomuk::Utils::Facet *facet) |
Static Public Member Functions inherited from Nepomuk::Utils::Facet | |
static Facet * | createDateFacet (QObject *parent=0) |
static Facet * | createFileTypeFacet (QObject *parent=0) |
static Facet * | createPriorityFacet (QObject *parent=0) |
static Facet * | createRatingFacet (QObject *parent=0) |
static Facet * | createTagFacet (QObject *parent=0) |
static Facet * | createTypeFacet (QObject *parent=0) |
Protected Slots inherited from Nepomuk::Utils::Facet | |
void | setLayoutChanged () |
void | setQueryTermChanged () |
void | setSelectionChanged () |
Protected Member Functions inherited from Nepomuk::Utils::Facet | |
virtual void | handleClientQueryChange () |
Detailed Description
A simple facet using a list of terms.
The SimpleFacet maintains a list of Query::Term objects combined with a label (or a full KGuiItem if required). The usage is very simple: Create a new instance of SimpleFacet, add terms via the addTerm() methods, choose a selection mode via setSelectionMode(), and let SimpleFacet do the rest.
SimpleFacet even implements the selectFromTerm() method which provides enhanced user experience by converting queries into facets.
- Since
- 4.6
Definition at line 50 of file simplefacet.h.
Constructor & Destructor Documentation
Nepomuk::Utils::SimpleFacet::SimpleFacet | ( | QObject * | parent = 0 | ) |
Create a new empty facet.
Nepomuk::Utils::SimpleFacet::~SimpleFacet | ( | ) |
Destructor.
Member Function Documentation
|
slot |
|
slot |
Add a new term.
- Parameters
-
item The gui item used to present the choice to the user. term The query term which represents this choice.
|
slot |
Clear the list of terms.
|
slot |
Clear the selection.
If selectionMode() is MatchOne the first choice should be selected.
|
virtual |
- Returns
- The number of terms added via addTerm().
Implements Nepomuk::Utils::Facet.
|
virtual |
- Returns
- The gui item set via addTerm() for the Term at
index
or an empty KGuiItem ifindex
is out of range.
Reimplemented from Nepomuk::Utils::Facet.
|
virtual |
- Returns
true
if the term atindex
has been selected via setSelected().
Implements Nepomuk::Utils::Facet.
|
virtual |
- Returns
- The currently selected Term. Depending on the selectionMode() this is either a single Term, a combination through Query::AndTerm, or a combination through Query::OrTerm.
Implements Nepomuk::Utils::Facet.
|
slot |
The term
is analyzed depending on the selectionMode().
- See also
- Facet::selectFromTerm()
|
virtual |
The selection mode set via setSelectionMode()
Implements Nepomuk::Utils::Facet.
|
slot |
Selects or deselects the term at index
.
Depending on the selectionMode() this will also affect the selection of other terms.
void Nepomuk::Utils::SimpleFacet::setSelectionMode | ( | SelectionMode | mode | ) |
Set the selection mode to use in this facet.
The default is MatchOne.
Query::Term Nepomuk::Utils::SimpleFacet::termAt | ( | int | index | ) | const |
- Returns
- The term set via addTerm() for
index
or an invalid Query::Term ifindex
is out of range.
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:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.