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

Nepomuk

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

#include <Nepomuk/Utils/ProxyFacet>

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

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 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

 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
 
- Public Member Functions inherited from Nepomuk::Utils::Facet
 Facet (QObject *parent=0)
 
virtual ~Facet ()
 
Query::Query clientQuery () const
 
virtual QString text (int index) const
 

Protected Member Functions

virtual bool facetConditionMet () const
 
void handleClientQueryChange ()
 

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 ()
 

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.nosp@m.@kde.nosp@m..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 ( )
slot

Clear the selection.

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

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
protectedvirtual

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 ( )
protectedvirtual

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)
slot

The term is analyzed depending on the selectionMode().

See also
Facet::selectFromTerm()
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 
)
slot

Selects or deselects the term at index.

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

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
This file is part of the KDE documentation.
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.

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