akonadi
agentbase_p.h
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 #include <solid/networking.h>
00029
00030 class QSettings;
00031
00032 namespace Akonadi {
00033
00037 class AgentBasePrivate : public QObject
00038 {
00039 Q_OBJECT
00040 public:
00041 AgentBasePrivate( AgentBase *parent );
00042 virtual ~AgentBasePrivate();
00043 void init();
00044 virtual void delayedInit();
00045
00046 void slotStatus( int status, const QString &message );
00047 void slotPercent( int progress );
00048 void slotWarning( const QString& message );
00049 void slotError( const QString& message );
00050 void slotNetworkStatusChange( Solid::Networking::Status );
00051
00052 virtual void changeProcessed();
00053
00054 QString defaultReadyMessage() const
00055 {
00056 if ( mOnline )
00057 return i18nc( "@info:status Application ready for work", "Ready" );
00058 return i18nc( "@info:status", "Offline" );
00059 }
00060
00061 QString defaultSyncingMessage() const
00062 {
00063 return i18nc( "@info:status", "Syncing..." );
00064 }
00065
00066 QString defaultErrorMessage() const
00067 {
00068 return i18nc( "@info:status", "Error." );
00069 }
00070
00071 AgentBase *q_ptr;
00072 Q_DECLARE_PUBLIC( AgentBase )
00073
00074 QString mId;
00075 QString mName;
00076
00077 int mStatusCode;
00078 QString mStatusMessage;
00079
00080 uint mProgress;
00081 QString mProgressMessage;
00082
00083 bool mNeedsNetwork;
00084 bool mOnline;
00085
00086 QSettings *mSettings;
00087
00088 ChangeRecorder *mMonitor;
00089
00090 org::freedesktop::Akonadi::Tracer *mTracer;
00091
00092 AgentBase::Observer *mObserver;
00093
00094 protected Q_SLOTS:
00095 void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
00096 void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers );
00097 void itemMoved( const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination );
00098 void itemRemoved( const Akonadi::Item &item );
00099 void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00100 void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection );
00101
00102 void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
00103 void collectionChanged( const Akonadi::Collection &collection );
00104 void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &partIdentifiers );
00105 void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination );
00106 void collectionRemoved( const Akonadi::Collection &collection );
00107 };
00108
00109 }
00110
00111 #endif