• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

Plasma::SearchContext

Plasma::SearchContext Class Reference

#include <searchcontext.h>

Inheritance diagram for Plasma::SearchContext:

Inheritance graph
[legend]

List of all members.


Detailed Description

The SearchContext class provides information related to a search, including the search term, metadata on the search term and collected matches.

Definition at line 41 of file searchcontext.h.


Public Types

enum  Type {
  UnknownType = 0, Directory, File, NetworkLocation,
  Executable, ShellCommand, Help
}

Signals

void matchesChanged ()

Public Member Functions

 SearchContext (QObject *parent=0)
 ~SearchContext ()
 SearchContext (QObject *parent, const SearchContext &other)
void setSearchTerm (const QString &)
QString searchTerm () const
Type type () const
QString mimetype () const
KCompletion * completionObject () const
void addStringCompletion (const QString &completion)
void addStringCompletions (const QStringList &completions)
SearchMatch * addInformationalMatch (AbstractRunner *runner)
SearchMatch * addExactMatch (AbstractRunner *runner)
SearchMatch * addPossibleMatch (AbstractRunner *runner)
bool addMatches (const QString &term, const QList< SearchMatch * > &exactMatches, const QList< SearchMatch * > &possibleMatches, const QList< SearchMatch * > &informationalMatches)
QList< SearchMatch * > informationalMatches () const
QList< SearchMatch * > exactMatches () const
QList< SearchMatch * > possibleMatches () const
void determineType ()
void clearMatches ()

Member Enumeration Documentation

enum Plasma::SearchContext::Type

Enumerator:
UnknownType 
Directory 
File 
NetworkLocation 
Executable 
ShellCommand 
Help 

Definition at line 46 of file searchcontext.h.


Constructor & Destructor Documentation

Plasma::SearchContext::SearchContext ( QObject *  parent = 0  )  [explicit]

Definition at line 119 of file searchcontext.cpp.

Plasma::SearchContext::~SearchContext (  ) 

Definition at line 139 of file searchcontext.cpp.

Plasma::SearchContext::SearchContext ( QObject *  parent,
const SearchContext &  other 
)

Definition at line 125 of file searchcontext.cpp.


Member Function Documentation

void Plasma::SearchContext::setSearchTerm ( const QString &  term  ) 

Sets the search term for this object.

This clears all current matches in the process.

Definition at line 144 of file searchcontext.cpp.

QString Plasma::SearchContext::searchTerm (  )  const

Returns:
the current search term.

Definition at line 196 of file searchcontext.cpp.

SearchContext::Type Plasma::SearchContext::type (  )  const

The type of item the search term might refer to.

See also:
Type

Definition at line 204 of file searchcontext.cpp.

QString Plasma::SearchContext::mimetype (  )  const

The mimetype that the search term refers to, if discoverable.

Returns:
QString() if the mimetype can not be determined, otherwise the mimetype of the object being refered to by the search string.

Definition at line 209 of file searchcontext.cpp.

KCompletion * Plasma::SearchContext::completionObject (  )  const

Returns:
a completion object that can be used with UI elements

Definition at line 214 of file searchcontext.cpp.

void Plasma::SearchContext::addStringCompletion ( const QString &  completion  ) 

Adds an item to the completion object.

Definition at line 222 of file searchcontext.cpp.

void Plasma::SearchContext::addStringCompletions ( const QStringList &  completions  ) 

Adds multiple items to the completion object.

Definition at line 235 of file searchcontext.cpp.

SearchMatch * Plasma::SearchContext::addInformationalMatch ( AbstractRunner *  runner  ) 

Add an action that represents a match to the current search term.

This action is informational in nature and does not represent and actionable match.

If string data is added to the action using QAction::setData(), that string may be used in user interfaces when the item is selected.

Definition at line 248 of file searchcontext.cpp.

SearchMatch * Plasma::SearchContext::addExactMatch ( AbstractRunner *  runner  ) 

Add an action that represents an exact match to the current search term.

Definition at line 256 of file searchcontext.cpp.

SearchMatch * Plasma::SearchContext::addPossibleMatch ( AbstractRunner *  runner  ) 

Add an action that represents a possible match to the current search term.

Definition at line 264 of file searchcontext.cpp.

bool Plasma::SearchContext::addMatches ( const QString &  term,
const QList< SearchMatch * > &  exactMatches,
const QList< SearchMatch * > &  possibleMatches,
const QList< SearchMatch * > &  informationalMatches 
)

Appends lists of matches to the lists for exact, possible, and informational matches.

Returns:
true if matches were added, false if matches were outdated

Definition at line 272 of file searchcontext.cpp.

QList< SearchMatch * > Plasma::SearchContext::informationalMatches (  )  const

Retrieves all available informational matches for the current search term.

Definition at line 288 of file searchcontext.cpp.

QList< SearchMatch * > Plasma::SearchContext::exactMatches (  )  const

Retrieves all available exact matches for the current search term.

Definition at line 296 of file searchcontext.cpp.

QList< SearchMatch * > Plasma::SearchContext::possibleMatches (  )  const

Retrieves all available possible matches for the current search term.

Definition at line 304 of file searchcontext.cpp.

void Plasma::SearchContext::determineType (  ) 

Determines type of query.

Definition at line 158 of file searchcontext.cpp.

void Plasma::SearchContext::clearMatches (  ) 

Clears matches.

Definition at line 312 of file searchcontext.cpp.

void Plasma::SearchContext::matchesChanged (  )  [signal]


The documentation for this class was generated from the following files:
  • searchcontext.h
  • searchcontext.cpp

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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