agentmanager_p.h

00001 /*
00002     Copyright (c) 2006-2008 Tobias Koenig <tokoe@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef AKONADI_AGENTMANAGER_P_H
00021 #define AKONADI_AGENTMANAGER_P_H
00022 
00023 #include "agentmanagerinterface.h"
00024 
00025 #include "agenttype.h"
00026 #include "agentinstance.h"
00027 
00028 #include <QtCore/QHash>
00029 
00030 namespace Akonadi {
00031 
00032 class AgentManager;
00033 
00037 class AgentManagerPrivate
00038 {
00039   friend class AgentManager;
00040 
00041   public:
00042     AgentManagerPrivate( AgentManager *parent )
00043       : mParent( parent ), mManager( 0 )
00044     {
00045     }
00046 
00047     /*
00048      * Used by AgentInstanceCreateJob
00049      */
00050     AgentInstance createInstance( const AgentType &type );
00051 
00052     void agentTypeAdded( const QString& );
00053     void agentTypeRemoved( const QString& );
00054     void agentInstanceAdded( const QString& );
00055     void agentInstanceRemoved( const QString& );
00056     void agentInstanceStatusChanged( const QString&, int, const QString& );
00057     void agentInstanceProgressChanged( const QString&, uint, const QString& );
00058     void agentInstanceNameChanged( const QString&, const QString& );
00059     void agentInstanceWarning( const QString&, const QString& );
00060     void agentInstanceError( const QString&, const QString& );
00061     void agentInstanceOnlineChanged( const QString&, bool );
00062     void serviceOwnerChanged( const QString&, const QString&, const QString& );
00063 
00071     void readAgentTypes();
00072 
00073     void setName( const AgentInstance&, const QString& );
00074     void setOnline( const AgentInstance&, bool );
00075     void configure( const AgentInstance&, QWidget* );
00076     void synchronize( const AgentInstance& );
00077     void synchronizeCollectionTree( const AgentInstance& );
00078 
00079     AgentType fillAgentType( const QString &identifier ) const;
00080     AgentInstance fillAgentInstance( const QString &identifier ) const;
00081     AgentInstance fillAgentInstanceLight( const QString &identifier ) const;
00082 
00083     void createDBusInterface();
00084 
00085     static AgentManager *mSelf;
00086 
00087     AgentManager *mParent;
00088     org::freedesktop::Akonadi::AgentManager *mManager;
00089 
00090     QHash<QString, AgentType> mTypes;
00091     QHash<QString, AgentInstance> mInstances;
00092 };
00093 
00094 }
00095 
00096 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys