Nepomuk
Nepomuk::Utils::ProxyFacet Class Reference
A facet forwarding the filtered choices from another facet. More...
#include <Nepomuk/Utils/ProxyFacet>

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
- 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:
trueif 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:
trueif the term atindexhas 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:
-
term The condition term. If valid this facet will only show any choices if the client query contains termin 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:
KDE 4.6 API Reference