Akonadi::ContactGroupSearchJob

Search for usage in LXR

Akonadi::ContactGroupSearchJob Class Reference

#include <contactgroupsearchjob.h>

Inheritance diagram for Akonadi::ContactGroupSearchJob:

Public Types

enum  Criterion { Name }
 
enum  Match { ExactMatch, StartsWithMatch, ContainsMatch }
 
- Public Types inherited from Akonadi::Job
enum  Error
 
typedef QList< Job * > List
 

Public Member Functions

 ContactGroupSearchJob (QObject *parent=nullptr)
 
 ~ContactGroupSearchJob () override
 
KContacts::ContactGroup::List contactGroups () const
 
void setLimit (int limit)
 
void setQuery (Criterion criterion, const QString &value)
 
void setQuery (Criterion criterion, const QString &value, Match match)
 
- Public Member Functions inherited from Akonadi::ItemSearchJob
 ItemSearchJob (const SearchQuery &query, QObject *parent=nullptr)
 
 ItemSearchJob (QObject *parent=nullptr)
 
ItemFetchScopefetchScope ()
 
bool isRecursive () const
 
bool isRemoteSearchEnabled () const
 
Item::List items () const
 
QStringList mimeTypes () const
 
Collection::List searchCollections () const
 
void setFetchScope (const ItemFetchScope &fetchScope)
 
void setMimeTypes (const QStringList &mimeTypes)
 
void setQuery (const SearchQuery &query)
 
void setRecursive (bool recursive)
 
void setRemoteSearchEnabled (bool enabled)
 
void setSearchCollections (const Collection::List &collections)
 
void setTagFetchScope (const TagFetchScope &fetchScope)
 
TagFetchScopetagFetchScope ()
 
- Public Member Functions inherited from Akonadi::Job
 Job (QObject *parent=nullptr)
 
QString errorString () const final
 
void start () override
 

Additional Inherited Members

- Signals inherited from Akonadi::ItemSearchJob
void itemsReceived (const Akonadi::Item::List &items)
 
- Signals inherited from Akonadi::Job
void aboutToStart (Akonadi::Job *job)
 
void writeFinished (Akonadi::Job *job)
 
- Public Attributes inherited from Akonadi::Job
 ConnectionFailed
 
 ProtocolVersionMismatch
 
 Unknown
 
 UserCanceled
 
 UserError
 
- Protected Member Functions inherited from Akonadi::ItemSearchJob
bool doHandleResponse (qint64 tag, const Protocol::CommandPtr &response) override
 
void doStart () override
 
- Protected Member Functions inherited from Akonadi::Job
bool addSubjob (KJob *job) override
 
bool doKill () override
 
void emitWriteFinished ()
 
bool removeSubjob (KJob *job) override
 

Detailed Description

Job that searches for contact groups in the Akonadi storage.

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

connect( job, SIGNAL(result(KJob*)), this, SLOT(searchResult(KJob*)) );
...
MyClass::searchResult( KJob *job )
{
Akonadi::ContactGroupSearchJob *searchJob = qobject_cast<Akonadi::ContactGroupSearchJob*>( job );
// do something with the contact groups
}
Author
Tobias Koenig tokoe[email protected]@kde[email protected].org
Since
4.4

Definition at line 49 of file contactgroupsearchjob.h.

Member Enumeration Documentation

◆ Criterion

Describes the criteria that can be searched for.

Enumerator
Name 

The name of the contact group.

Definition at line 69 of file contactgroupsearchjob.h.

◆ Match

Describes the type of pattern matching that shall be used.

Since
4.5
Enumerator
ExactMatch 

The result must match exactly the pattern (case sensitive).

StartsWithMatch 

The result must start with the pattern (case insensitive).

ContainsMatch 

The result must contain the pattern (case insensitive).

Definition at line 78 of file contactgroupsearchjob.h.

Constructor & Destructor Documentation

◆ ContactGroupSearchJob()

ContactGroupSearchJob::ContactGroupSearchJob ( QObject parent = nullptr)
explicit

Creates a new contact group search job.

Parameters
parentThe parent object.

Definition at line 23 of file contactgroupsearchjob.cpp.

◆ ~ContactGroupSearchJob()

ContactGroupSearchJob::~ContactGroupSearchJob ( )
overridedefault

Destroys the contact group search job.

Member Function Documentation

◆ contactGroups()

KContacts::ContactGroup::List ContactGroupSearchJob::contactGroups ( ) const

Returns the contact groups that matched the search criteria.

Definition at line 76 of file contactgroupsearchjob.cpp.

◆ setLimit()

void ContactGroupSearchJob::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 during the search.

Parameters
limitthe limit to set
Note
this needs to be called before calling setQuery() to have an effect. By default, the number of results is unlimited.
Since
4.4.3

Definition at line 71 of file contactgroupsearchjob.cpp.

◆ setQuery() [1/2]

void ContactGroupSearchJob::setQuery ( Criterion  criterion,
const QString value 
)

Sets the criterion and value for the search.

Definition at line 40 of file contactgroupsearchjob.cpp.

◆ setQuery() [2/2]

void ContactGroupSearchJob::setQuery ( Criterion  criterion,
const QString value,
Match  match 
)

Sets the criterion and value for the search with match.

Parameters
criterionthe query criterion to compare with
valuethe value to match against
matchhow to match the given value
Since
4.5

Definition at line 59 of file contactgroupsearchjob.cpp.


The documentation for this class was generated from the following files:
void setQuery(Criterion criterion, const QString &value)
Sets the criterion and value for the search.
KContacts::ContactGroup::List contactGroups() const
Returns the contact groups that matched the search criteria.
Job that searches for contact groups in the Akonadi storage.
@ Name
The name of the contact group.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Mar 22 2023 03:55:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.