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

akonadi

  • 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  public:
42  explicit AgentBasePrivate( AgentBase *parent );
43  virtual ~AgentBasePrivate();
44  void init();
45  virtual void delayedInit();
46 
47  void slotStatus( int status, const QString &message );
48  void slotPercent( int progress );
49  void slotWarning( const QString& message );
50  void slotError( const QString& message );
51  void slotNetworkStatusChange( Solid::Networking::Status );
52  void slotResumedFromSuspend();
53 
54  virtual void changeProcessed();
55 
56  QString defaultReadyMessage() const
57  {
58  if ( mOnline ) {
59  return i18nc( "@info:status Application ready for work", "Ready" );
60  }
61  return i18nc( "@info:status", "Offline" );
62  }
63 
64  QString defaultSyncingMessage() const
65  {
66  return i18nc( "@info:status", "Syncing..." );
67  }
68 
69  QString defaultErrorMessage() const
70  {
71  return i18nc( "@info:status", "Error." );
72  }
73 
74  QString defaultUnconfiguredMessage() const
75  {
76  return i18nc( "@info:status", "Not configured" );
77  }
78 
79  void setProgramName();
80 
81  AgentBase *q_ptr;
82  Q_DECLARE_PUBLIC( AgentBase )
83 
84  QString mId;
85  QString mName;
86  QString mResourceTypeName;
87 
89  QDBusConnection mDBusConnection;
90 
91  int mStatusCode;
92  QString mStatusMessage;
93 
94  uint mProgress;
95  QString mProgressMessage;
96 
97  bool mNeedsNetwork;
98  bool mOnline;
99  bool mDesiredOnlineState;
100 
101  QSettings *mSettings;
102 
103  ChangeRecorder *mChangeRecorder;
104 
105  org::freedesktop::Akonadi::Tracer *mTracer;
106 
107  AgentBase::Observer *mObserver;
108 
109  public Q_SLOTS:
110  virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
111  virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
112  virtual void itemMoved( const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination );
113  virtual void itemRemoved( const Akonadi::Item &item );
114  void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
115  void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
116 
117  virtual void itemsFlagsChanged( const Akonadi::Item::List &items, const QSet<QByteArray> &addedFlags, const QSet<QByteArray> &removedFlags );
118  virtual void itemsMoved( const Akonadi::Item::List &items, const Akonadi::Collection &source, const Akonadi::Collection &destination );
119  virtual void itemsRemoved( const Akonadi::Item::List &items );
120  virtual void itemsLinked( const Akonadi::Item::List &items, const Akonadi::Collection &collection );
121  virtual void itemsUnlinked( const Akonadi::Item::List &items, const Akonadi::Collection &collection );
122 
123  virtual void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
124  virtual void collectionChanged( const Akonadi::Collection &collection );
125  virtual void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &changedAttributes );
126  virtual void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination );
127  virtual void collectionRemoved( const Akonadi::Collection &collection );
128  void collectionSubscribed( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
129  void collectionUnsubscribed( const Akonadi::Collection &collection );
130 };
131 
132 }
133 
134 #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:89
Akonadi::ChangeRecorder
Records and replays change notification.
Definition: changerecorder.h:47
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:15 by doxygen 1.8.5 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-4.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 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
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