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

akonadi

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

#include <persistentsearchattribute.h>

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

Public Member Functions

 PersistentSearchAttribute ()
 
 ~PersistentSearchAttribute ()
 
bool isRecursive () const
 
bool isRemoteSearchEnabled () const
 
QList< qint64 > queryCollections () const
 
AKONADI_DEPRECATED QString queryLanguage () const
 
QString queryString () const
 
void setQueryCollections (const QList< Collection > &collections)
 
void setQueryCollections (const QList< qint64 > &collectionsIds)
 
AKONADI_DEPRECATED void setQueryLanguage (const QString &language)
 
void setQueryString (const QString &query)
 
void setRecursive (bool recursive)
 
void setRemoteSearchEnabled (bool enabled)
 
- Public Member Functions inherited from Akonadi::Attribute
virtual ~Attribute ()
 
virtual Attribute * clone () const =0
 
virtual void deserialize (const QByteArray &data)=0
 
virtual QByteArray serialized () const =0
 
virtual QByteArray type () const =0
 

Additional Inherited Members

- Public Types inherited from Akonadi::Attribute
typedef QList< Attribute * > List
 

Detailed Description

An attribute to store query properties of persistent search collections.

This attribute is attached to persistent search collections automatically when creating a new persistent search with SearchCreateJob. Later on the search query can be changed by modifying this attribute of the persistent search collection with an CollectionModifyJob.

Example:

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;
}
const Collection searchCollection = job->createdCollection();
...
// now let's change the query
if ( searchCollection.hasAttribute<Akonadi::PersistentSearchAttribute>() ) {
Akonadi::PersistentSearchAttribute *attribute = searchCollection.attribute<Akonadi::PersistentSearchAttribute>();
attribute->setQueryString( "... another query string ..." );
Akonadi::CollectionModifyJob *modifyJob = new Akonadi::CollectionModifyJob( searchCollection );
connect( modifyJob, SIGNAL(result(KJob*)), SLOT(modifyFinished(KJob*)) );
}
...
}
Author
Volker Krause vkrau.nosp@m.se@k.nosp@m.de.or.nosp@m.g
Since
4.5

Definition at line 73 of file persistentsearchattribute.h.

Constructor & Destructor Documentation

PersistentSearchAttribute::PersistentSearchAttribute ( )

Creates a new persistent search attribute.

Definition at line 45 of file persistentsearchattribute.cpp.

PersistentSearchAttribute::~PersistentSearchAttribute ( )

Destroys the persistent search attribute.

Definition at line 50 of file persistentsearchattribute.cpp.

Member Function Documentation

bool PersistentSearchAttribute::isRecursive ( ) const

Returns whether the search is recursive.

Since
4.13

Definition at line 93 of file persistentsearchattribute.cpp.

bool PersistentSearchAttribute::isRemoteSearchEnabled ( ) const

Returns whether remote search is enabled.

Since
4.13

Definition at line 103 of file persistentsearchattribute.cpp.

QList< qint64 > PersistentSearchAttribute::queryCollections ( ) const

Returns IDs of collections that will be queried.

Since
4.13

Definition at line 75 of file persistentsearchattribute.cpp.

QString PersistentSearchAttribute::queryLanguage ( ) const

Returns the query language used for this search.

Deprecated:
Deprecated as of 4.13. This method returns "SPARQL" for compatibility reasons and should not be used with new code.

Definition at line 55 of file persistentsearchattribute.cpp.

QString PersistentSearchAttribute::queryString ( ) const

Returns the query string used for this search.

Definition at line 65 of file persistentsearchattribute.cpp.

void PersistentSearchAttribute::setQueryCollections ( const QList< Collection > &  collections)

Sets collections to be queried.

Parameters
collectionsList of collections to be queries
Since
4.13

Definition at line 80 of file persistentsearchattribute.cpp.

void PersistentSearchAttribute::setQueryCollections ( const QList< qint64 > &  collectionsIds)

Sets IDs of collections to be queries.

Parameters
collectionsIDsIDs of collections to query
Since
4.13

Definition at line 88 of file persistentsearchattribute.cpp.

void PersistentSearchAttribute::setQueryLanguage ( const QString &  language)

Sets the query language used for this search.

Parameters
languagethe query language
Deprecated:
Deprecated as of 4.13. This method has no effect.

Definition at line 60 of file persistentsearchattribute.cpp.

void PersistentSearchAttribute::setQueryString ( const QString &  query)

Sets the query string to be used for this search.

Parameters
queryThe query string.

Definition at line 70 of file persistentsearchattribute.cpp.

void PersistentSearchAttribute::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 98 of file persistentsearchattribute.cpp.

void PersistentSearchAttribute::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.

Parameters
enabledWhether remote search is enabled
Since
4.13

Definition at line 108 of file persistentsearchattribute.cpp.


The documentation for this class was generated from the following files:
  • persistentsearchattribute.h
  • persistentsearchattribute.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