~ubuntu-branches/ubuntu/lucid/kdepim-runtime/lucid

« back to all changes in this revision

Viewing changes to resources/contacts/contactsresource.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2009-12-03 15:38:40 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20091203153840-x5fxfsfby0czyqu6
Tags: 4:4.3.80-0ubuntu1
* New upstream beta release:
  - Refresh all patches
  - Bump build-depend versions
  - Remove build-depend on libknotificationitem-dev, it's part of
    kdelibs5-dev now
  - Add build-depend on shared-desktop-ontologies for nepomuk support
  - Add build-depend on libstreamanalyzer-dev for strigi support
  - Add build-depend on libx11-dev to prevent FTBFS
  - Update various .install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2009 Tobias Koenig <tokoe@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 CONTACTSRESOURCE_H
 
21
#define CONTACTSRESOURCE_H
 
22
 
 
23
#include <akonadi/resourcebase.h>
 
24
 
 
25
#include <kabc/addressee.h>
 
26
#include <kabc/contactgroup.h>
 
27
#include <kabc/contactgrouptool.h>
 
28
#include <kabc/vcardconverter.h>
 
29
 
 
30
class QDir;
 
31
 
 
32
class ContactsResource : public Akonadi::ResourceBase, public Akonadi::AgentBase::Observer
 
33
{
 
34
  Q_OBJECT
 
35
 
 
36
  public:
 
37
    ContactsResource( const QString &id );
 
38
    ~ContactsResource();
 
39
 
 
40
  public Q_SLOTS:
 
41
    virtual void configure( WId windowId );
 
42
    virtual void aboutToQuit();
 
43
 
 
44
  protected Q_SLOTS:
 
45
    void retrieveCollections();
 
46
    void retrieveItems( const Akonadi::Collection &collection );
 
47
    bool retrieveItem( const Akonadi::Item &item, const QSet<QByteArray> &parts );
 
48
 
 
49
  protected:
 
50
    virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection );
 
51
    virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &parts );
 
52
    virtual void itemRemoved( const Akonadi::Item &item );
 
53
 
 
54
    virtual void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent );
 
55
    virtual void collectionChanged( const Akonadi::Collection &collection );
 
56
    virtual void collectionRemoved( const Akonadi::Collection &collection );
 
57
 
 
58
  private:
 
59
    Akonadi::Collection::List createCollectionsForDirectory( const QDir &parentDirectory,
 
60
                                                             const Akonadi::Collection &parentCollection ) const;
 
61
    QString baseDirectoryPath() const;
 
62
    void initializeDirectory( const QString &path ) const;
 
63
    Akonadi::Collection::Rights supportedRights() const;
 
64
    QString directoryForCollection( const Akonadi::Collection& collection ) const;
 
65
 
 
66
  private:
 
67
    QStringList mSupportedMimeTypes;
 
68
};
 
69
 
 
70
#endif