2
Copyright (c) 2008 Volker Krause <vkrause@kde.org>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#ifndef KRESMIGRATORBASE_H
21
#define KRESMIGRATORBASE_H
23
#include <akonadi/agentinstance.h>
25
#include <KConfigGroup>
36
* Non-template QObject part of KResMigrator.
38
class KResMigratorBase : public QObject
57
Q_ENUMS( MigrationState )
59
KResMigratorBase( const QString &type, const QString &bridgeType );
62
MigrationState migrationState( KRES::Resource *res ) const;
64
virtual void migrateNext() = 0;
65
void migrateToBridge( KRES::Resource* res, const QString &typeId );
66
virtual void migratedToBridge(const Akonadi::AgentInstance & instance) = 0;
68
virtual KConfigGroup kresConfig( KRES::Resource* res ) const = 0;
70
void setBridgingOnly( bool b );
71
void setOmitClientBridge( bool b );
73
void migrationFailed( const QString &errorMsg, const Akonadi::AgentInstance &instance = Akonadi::AgentInstance() );
76
void message( KResMigratorBase::MessageType type, const QString &msg );
79
void createAgentInstance( const QString &typeId, QObject *reciver, const char* slot );
82
virtual void migrate() = 0;
87
QStringList mPendingBridgedResources;
89
bool mOmitClientBridge;
90
KRES::Resource *mCurrentKResource;
91
bool mBridgingInProgress;
93
void setMigrationState( KRES::Resource *res, MigrationState state, const QString &resId );
96
void resourceBridgeCreated( KJob *job );