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) |
![]() | |
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 |
![]() | |
Facet (QObject *parent=0) | |
virtual | ~Facet () |
Query::Query | clientQuery () const |
virtual QString | text (int index) const |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Additional Inherited Members | |
![]() | |
enum | SelectionMode { MatchAll, MatchAny, MatchOne } |
![]() | |
void | layoutChanged (Nepomuk::Utils::Facet *facet) |
void | queryTermChanged (Nepomuk::Utils::Facet *facet, const Nepomuk::Query::Term &queryTerm) |
void | selectionChanged (Nepomuk::Utils::Facet *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) |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
void | setLayoutChanged () |
void | setQueryTermChanged () |
void | setSelectionChanged () |
![]() | |
virtual void | handleClientQueryChange () |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.