• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • akonadi
  • contact
recentcontactscollectionrequestjob.cpp
1 /*
2  This file is part of Akonadi Contact.
3 
4  Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
5 
6  This library is free software; you can redistribute it and/or modify it
7  under the terms of the GNU Library General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or (at your
9  option) any later version.
10 
11  This library is distributed in the hope that it will be useful, but WITHOUT
12  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14  License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to the
18  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  02110-1301, USA.
20 */
21 
22 #include "recentcontactscollectionrequestjob.h"
23 
24 #include "recentcontactscollections_p.h"
25 
26 #include <kglobal.h>
27 #include <klocalizedstring.h>
28 #include <kstandarddirs.h>
29 
30 using namespace Akonadi;
31 
32 #ifndef KDE_USE_FINAL
33 static const QByteArray sRecentContactsType = "recent-contacts";
34 #endif
35 
36 RecentContactsCollectionRequestJob::RecentContactsCollectionRequestJob( QObject *parent )
37  : SpecialCollectionsRequestJob( RecentContactsCollections::self(), parent ),
38  d( 0 )
39 {
40  static QMap<QByteArray, QString> displayNameMap;
41  displayNameMap.insert( "recent-contacts", i18nc( "recent contacts folder", "Recent Contacts" ) );
42 
43  static QMap<QByteArray, QString> iconNameMap;
44  iconNameMap.insert( "recent-contacts", QLatin1String( "folder" ) );
45 
46  QVariantMap options;
47  options.insert( QLatin1String( "Name" ), displayNameMap.value( "recent-contacts" ) );
48  options.insert( QLatin1String( "Path" ), QString( KGlobal::dirs()->localxdgdatadir() + QLatin1String( "recent-contacts" ) ) );
49 
50  setDefaultResourceType( QLatin1String( "akonadi_contacts_resource" ) );
51  setDefaultResourceOptions( options );
52 
53  setTypes( displayNameMap.keys() );
54  setNameForTypeMap( displayNameMap );
55  setIconForTypeMap( iconNameMap );
56 }
57 
58 RecentContactsCollectionRequestJob::~RecentContactsCollectionRequestJob()
59 {
60 }
61 
62 void RecentContactsCollectionRequestJob::requestDefaultCollection()
63 {
64  SpecialCollectionsRequestJob::requestDefaultCollection( sRecentContactsType );
65 }
66 
67 void RecentContactsCollectionRequestJob::requestCollection( const AgentInstance &instance )
68 {
69  SpecialCollectionsRequestJob::requestCollection( sRecentContactsType, instance );
70 }
71 
Akonadi::RecentContactsCollections
Definition: recentcontactscollections_p.h:39
Akonadi::SpecialCollectionsRequestJob::setIconForTypeMap
void setIconForTypeMap(const QMap< QByteArray, QString > &map)
Sets the map of special collection types to icon names.
Definition: specialcollectionsrequestjob.cpp:332
Akonadi::RecentContactsCollectionRequestJob::RecentContactsCollectionRequestJob
RecentContactsCollectionRequestJob(QObject *parent=0)
Creates a new recent contacts collection request job.
Definition: recentcontactscollectionrequestjob.cpp:36
Akonadi::RecentContactsCollectionRequestJob::requestCollection
void requestCollection(const AgentInstance &instance)
Requests the recent contacts collection in the given resource instance.
Definition: recentcontactscollectionrequestjob.cpp:67
Akonadi::SpecialCollectionsRequestJob::requestCollection
void requestCollection(const QByteArray &type, const AgentInstance &instance)
Requests a special collection of the given type in the given resource instance.
Definition: specialcollectionsrequestjob.cpp:297
Akonadi::SpecialCollectionsRequestJob::setTypes
void setTypes(const QList< QByteArray > &types)
Sets the list of well known special collection types.
Definition: specialcollectionsrequestjob.cpp:322
Akonadi::RecentContactsCollectionRequestJob::~RecentContactsCollectionRequestJob
~RecentContactsCollectionRequestJob()
Destroys the recent contacts collection request job.
Definition: recentcontactscollectionrequestjob.cpp:58
Akonadi::SpecialCollectionsRequestJob::requestDefaultCollection
void requestDefaultCollection(const QByteArray &type)
Requests a special collection of the given type in the default resource.
Definition: specialcollectionsrequestjob.cpp:290
Akonadi::SpecialCollectionsRequestJob::setDefaultResourceType
void setDefaultResourceType(const QString &type)
Sets the type of the resource that shall be created if the requested special collection does not exis...
Definition: specialcollectionsrequestjob.cpp:312
Akonadi::AgentInstance
A representation of an agent instance.
Definition: agentinstance.h:62
Akonadi::RecentContactsCollectionRequestJob::requestDefaultCollection
void requestDefaultCollection()
Requests the recent contacts collection in the default resource.
Definition: recentcontactscollectionrequestjob.cpp:62
Akonadi::SpecialCollectionsRequestJob::setNameForTypeMap
void setNameForTypeMap(const QMap< QByteArray, QString > &map)
Sets the map of special collection types to display names.
Definition: specialcollectionsrequestjob.cpp:327
Akonadi::SpecialCollectionsRequestJob::setDefaultResourceOptions
void setDefaultResourceOptions(const QVariantMap &options)
Sets the configuration options that shall be applied to the new resource that is created if the reque...
Definition: specialcollectionsrequestjob.cpp:317
Akonadi::SpecialCollectionsRequestJob
A job to request SpecialCollections.
Definition: specialcollectionsrequestjob.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal