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

« back to all changes in this revision

Viewing changes to akonadi/kresources/kcal/resourceakonadi_p.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
    This file is part of libkcal.
 
3
    Copyright (c) 2009 Kevin Krammer <kevin.krammer@gmx.at>
 
4
 
 
5
    This library is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU Library General Public
 
7
    License as published by the Free Software Foundation; either
 
8
    version 2 of the License, or (at your option) any later version.
 
9
 
 
10
    This library is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
    Library General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU Library General Public License
 
16
    along with this library; see the file COPYING.LIB.  If not, write to
 
17
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
18
    Boston, MA 02110-1301, USA.
 
19
*/
 
20
 
 
21
#ifndef KCAL_RESOURCEAKONADI_P_H
 
22
#define KCAL_RESOURCEAKONADI_P_H
 
23
 
 
24
#include "subresource.h"
 
25
#include "resourceakonadi.h"
 
26
#include "sharedresourceprivate.h"
 
27
 
 
28
#include "kcal/kcalmimetypevisitor.h"
 
29
 
 
30
#include <kcal/assignmentvisitor.h>
 
31
#include <kcal/calendarlocal.h>
 
32
 
 
33
namespace Akonadi {
 
34
  class AgentFilterProxyModel;
 
35
  class AgentInstanceModel;
 
36
}
 
37
 
 
38
namespace KABC {
 
39
  class LockNull;
 
40
}
 
41
 
 
42
class KConfigGroup;
 
43
 
 
44
class KCal::ResourceAkonadi::Private : public SharedResourcePrivate<SubResource>,
 
45
                                       public KCal::Calendar::CalendarObserver
 
46
{
 
47
  Q_OBJECT
 
48
 
 
49
  public:
 
50
    explicit Private( ResourceAkonadi *parent );
 
51
 
 
52
    Private( const KConfigGroup &config, ResourceAkonadi *parent );
 
53
 
 
54
    ~Private();
 
55
 
 
56
    bool doSaveIncidence( Incidence *incidence );
 
57
 
 
58
    QString subResourceIdentifier( const QString &incidenceUid ) const;
 
59
 
 
60
  public:
 
61
    ResourceAkonadi *mParent;
 
62
 
 
63
    CalendarLocal mCalendar;
 
64
 
 
65
    KABC::LockNull *mLock;
 
66
 
 
67
    bool mInternalCalendarModification;
 
68
 
 
69
    AssignmentVisitor mIncidenceAssigner;
 
70
 
 
71
    Akonadi::KCalMimeTypeVisitor mMimeVisitor;
 
72
 
 
73
    Akonadi::AgentInstanceModel *mAgentModel;
 
74
    Akonadi::AgentFilterProxyModel *mAgentFilterModel;
 
75
 
 
76
  protected:
 
77
    bool openResource();
 
78
 
 
79
    bool closeResource();
 
80
 
 
81
    void clearResource();
 
82
 
 
83
    void subResourceAdded( SubResourceBase *subResource );
 
84
 
 
85
    void subResourceRemoved( SubResourceBase *subResource );
 
86
 
 
87
    void loadingResult( bool ok, const QString &errorString );
 
88
 
 
89
    void savingResult( bool ok, const QString &errorString );
 
90
 
 
91
    const SubResourceBase *storeSubResourceFromUser( const QString &uid, const QString &mimeType );
 
92
 
 
93
    Akonadi::Item createItem( const QString &kresId );
 
94
 
 
95
    Akonadi::Item updateItem( const Akonadi::Item &item, const QString &kresId, const QString &originalId );
 
96
 
 
97
    CollectionsByMimeType storeCollectionsFromOldDefault() const;
 
98
 
 
99
    // from the CalendarObserver interface
 
100
    void calendarIncidenceAdded( KCal::Incidence *incidence );
 
101
 
 
102
    void calendarIncidenceChanged( KCal::Incidence *incidence );
 
103
 
 
104
    void calendarIncidenceDeleted( KCal::Incidence *incidence );
 
105
 
 
106
  protected Q_SLOTS:
 
107
    void incidenceAdded( const IncidencePtr &incidencePtr, const QString &subResourceIdentifier );
 
108
 
 
109
    void incidenceChanged( const IncidencePtr &incidencePtr, const QString &subResourceIdentifier );
 
110
 
 
111
    void incidenceRemoved( const QString &uid, const QString &subResourceIdentifier );
 
112
};
 
113
 
 
114
#endif
 
115
 
 
116
// kate: space-indent on; indent-width 2; replace-tabs on;