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

« back to all changes in this revision

Viewing changes to akonadi/resources/openchange/ocresource.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) 2007 Brad Hards <bradh@frogmouth.net>
 
3
 
 
4
    Significant amounts of this code adapted from the openchange client utility,
 
5
    which is Copyright (C) Julien Kerihuel 2007 <j.kerihuel@openchange.org>.
 
6
 
 
7
    This program is free software; you can redistribute it and/or modify it
 
8
    under the terms of the GNU General Public License as published by
 
9
    the Free Software Foundation; either version 2 of the License, or (at your
 
10
    option) any later version.
 
11
 
 
12
    This program is distributed in the hope that it will be useful, but WITHOUT
 
13
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
14
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
 
15
    License for more details.
 
16
 
 
17
    You should have received a copy of the GNU General Public License
 
18
    along with this program; if not, write to the Free Software
 
19
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
20
    02110-1301, USA.
 
21
*/
 
22
 
 
23
#ifndef OCRESOURCE_H
 
24
#define OCRESOURCE_H
 
25
 
 
26
#include <akonadi/resourcebase.h>
 
27
 
 
28
#include <libmapi++/libmapi++.h>
 
29
 
 
30
class OCResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
 
31
{
 
32
    Q_OBJECT
 
33
 
 
34
public:
 
35
    OCResource( const QString &id );
 
36
    ~OCResource();
 
37
 
 
38
public Q_SLOTS:
 
39
    virtual void configure( WId windowId );
 
40
 
 
41
protected Q_SLOTS:
 
42
    void retrieveCollections();
 
43
    void retrieveItems( const Akonadi::Collection &col );
 
44
    bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
 
45
 
 
46
protected:
 
47
    virtual void aboutToQuit();
 
48
 
 
49
    virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
 
50
    virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &parts );
 
51
    virtual void itemRemoved( const Akonadi::Item &item );
 
52
 
 
53
private:
 
54
    void login();
 
55
    void appendMessageToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
 
56
    void appendContactToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
 
57
    void appendJournalToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
 
58
    void appendEventToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
 
59
    void appendTodoToItem( libmapipp::message & mapi_message, Akonadi::Item & item );
 
60
    QString resolveMapiName(const char* username);
 
61
 
 
62
    QString mimeTypeForFolderType( const char *folderTypeValue ) const;
 
63
 
 
64
    // this method may recurse into itself.
 
65
    void getChildFolders( libmapipp::folder& parentFolder,
 
66
                          const Akonadi::Collection &parentCollection,
 
67
                          Akonadi::Collection::List &collections);
 
68
 
 
69
    libmapipp::session m_session;
 
70
    QString m_profileDatabase; // TODO: maybe this should be a constructor arg?
 
71
 
 
72
    friend class ProfileDialog;
 
73
};
 
74
 
 
75
#endif