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

akonadi/contact

  • sources
  • kde-4.14
  • kdepimlibs
  • akonadi
  • contact
recentcontactscollections.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 "recentcontactscollections_p.h"
23 
24 #include "recentcontactscollectionssettings.h"
25 
26 #include <KGlobal>
27 
28 #include "akonadi/agentinstance.h"
29 #include "akonadi/servermanager.h"
30 
31 using namespace Akonadi;
32 
33 class Akonadi::RecentContactsCollectionsPrivate
34 {
35  public:
36  RecentContactsCollectionsPrivate();
37  ~RecentContactsCollectionsPrivate();
38 
39  RecentContactsCollections *mInstance;
40 };
41 
42 typedef RecentContactsCollectionsSettings Settings;
43 
44 K_GLOBAL_STATIC( RecentContactsCollectionsPrivate, sInstance )
45 
46 static const QByteArray sRecentContactsType = "recent-contacts";
47 
48 RecentContactsCollectionsPrivate::RecentContactsCollectionsPrivate()
49  : mInstance( new RecentContactsCollections( this ) )
50 {
51 }
52 
53 RecentContactsCollectionsPrivate::~RecentContactsCollectionsPrivate()
54 {
55  delete mInstance;
56 }
57 
58 static KCoreConfigSkeleton *getConfig( const QString &filename)
59 {
60  Settings::instance( ServerManager::addNamespace( filename ) );
61  return Settings::self();
62 }
63 
64 RecentContactsCollections::RecentContactsCollections( RecentContactsCollectionsPrivate *dd )
65  : SpecialCollections( getConfig(QLatin1String("recentcontactscollectionsrc")) ),
66  d( dd )
67 {
68  Q_UNUSED(d); // d isn't used yet
69 }
70 
71 RecentContactsCollections *RecentContactsCollections::self()
72 {
73  return sInstance->mInstance;
74 }
75 
76 bool RecentContactsCollections::hasCollection( const AgentInstance &instance ) const
77 {
78  return SpecialCollections::hasCollection( sRecentContactsType, instance );
79 }
80 
81 Collection RecentContactsCollections::collection( const AgentInstance &instance ) const
82 {
83  return SpecialCollections::collection( sRecentContactsType, instance );
84 }
85 
86 bool RecentContactsCollections::registerCollection( const Collection &collection )
87 {
88  return SpecialCollections::registerCollection( sRecentContactsType, collection );
89 }
90 
91 bool RecentContactsCollections::hasDefaultCollection() const
92 {
93  return SpecialCollections::hasDefaultCollection( sRecentContactsType );
94 }
95 
96 Collection RecentContactsCollections::defaultCollection() const
97 {
98  return SpecialCollections::defaultCollection( sRecentContactsType );
99 }
100 
101 #include "moc_recentcontactscollections_p.cpp"
Akonadi::RecentContactsCollections::collection
Akonadi::Collection collection(const AgentInstance &instance) const
Returns the recent contacts collection in the given agent instance, or an invalid collection if such ...
Definition: recentcontactscollections.cpp:81
Akonadi::RecentContactsCollections
Definition: recentcontactscollections_p.h:39
Akonadi::RecentContactsCollections::registerCollection
bool registerCollection(const Akonadi::Collection &collection)
Registers the given collection as a recent contacts collection.
Definition: recentcontactscollections.cpp:86
QByteArray
Akonadi::RecentContactsCollections::hasCollection
bool hasCollection(const AgentInstance &instance) const
Returns whether the given agent instance has a recent contacts collection.
Definition: recentcontactscollections.cpp:76
Akonadi::RecentContactsCollections::hasDefaultCollection
bool hasDefaultCollection() const
Returns whether the default resource has a recent contacts collection.
Definition: recentcontactscollections.cpp:91
Akonadi::RecentContactsCollections::self
static RecentContactsCollections * self()
Returns the global RecentContactsCollections instance.
Definition: recentcontactscollections.cpp:71
QString
Akonadi::RecentContactsCollections::defaultCollection
Akonadi::Collection defaultCollection() const
Returns the recent contacts collection in the default resource, or an invalid collection if such a co...
Definition: recentcontactscollections.cpp:96
QLatin1String
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi/contact

Skip menu "akonadi/contact"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

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