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

akonadi

  • sources
  • kde-4.12
  • 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 
33 namespace Akonadi {
34 
38 class AgentBasePrivate : public QObject
39 {
40  Q_OBJECT
41  Q_CLASSINFO( "D-Bus Interface", "org.kde.dfaure" )
42 
43  public:
44  explicit AgentBasePrivate( AgentBase *parent );
45  virtual ~AgentBasePrivate();
46  void init();
47  virtual void delayedInit();
48 
49  void slotStatus( int status, const QString &message );
50  void slotPercent( int progress );
51  void slotWarning( const QString& message );
52  void slotError( const QString& message );
53  void slotNetworkStatusChange( Solid::Networking::Status );
54  void slotResumedFromSuspend();
55 
56  virtual void changeProcessed();
57 
58  QString defaultReadyMessage() const
59  {
60  if ( mOnline ) {
61  return i18nc( "@info:status Application ready for work", "Ready" );
62  }
63  return i18nc( "@info:status", "Offline" );
64  }
65 
66  QString defaultSyncingMessage() const
67  {
68  return i18nc( "@info:status", "Syncing..." );
69  }
70 
71  QString defaultErrorMessage() const
72  {
73  return i18nc( "@info:status", "Error." );
74  }
75 
76  QString defaultUnconfiguredMessage() const
77  {
78  return i18nc( "@info:status", "Not configured" );
79  }
80 
81  void setProgramName();
82 
83  AgentBase *q_ptr;
84  Q_DECLARE_PUBLIC( AgentBase )
85 
86  QString mId;
87  QString mName;
88  QString mResourceTypeName;
89 
91  QDBusConnection mDBusConnection;
92 
93  int mStatusCode;
94  QString mStatusMessage;
95 
96  uint mProgress;
97  QString mProgressMessage;
98 
99  bool mNeedsNetwork;
100  bool mOnline;
101  bool mDesiredOnlineState;
102 
103  QSettings *mSettings;
104 
105  ChangeRecorder *mChangeRecorder;
106 
107  org::freedesktop::Akonadi::Tracer *mTracer;
108 
109  AgentBase::Observer *mObserver;
110 
111  public Q_SLOTS:
112  // Dump the contents of the current ChangeReplay
113  Q_SCRIPTABLE QString dumpNotificationListToString() const;
114  Q_SCRIPTABLE void dumpMemoryInfo() const;
115  Q_SCRIPTABLE QString dumpMemoryInfoToString() const;
116 
117  virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
118  virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
119  virtual void itemMoved( const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination );
120  virtual void itemRemoved( const Akonadi::Item &item );
121  void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
122  void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
123 
124  virtual void itemsFlagsChanged( const Akonadi::Item::List &items, const QSet<QByteArray> &addedFlags, const QSet<QByteArray> &removedFlags );
125  virtual void itemsMoved( const Akonadi::Item::List &items, const Akonadi::Collection &source, const Akonadi::Collection &destination );
126  virtual void itemsRemoved( const Akonadi::Item::List &items );
127  virtual void itemsLinked( const Akonadi::Item::List &items, const Akonadi::Collection &collection );
128  virtual void itemsUnlinked( const Akonadi::Item::List &items, const Akonadi::Collection &collection );
129 
130  virtual void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
131  virtual void collectionChanged( const Akonadi::Collection &collection );
132  virtual void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &changedAttributes );
133  virtual void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination );
134  virtual void collectionRemoved( const Akonadi::Collection &collection );
135  void collectionSubscribed( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
136  void collectionUnsubscribed( const Akonadi::Collection &collection );
137 };
138 
139 }
140 
141 #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:185
Akonadi::AgentBasePrivate
Definition: agentbase_p.h:38
Akonadi::AgentBase
The base class for all Akonadi agents and resources.
Definition: agentbase.h:80
Akonadi::AgentBasePrivate::mDBusConnection
QDBusConnection mDBusConnection
Use sessionBus() to access the connection.
Definition: agentbase_p.h:91
Akonadi::ChangeRecorder
Records and replays change notification.
Definition: changerecorder.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:26 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
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

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