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

akonadi

  • Akonadi
  • SearchCreateJob
Public Member Functions | Protected Member Functions | List of all members
Akonadi::SearchCreateJob Class Reference

#include <searchcreatejob.h>

Inheritance diagram for Akonadi::SearchCreateJob:
Inheritance graph
[legend]

Public Member Functions

AKONADI_DEPRECATED SearchCreateJob (const QString &name, const QString &query, QObject *parent=0)
 
 SearchCreateJob (const QString &name, const SearchQuery &searchQuery, QObject *parent=0)
 
 ~SearchCreateJob ()
 
Collection createdCollection () const
 
bool isRecursive () const
 
bool isRemoteSearchEnabled () const
 
Collection::List searchCollections () const
 
QStringList searchMimeTypes () const
 
AKONADI_DEPRECATED void setQueryLanguage (const QString &queryLanguage)
 
void setRecursive (bool recursive)
 
void setRemoteSearchEnabled (bool enabled)
 
void setSearchCollections (const Collection::List &collections)
 
void setSearchMimeTypes (const QStringList &mimeTypes)
 
- Public Member Functions inherited from Akonadi::Job
 Job (QObject *parent=0)
 
virtual ~Job ()
 
virtual QString errorString () const
 
void start ()
 

Protected Member Functions

void doHandleResponse (const QByteArray &tag, const QByteArray &data)
 
void doStart ()
 
- Protected Member Functions inherited from Akonadi::Job
virtual bool addSubjob (KJob *job)
 
virtual bool doKill ()
 
void emitWriteFinished ()
 
virtual bool removeSubjob (KJob *job)
 

Additional Inherited Members

- Public Types inherited from Akonadi::Job
enum  Error {
  ConnectionFailed = UserDefinedError, ProtocolVersionMismatch, UserCanceled, Unknown,
  UserError = UserDefinedError + 42
}
 
typedef QList< Job * > List
 
- Signals inherited from Akonadi::Job
void aboutToStart (Akonadi::Job *job)
 
void writeFinished (Akonadi::Job *job)
 
- Protected Slots inherited from Akonadi::Job
virtual void slotResult (KJob *job)
 

Detailed Description

Job that creates a virtual/search collection in the Akonadi storage.

This job creates so called virtual or search collections, which don't contain real data, but references to items that match a given search query.

const QString name = "My search folder";
const QString query = "...";
Akonadi::SearchCreateJob *job = new Akonadi::SearchCreateJob( name, query );
connect( job, SIGNAL(result(KJob*)), SLOT(jobFinished(KJob*)) );
MyClass::jobFinished( KJob *job )
{
if ( job->error() ) {
qDebug() << "Error occurred";
return;
}
qDebug() << "Created search folder successfully";
const Collection searchCollection = job->createdCollection();
...
}
Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g

Definition at line 62 of file searchcreatejob.h.

Constructor & Destructor Documentation

SearchCreateJob::SearchCreateJob ( const QString &  name,
const QString &  query,
QObject *  parent = 0 
)

Creates a search create job.

Parameters
nameThe name of the search collection.
queryThe search query (format not defined yet).
parentThe parent object.
Deprecated:
Deprecated as of 4.13, use Akonadi::SearchQuery instead

Definition at line 54 of file searchcreatejob.cpp.

SearchCreateJob::SearchCreateJob ( const QString &  name,
const SearchQuery &  searchQuery,
QObject *  parent = 0 
)

Creates a search create job.

Parameters
nameThe name of the search collection.
queryThe search query.
parentThe parent object.
Since
4.13

Definition at line 59 of file searchcreatejob.cpp.

SearchCreateJob::~SearchCreateJob ( )

Destroys the search create job.

Definition at line 64 of file searchcreatejob.cpp.

Member Function Documentation

Akonadi::Collection SearchCreateJob::createdCollection ( ) const

Returns the newly created search collection once the job finished successfully.

Returns an invalid collection if the job has not yet finished or failed.

Since
4.4

Definition at line 153 of file searchcreatejob.cpp.

void SearchCreateJob::doHandleResponse ( const QByteArray &  tag,
const QByteArray &  data 
)
protectedvirtual

Reimplemented from Akonadi::Job.

Reimplemented from Akonadi::Job.

Definition at line 159 of file searchcreatejob.cpp.

void SearchCreateJob::doStart ( )
protectedvirtual

Reimplemented from Akonadi::Job.

Implements Akonadi::Job.

Definition at line 121 of file searchcreatejob.cpp.

bool SearchCreateJob::isRecursive ( ) const

Returns whether the search is recursive.

Since
4.13

Definition at line 104 of file searchcreatejob.cpp.

bool SearchCreateJob::isRemoteSearchEnabled ( ) const

Returns whether remote search is enabled.

Since
4.13

Definition at line 116 of file searchcreatejob.cpp.

Collection::List SearchCreateJob::searchCollections ( ) const

Returns list of collections to search in.

Since
4.13

Definition at line 80 of file searchcreatejob.cpp.

QStringList SearchCreateJob::searchMimeTypes ( ) const

Returns list of mime types that search results can contain.

Since
4.13

Definition at line 92 of file searchcreatejob.cpp.

void SearchCreateJob::setQueryLanguage ( const QString &  queryLanguage)

Sets the query language.

Parameters
queryLanguageThe query language used.
Since
4.6
Deprecated:
This method is deprecated as of 4.13 and has no effect.

Definition at line 68 of file searchcreatejob.cpp.

void SearchCreateJob::setRecursive ( bool  recursive)

Sets whether the search should recurse into collections.

When set to true, all child collections of the specific collections will be search recursively.

Parameters
recursiveWhether to search recursively
Since
4.13

Definition at line 97 of file searchcreatejob.cpp.

void SearchCreateJob::setRemoteSearchEnabled ( bool  enabled)

Sets whether resources should be queried too.

When set to true, Akonadi will search local indexed items and will also query resources that support server-side search, to forward the query to remote storage (for example using SEARCH feature on IMAP servers) and merge their results with results from local index.

This is useful especially when searching resources, that don't fetch full payload by default, for example the IMAP resource, which only fetches headers by default and the body is fetched on demand, which means that emails that were not yet fully fetched cannot be indexed in local index, and thus cannot be searched. With remote search, even those emails can be included in search results.

This feature is disabled by default.

Parameters
enabledWhether remote search is enabled
Since
4.13

Definition at line 109 of file searchcreatejob.cpp.

void SearchCreateJob::setSearchCollections ( const Collection::List &  collections)

Sets list of collections to search in.

When an empty list is set (default value), the search will contain results from all collections that contain given mime types.

Parameters
collectionsCollections to search in, or an empty list to search all
Since
4.13

Definition at line 73 of file searchcreatejob.cpp.

void SearchCreateJob::setSearchMimeTypes ( const QStringList &  mimeTypes)

Sets list of mime types of items that search results can contain.

Parameters
mimeTypesMime types of items to include in search
Since
4.13

Definition at line 85 of file searchcreatejob.cpp.


The documentation for this class was generated from the following files:
  • searchcreatejob.h
  • searchcreatejob.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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