~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/migration/kres/kresmigratorbase.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Alessandro Ghersi, Harald Sitter
  • Date: 2009-06-27 04:40:05 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627044005-4y2vm9xz7rvmzi4p
Tags: 4:4.2.95svn20090701-0ubuntu1
[ Alessandro Ghersi ]
* New upstream release
  - Bump build-deps
* Remove akonadi-kde and libmaildir4 packages
  - remove akonadi-kde.install and libmaildir4.install
  - remove libmaildir4 from debian/rules
  - remove akonadi-kde and libmaildir4 from depends
  - remove akonadi-kde and libmaildir4 from installgen
* Update kdepim-dev.install
* Update kpilot.install
* Add akonadi-kde and libmaildir4 transitional packages

[ Harald Sitter ]
* KAddressbook replaces Kontact << 4.2.85 (LP: #378373)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008 Volker Krause <vkrause@kde.org>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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
 
17
    02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef KRESMIGRATORBASE_H
 
21
#define KRESMIGRATORBASE_H
 
22
 
 
23
#include <akonadi/agentinstance.h>
 
24
 
 
25
#include <KConfigGroup>
 
26
 
 
27
#include <QObject>
 
28
 
 
29
namespace KRES {
 
30
  class Resource;
 
31
}
 
32
 
 
33
class KJob;
 
34
 
 
35
/**
 
36
 * Non-template QObject part of KResMigrator.
 
37
 */
 
38
class KResMigratorBase : public QObject
 
39
{
 
40
  Q_OBJECT
 
41
  public:
 
42
    enum MigrationState
 
43
    {
 
44
      None,
 
45
      Bridged,
 
46
      Complete
 
47
    };
 
48
 
 
49
    enum MessageType
 
50
    {
 
51
      Success,
 
52
      Skip,
 
53
      Info,
 
54
      Error
 
55
    };
 
56
 
 
57
    Q_ENUMS( MigrationState )
 
58
 
 
59
    KResMigratorBase( const QString &type, const QString &bridgeType );
 
60
    ~KResMigratorBase();
 
61
 
 
62
    MigrationState migrationState( KRES::Resource *res ) const;
 
63
 
 
64
    virtual void migrateNext() = 0;
 
65
    void migrateToBridge( KRES::Resource* res, const QString &typeId );
 
66
    virtual void migratedToBridge(const Akonadi::AgentInstance & instance) = 0;
 
67
 
 
68
    virtual KConfigGroup kresConfig( KRES::Resource* res ) const = 0;
 
69
 
 
70
    void setBridgingOnly( bool b );
 
71
    void setOmitClientBridge( bool b );
 
72
 
 
73
    void migrationFailed( const QString &errorMsg, const Akonadi::AgentInstance &instance = Akonadi::AgentInstance() );
 
74
 
 
75
  signals:
 
76
    void message( KResMigratorBase::MessageType type, const QString &msg );
 
77
 
 
78
  protected:
 
79
    void createAgentInstance( const QString &typeId, QObject *reciver, const char* slot );
 
80
 
 
81
  protected slots:
 
82
    virtual void migrate() = 0;
 
83
 
 
84
  protected:
 
85
    QString mType;
 
86
    QString mBridgeType;
 
87
    QStringList mPendingBridgedResources;
 
88
    bool mBridgeOnly;
 
89
    bool mOmitClientBridge;
 
90
    KRES::Resource *mCurrentKResource;
 
91
    bool mBridgingInProgress;
 
92
 
 
93
    void setMigrationState( KRES::Resource *res, MigrationState state, const QString &resId );
 
94
 
 
95
  private slots:
 
96
    void resourceBridgeCreated( KJob *job );
 
97
};
 
98
 
 
99
#endif