• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi/contact

Akonadi::ContactSearchJob

Akonadi::ContactSearchJob Class Reference

Job that searches for contacts in the Akonadi storage. More...

#include <contactsearchjob.h>

Inherits ItemSearchJob.

List of all members.

Public Types

enum  Criterion { Name, Email, NickName }

Public Member Functions

 ContactSearchJob (QObject *parent=0)
 ~ContactSearchJob ()
KABC::Addressee::List contacts () const
void setLimit (int limit)
void setQuery (Criterion criterion, const QString &value)

Detailed Description

Job that searches for contacts in the Akonadi storage.

This job searches for contacts that match given search criteria and returns the list of contacts.

Examples:

 // Search all contacts with email address tokoe@kde.org
 Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
 job->setQuery( Akonadi::ContactSearchJob::Email, "tokoe@kde.org" );
 connect( job, SIGNAL( result( KJob* ) ), this, SLOT( searchResult( KJob* ) ) );

 ...

 MyClass::searchResult( KJob *job )
 {
   Akonadi::ContactSearchJob *searchJob = qobject_cast<Akonadi::ContactSearchJob*>( job );
   const KABC::Addressee::List contacts = searchJob->contacts();
   // do something with the contacts
 }
 // Search for all existing contacts
 Akonadi::ContactSearchJob *job = new Akonadi::ContactSearchJob();
 connect( job, SIGNAL( result( KJob* ) ), this, SLOT( searchResult( KJob* ) ) );

 ...

 MyClass::searchResult( KJob *job )
 {
   Akonadi::ContactSearchJob *searchJob = qobject_cast<Akonadi::ContactSearchJob*>( job );
   const KABC::Addressee::List contacts = searchJob->contacts();
   // do something with the contacts
 }
Author:
Tobias Koenig <tokoe@kde.org>
Since:
4.4

Definition at line 79 of file contactsearchjob.h.


Member Enumeration Documentation

enum Akonadi::ContactSearchJob::Criterion

Describes the criteria that can be searched for.

Enumerator:
Name 

The name of the contact.

Email 

The email address of the contact.

NickName 

The case-insensitive nickname of the contact.

Definition at line 99 of file contactsearchjob.h.


Constructor & Destructor Documentation

ContactSearchJob::ContactSearchJob ( QObject *  parent = 0  )  [explicit]

Creates a new contact search job.

Parameters:
parent The parent object.

Definition at line 34 of file contactsearchjob.cpp.

ContactSearchJob::~ContactSearchJob (  ) 

Destroys the contact search job.

Definition at line 46 of file contactsearchjob.cpp.


Member Function Documentation

KABC::Addressee::List ContactSearchJob::contacts (  )  const

Returns the contacts that matched the search criteria.

Definition at line 90 of file contactsearchjob.cpp.

void ContactSearchJob::setLimit ( int  limit  ) 

Sets a limit on how many results will be returned by this search job.

This is useful in situation where for example only the first search result is needed anyway, setting a limit of 1 here will greatly reduce the resource usage of Nepomuk during the search.

This needs to be called before calling setQuery() to have an effect. By default, the number of results is unlimited.

Definition at line 85 of file contactsearchjob.cpp.

void ContactSearchJob::setQuery ( Criterion  criterion,
const QString &  value 
)

Sets the criterion and value for the search.

Definition at line 51 of file contactsearchjob.cpp.


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

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.6.2-20100208
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