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

Nepomuk

  • Nepomuk
  • Utils
  • TypeFacet
Public Slots | Public Member Functions

Nepomuk::Utils::TypeFacet Class Reference

#include <typefacet.h>

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

List of all members.

Public Slots

void clearSelection ()
bool selectFromTerm (const Nepomuk::Query::Term &queryTerm)
void setSelected (int index, bool selected=true)

Public Member Functions

 TypeFacet (QObject *parent=0)
 ~TypeFacet ()
int count () const
KGuiItem guiItem (int index) const
bool isSelected (int index) const
Query::Term queryTerm () const
SelectionMode selectionMode () const

Detailed Description

Definition at line 30 of file typefacet.h.


Constructor & Destructor Documentation

Nepomuk::Utils::TypeFacet::TypeFacet ( QObject *  parent = 0)
Nepomuk::Utils::TypeFacet::~TypeFacet ( )

Member Function Documentation

void Nepomuk::Utils::TypeFacet::clearSelection ( ) [virtual, slot]

Clear the selection.

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

Implements Nepomuk::Utils::Facet.

int Nepomuk::Utils::TypeFacet::count ( ) const [virtual]

The number of choices this facet provides.

Implements Nepomuk::Utils::Facet.

KGuiItem Nepomuk::Utils::TypeFacet::guiItem ( int  index) const [virtual]

The parameters used to render the choice at index.

Reimplemented from Nepomuk::Utils::Facet.

bool Nepomuk::Utils::TypeFacet::isSelected ( int  index) const [virtual]
Returns:
true if the choice at index is selected, false otherwise.

Implements Nepomuk::Utils::Facet.

Query::Term Nepomuk::Utils::TypeFacet::queryTerm ( ) const [virtual]

The term currently produced by this facet.

This is dependant on the subclass implementation and the selectionMode(). The SimpleFacet for example uses an AndTerm or an OrTerm to combine all its terms in MatchAll or MatchAny mode while it returns the one selected term in MatchOne mode.

Implements Nepomuk::Utils::Facet.

bool Nepomuk::Utils::TypeFacet::selectFromTerm ( const Nepomuk::Query::Term &  queryTerm) [virtual, slot]

If a client application provides several ways to construct a query (one could think of a query editor which allows to insert certain constraints or simply another application providing a base query) the user expects to be able to modify that query using the available facets.

Thus, a Facet should be able to extract parts from a query.

Implement this method to create a selection based on the contents of term. The selection of the facet must only change if all of term can be used. This means that if term is for example an OrTerm and the Facet can only handle one of the sub terms it needs to ignore the whole term. FacetModel::setQuery() internally calls selectFromTerm() on all its facets.

A simple example is SimpleFacet which compares all its terms which have been added via SimpleFacet::addTerm() to term. Depending on the selectionMode() it also checks for AndTerm or OrTerm.

Warning:
Implementations of this method should never reset the selection before handling term. Instead the method should work similar to setSelected(), ie. in MatchAll or MatchAny facets calling it multiple times should select multiple choices.
Returns:
true if all of term could be used to select choices in this term, false otherwise.

Implements Nepomuk::Utils::Facet.

SelectionMode Nepomuk::Utils::TypeFacet::selectionMode ( ) const [virtual]

The selection mode used by this facet.

The GUI client can make use of this value to adjust the GUI accordingly. A typical example would be using radio buttons for MatchOne facets.

Implements Nepomuk::Utils::Facet.

void Nepomuk::Utils::TypeFacet::setSelected ( int  index,
bool  selected = true 
) [virtual, slot]

Called by client code to change the selection.

Parameters:
indexThe index of the choice for which the selection should be changed.
selectedIf true the item should be selected, otherwise it should be deselected.

Implements Nepomuk::Utils::Facet.


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