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

akonadi

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
agentbase_p.h
1 /*
2  Copyright (c) 2007 Volker Krause <vkrause@kde.org>
3  Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #ifndef AKONADI_AGENTBASE_P_H
22 #define AKONADI_AGENTBASE_P_H
23 
24 #include "agentbase.h"
25 #include "tracerinterface.h"
26 
27 #include <klocalizedstring.h>
28 
29 #include <solid/networking.h>
30 
31 class QSettings;
32 class QTimer;
33 
34 namespace Akonadi {
35 
39 class AgentBasePrivate : public QObject
40 {
41  Q_OBJECT
42  Q_CLASSINFO("D-Bus Interface", "org.kde.dfaure")
43 
44 public:
45  explicit AgentBasePrivate(AgentBase *parent);
46  virtual ~AgentBasePrivate();
47  void init();
48  virtual void delayedInit();
49 
50  void slotStatus(int status, const QString &message);
51  void slotPercent(int progress);
52  void slotWarning(const QString &message);
53  void slotError(const QString &message);
54  void slotNetworkStatusChange(Solid::Networking::Status);
55  void slotResumedFromSuspend();
56  void slotTemporaryOfflineTimeout();
57 
58  virtual void changeProcessed();
59 
60  QString defaultReadyMessage() const
61  {
62  if (mOnline) {
63  return i18nc("@info:status Application ready for work", "Ready");
64  }
65  return i18nc("@info:status", "Offline");
66  }
67 
68  QString defaultSyncingMessage() const
69  {
70  return i18nc("@info:status", "Syncing...");
71  }
72 
73  QString defaultErrorMessage() const
74  {
75  return i18nc("@info:status", "Error.");
76  }
77 
78  QString defaultUnconfiguredMessage() const
79  {
80  return i18nc("@info:status", "Not configured");
81  }
82 
83  void setProgramName();
84 
85  AgentBase *q_ptr;
86  Q_DECLARE_PUBLIC(AgentBase)
87 
88  QString mId;
89  QString mName;
90  QString mResourceTypeName;
91 
93  QDBusConnection mDBusConnection;
94 
95  int mStatusCode;
96  QString mStatusMessage;
97 
98  uint mProgress;
99  QString mProgressMessage;
100 
101  bool mNeedsNetwork;
102  bool mOnline;
103  bool mDesiredOnlineState;
104 
105  QSettings *mSettings;
106 
107  ChangeRecorder *mChangeRecorder;
108 
109  org::freedesktop::Akonadi::Tracer *mTracer;
110 
111  AgentBase::Observer *mObserver;
112 
113  QTimer *mTemporaryOfflineTimer;
114 
115  public Q_SLOTS:
116  // Dump the contents of the current ChangeReplay
117  Q_SCRIPTABLE QString dumpNotificationListToString() const;
118  Q_SCRIPTABLE void dumpMemoryInfo() const;
119  Q_SCRIPTABLE QString dumpMemoryInfoToString() const;
120 
121  virtual void itemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection);
122  virtual void itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers);
123  virtual void itemMoved(const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination);
124  virtual void itemRemoved(const Akonadi::Item &item);
125  void itemLinked(const Akonadi::Item &item, const Akonadi::Collection &collection);
126  void itemUnlinked(const Akonadi::Item &item, const Akonadi::Collection &collection);
127 
128  virtual void itemsFlagsChanged(const Akonadi::Item::List &items, const QSet<QByteArray> &addedFlags, const QSet<QByteArray> &removedFlags);
129  virtual void itemsMoved(const Akonadi::Item::List &items, const Akonadi::Collection &source, const Akonadi::Collection &destination);
130  virtual void itemsRemoved(const Akonadi::Item::List &items);
131  virtual void itemsLinked(const Akonadi::Item::List &items, const Akonadi::Collection &collection);
132  virtual void itemsUnlinked(const Akonadi::Item::List &items, const Akonadi::Collection &collection);
133 
134  virtual void collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent);
135  virtual void collectionChanged(const Akonadi::Collection &collection);
136  virtual void collectionChanged(const Akonadi::Collection &collection, const QSet<QByteArray> &changedAttributes);
137  virtual void collectionMoved(const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination);
138  virtual void collectionRemoved(const Akonadi::Collection &collection);
139  void collectionSubscribed(const Akonadi::Collection &collection, const Akonadi::Collection &parent);
140  void collectionUnsubscribed(const Akonadi::Collection &collection);
141 
142  virtual void tagAdded(const Akonadi::Tag &tag);
143  virtual void tagChanged(const Akonadi::Tag &tag);
144  virtual void tagRemoved(const Akonadi::Tag &tag);
145  virtual void itemsTagsChanged(const Akonadi::Item::List &items, const QSet<Akonadi::Tag> &addedTags, const QSet<Akonadi::Tag> &removedTags);
146 };
147 
148 }
149 
150 #endif
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:75
Akonadi::AgentBase::Observer
The interface for reacting on monitored or replayed changes.
Definition: agentbase.h:186
QDBusConnection
Akonadi::AgentBasePrivate
Definition: agentbase_p.h:39
Akonadi::AgentBase
The base class for all Akonadi agents and resources.
Definition: agentbase.h:80
QTimer
QObject
QSet< QByteArray >
QString
QSettings
Akonadi::Tag
An Akonadi Tag.
Definition: tag.h:43
Akonadi::AgentBasePrivate::mDBusConnection
QDBusConnection mDBusConnection
Use sessionBus() to access the connection.
Definition: agentbase_p.h:93
QObject::parent
QObject * parent() const
Akonadi::ChangeRecorder
Records and replays change notification.
Definition: changerecorder.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 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