• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

monitor.cpp

00001 /*
00002     Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #include "monitor.h"
00021 #include "monitor_p.h"
00022 
00023 #include "itemfetchjob.h"
00024 #include "notificationmessage_p.h"
00025 #include "session.h"
00026 
00027 #include <kdebug.h>
00028 
00029 #include <QtDBus/QDBusInterface>
00030 #include <QtDBus/QDBusConnection>
00031 
00032 #include <QtCore/QDebug>
00033 #include <QtCore/QTimer>
00034 
00035 using namespace Akonadi;
00036 
00037 #define d d_ptr
00038 
00039 Monitor::Monitor( QObject *parent ) :
00040     QObject( parent ),
00041     d_ptr( new MonitorPrivate( this ) )
00042 {
00043   d_ptr->connectToNotificationManager();
00044 }
00045 
00046 //@cond PRIVATE
00047 Monitor::Monitor(MonitorPrivate * d, QObject *parent) :
00048     QObject( parent ),
00049     d_ptr( d )
00050 {
00051 }
00052 //@endcond
00053 
00054 Monitor::~Monitor()
00055 {
00056   delete d;
00057 }
00058 
00059 void Monitor::setCollectionMonitored( const Collection &collection, bool monitored )
00060 {
00061   if ( monitored )
00062     d->collections << collection;
00063   else
00064     d->collections.removeAll( collection );
00065 }
00066 
00067 void Monitor::setItemMonitored( const Item & item, bool monitored )
00068 {
00069   if ( monitored )
00070     d->items.insert( item.id() );
00071   else
00072     d->items.remove( item.id() );
00073 }
00074 
00075 void Monitor::setResourceMonitored( const QByteArray & resource, bool monitored )
00076 {
00077   if ( monitored )
00078     d->resources.insert( resource );
00079   else
00080     d->resources.remove( resource );
00081 }
00082 
00083 void Monitor::setMimeTypeMonitored( const QString & mimetype, bool monitored )
00084 {
00085   if ( monitored )
00086     d->mimetypes.insert( mimetype );
00087   else
00088     d->mimetypes.remove( mimetype );
00089 }
00090 
00091 void Akonadi::Monitor::setAllMonitored( bool monitored )
00092 {
00093   d->monitorAll = monitored;
00094 }
00095 
00096 void Monitor::ignoreSession(Session * session)
00097 {
00098   d->sessions << session->sessionId();
00099 }
00100 
00101 void Monitor::fetchCollection(bool enable)
00102 {
00103   d->fetchCollection = enable;
00104 }
00105 
00106 void Monitor::fetchCollectionStatistics(bool enable)
00107 {
00108   d->fetchCollectionStatistics = enable;
00109 }
00110 
00111 void Monitor::setItemFetchScope( const ItemFetchScope &fetchScope )
00112 {
00113   d->mItemFetchScope = fetchScope;
00114 }
00115 
00116 ItemFetchScope &Monitor::itemFetchScope()
00117 {
00118   return d->mItemFetchScope;
00119 }
00120 
00121 #undef d
00122 
00123 #include "monitor.moc"

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal