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

Nepomuk

  • Nepomuk
  • Utils
  • SimpleFacet
Public Slots | Public Member Functions | List of all members
Nepomuk::Utils::SimpleFacet Class Reference
The Facet API

#include <Nepomuk/Utils/SimpleFacet>

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

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
 
- Public Member Functions inherited from QObject
 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 &regExp) 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

- 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)
 
- Static Public Member Functions inherited from QObject
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)
 
- Protected Slots inherited from Nepomuk::Utils::Facet
void setLayoutChanged ()
 
void setQueryTermChanged ()
 
void setSelectionChanged ()
 
- Protected Member Functions inherited from Nepomuk::Utils::Facet
virtual void handleClientQueryChange ()
 
- Protected Member Functions inherited from QObject
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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 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.

Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
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

void Nepomuk::Utils::SimpleFacet::addTerm ( const QString &  text,
const Nepomuk::Query::Term &  queryTerm 
)
slot

Add a new term.

This is equivalent to calling

addTerm(KGuiItem(text), term);
void Nepomuk::Utils::SimpleFacet::addTerm ( const KGuiItem &  item,
const Nepomuk::Query::Term &  queryTerm 
)
slot

Add a new term.

Parameters
itemThe gui item used to present the choice to the user.
termThe query term which represents this choice.
void Nepomuk::Utils::SimpleFacet::clear ( )
slot

Clear the list of terms.

void Nepomuk::Utils::SimpleFacet::clearSelection ( )
slot

Clear the selection.

If selectionMode() is MatchOne the first choice should be selected.

int Nepomuk::Utils::SimpleFacet::count ( ) const
virtual
Returns
The number of terms added via addTerm().

Implements Nepomuk::Utils::Facet.

KGuiItem Nepomuk::Utils::SimpleFacet::guiItem ( int  index) const
virtual
Returns
The gui item set via addTerm() for the Term at index or an empty KGuiItem if index is out of range.

Reimplemented from Nepomuk::Utils::Facet.

bool Nepomuk::Utils::SimpleFacet::isSelected ( int  index) const
virtual
Returns
true if the term at index has been selected via setSelected().

Implements Nepomuk::Utils::Facet.

Query::Term Nepomuk::Utils::SimpleFacet::queryTerm ( ) const
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.

bool Nepomuk::Utils::SimpleFacet::selectFromTerm ( const Nepomuk::Query::Term &  queryTerm)
slot

The term is analyzed depending on the selectionMode().

See also
Facet::selectFromTerm()
SelectionMode Nepomuk::Utils::SimpleFacet::selectionMode ( ) const
virtual

The selection mode set via setSelectionMode()

Implements Nepomuk::Utils::Facet.

void Nepomuk::Utils::SimpleFacet::setSelected ( int  index,
bool  selected = true 
)
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 if index is out of range.

The documentation for this class was generated from the following file:
  • simplefacet.h
This file is part of the KDE documentation.
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.

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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • 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