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

Nepomuk

  • Nepomuk
  • Utils
  • ProxyFacet
Public Slots | Public Member Functions | Protected Member Functions

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

A facet forwarding the filtered choices from another facet. More...

#include <Nepomuk/Utils/ProxyFacet>

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

List of all members.

Public Slots

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

Public Member Functions

 ProxyFacet (QObject *parent=0)
virtual ~ProxyFacet ()
int count () const
Nepomuk::Query::Term facetCondition () const
KGuiItem guiItem (int index) const
bool isSelected (int index) const
virtual Nepomuk::Query::Term queryTerm () const
SelectionMode selectionMode () const
void setSourceFacet (Facet *source)
Facet * sourceFacet () const

Protected Member Functions

virtual bool facetConditionMet () const
void handleClientQueryChange ()

Detailed Description

A facet forwarding the filtered choices from another facet.

The ProxyFacet allows to perform filter operations on another facet. Most noticable one can set a general condition which needs to be fulfilled in the client query in order for the facet to show any choices.

See also:
Facet Examples
Author:
Sebastian Trueg <trueg@kde.org>
Since:
4.6

Definition at line 47 of file proxyfacet.h.


Constructor & Destructor Documentation

Nepomuk::Utils::ProxyFacet::ProxyFacet ( QObject *  parent = 0)

Create a new proxy facet without a source.

virtual Nepomuk::Utils::ProxyFacet::~ProxyFacet ( ) [virtual]

Destructor.


Member Function Documentation

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

Clear the selection.

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

Implements Nepomuk::Utils::Facet.

int Nepomuk::Utils::ProxyFacet::count ( ) const [virtual]
Returns:
The number of terms forwarded from the sourceFacet().

Implements Nepomuk::Utils::Facet.

Nepomuk::Query::Term Nepomuk::Utils::ProxyFacet::facetCondition ( ) const

The facet condition set via setFacetCondition()

virtual bool Nepomuk::Utils::ProxyFacet::facetConditionMet ( ) const [protected, virtual]

Used internally to determine if the facet condition is met.

Can be reimplemented for customized filtering.

Returns:
true if the facet condition is met and all choices from the source facet should be forwarded.
KGuiItem Nepomuk::Utils::ProxyFacet::guiItem ( int  index) const [virtual]

The gui item forwarded from the sourceFacet().

Reimplemented from Nepomuk::Utils::Facet.

void Nepomuk::Utils::ProxyFacet::handleClientQueryChange ( ) [protected, virtual]

This method is called from setClientQuery() and can be reimplemented by subclasses.

The default implementation does nothing.

Reimplemented from Nepomuk::Utils::Facet.

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

Implements Nepomuk::Utils::Facet.

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

The query term forwarded and optionally filtered from the sourceModel().

Implements Nepomuk::Utils::Facet.

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

The term is analyzed depending on the selectionMode().

See also:
Facet::selectFromTerm()

Implements Nepomuk::Utils::Facet.

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

The selection mode forwarded from the sourceFacet().

Implements Nepomuk::Utils::Facet.

void Nepomuk::Utils::ProxyFacet::setFacetCondition ( const Nepomuk::Query::Term &  queryTerm) [slot]

Allows to set a condition for the entire facet.

Unless it is not met in the client query set via setClientQuery() the facet does not provide any choices.

Parameters:
termThe condition term. If valid this facet will only show any choices if the client query contains term in a non-optional way.

A typical example is a facet which filters images by size. In that case the condition would be

 Query::ResourceTypeTerm( Vocabulary::NFO::RasterImage() );

since filtering by image size does only make sense if only images are selected.

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

Selects or deselects the term at index.

Depending on the selectionMode() this will also affect the selection of other terms.

Implements Nepomuk::Utils::Facet.

void Nepomuk::Utils::ProxyFacet::setSourceFacet ( Facet *  source)

Set the source facet.

The proxy will forward all calls to source.

Facet* Nepomuk::Utils::ProxyFacet::sourceFacet ( ) const

The source facet which this proxy facet is forwarding.

See also:
setSourceFacet()

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