00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AKONADI_AGENTBASE_P_H
00022 #define AKONADI_AGENTBASE_P_H
00023
00024 #include "agentbase.h"
00025 #include "tracerinterface.h"
00026
00027 #include <klocale.h>
00028
00029 #include <solid/networking.h>
00030
00031 class QSettings;
00032
00033 namespace Akonadi {
00034
00038 class AgentBasePrivate : public QObject
00039 {
00040 Q_OBJECT
00041 public:
00042 AgentBasePrivate( AgentBase *parent );
00043 virtual ~AgentBasePrivate();
00044 void init();
00045 virtual void delayedInit();
00046
00047 void slotStatus( int status, const QString &message );
00048 void slotPercent( int progress );
00049 void slotWarning( const QString& message );
00050 void slotError( const QString& message );
00051 void slotNetworkStatusChange( Solid::Networking::Status );
00052
00053 virtual void changeProcessed();
00054
00055 QString defaultReadyMessage() const
00056 {
00057 if ( mOnline )
00058 return i18nc( "@info:status Application ready for work", "Ready" );
00059 return i18nc( "@info:status", "Offline" );
00060 }
00061
00062 QString defaultSyncingMessage() const
00063 {
00064 return i18nc( "@info:status", "Syncing..." );
00065 }
00066
00067 QString defaultErrorMessage() const
00068 {
00069 return i18nc( "@info:status", "Error." );
00070 }
00071
00072 AgentBase *q_ptr;
00073 Q_DECLARE_PUBLIC( AgentBase )
00074
00075 QString mId;
00076 QString mName;
00077
00079 QDBusConnection mDBusConnection;
00080
00081 int mStatusCode;
00082 QString mStatusMessage;
00083
00084 uint mProgress;
00085 QString mProgressMessage;
00086
00087 bool mNeedsNetwork;
00088 bool mOnline;
00089
00090 QSettings *mSettings;
00091
00092 ChangeRecorder *mChangeRecorder;
00093
00094 org::freedesktop::Akonadi::Tracer *mTracer;
00095
00096 AgentBase::Observer *mObserver;
00097
00098 protected Q_SLOTS:
00099 void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
00100 void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
00101 void itemMoved( const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination );
00102 void itemRemoved( const Akonadi::Item &item );
00103 void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00104 void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00105
00106 void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
00107 void collectionChanged( const Akonadi::Collection &collection );
00108 void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &partIdentifiers );
00109 void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination );
00110 void collectionRemoved( const Akonadi::Collection &collection );
00111 void collectionSubscribed( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
00112 void collectionUnsubscribed( const Akonadi::Collection &collection );
00113 };
00114
00115 }
00116
00117 #endif