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

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
collectionsearch.h
Go to the documentation of this file.
1 /*
2  * collectionsearch.h - Search Akonadi Collections
3  * Program: kalarm
4  * Copyright © 2014 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef COLLECTIONSEARCH_H
22 #define COLLECTIONSEARCH_H
23 
24 #ifdef USE_AKONADI
25 
26 #include <akonadi/collection.h>
27 #include <akonadi/item.h>
28 
29 #include <QObject>
30 #include <QMap>
31 #include <QList>
32 #include <QStringList>
33 
34 class KJob;
35 namespace Akonadi
36 {
37 class CollectionFetchJob;
38 class ItemFetchJob;
39 class ItemDeleteJob;
40 }
41 
42 /*=============================================================================
43 = Class: CollectionSearch
44 = Fetches a list of all Akonadi collections which handle a specified mime type,
45 = and then optionally fetches or deletes all Items from them with a given GID.
46 =
47 = Note that this class auto-deletes once it has emitted its completion signal.
48 = Instances must therefore be created on the heap by operator new(), not on the
49 = stack.
50 =============================================================================*/
51 class CollectionSearch : public QObject
52 {
53  Q_OBJECT
54  public:
55  explicit CollectionSearch(const QString& mimeType, const QString& gid = QString(), bool remove = false);
56 
57  signals:
58  // Signal emitted if action is to fetch all collections for the mime type
59  void collections(const Akonadi::Collection::List&);
60  // Signal emitted if action is to fetch all items with the remote ID
61  void items(const Akonadi::Item::List&);
62  // Signal emitted if action is to delete all items with the remote ID
63  void deleted(int count);
64 
65  private slots:
66  void collectionFetchResult(KJob*);
67  void itemFetchResult(KJob*);
68  void itemDeleteResult(KJob*);
69  void finish();
70 
71  private:
72  QString mMimeType;
73  QString mGid;
74  QList<Akonadi::CollectionFetchJob*> mCollectionJobs;
75  QMap<Akonadi::ItemFetchJob*, Akonadi::Collection::Id> mItemFetchJobs;
76  QMap<Akonadi::ItemDeleteJob*, Akonadi::Collection::Id> mItemDeleteJobs;
77  Akonadi::Collection::List mCollections;
78  Akonadi::Item::List mItems;
79  int mDeleteCount;
80  bool mDelete;
81 };
82 
83 #endif
84 #endif // COLLECTIONSEARCH_H
85 
86 // vim: et sw=4:
QMap
QObject
QString
QList< Akonadi::CollectionFetchJob * >
KJob
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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