• Skip to content
  • Skip to link menu
KDE 4.3 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   emit collectionMonitored( collection, monitored );
00067 }
00068 
00069 void Monitor::setItemMonitored( const Item & item, bool monitored )
00070 {
00071   if ( monitored )
00072     d->items.insert( item.id() );
00073   else
00074     d->items.remove( item.id() );
00075 
00076   emit itemMonitored( item,  monitored );
00077 }
00078 
00079 void Monitor::setResourceMonitored( const QByteArray & resource, bool monitored )
00080 {
00081   if ( monitored )
00082     d->resources.insert( resource );
00083   else
00084     d->resources.remove( resource );
00085 
00086   emit resourceMonitored( resource, monitored );
00087 }
00088 
00089 void Monitor::setMimeTypeMonitored( const QString & mimetype, bool monitored )
00090 {
00091   if ( monitored )
00092     d->mimetypes.insert( mimetype );
00093   else
00094     d->mimetypes.remove( mimetype );
00095 
00096   emit mimeTypeMonitored( mimetype, monitored );
00097 }
00098 
00099 void Akonadi::Monitor::setAllMonitored( bool monitored )
00100 {
00101   d->monitorAll = monitored;
00102 
00103   emit allMonitored( monitored );
00104 }
00105 
00106 void Monitor::ignoreSession(Session * session)
00107 {
00108   d->sessions << session->sessionId();
00109 }
00110 
00111 void Monitor::fetchCollection(bool enable)
00112 {
00113   d->fetchCollection = enable;
00114 }
00115 
00116 void Monitor::fetchCollectionStatistics(bool enable)
00117 {
00118   d->fetchCollectionStatistics = enable;
00119 }
00120 
00121 void Monitor::setItemFetchScope( const ItemFetchScope &fetchScope )
00122 {
00123   d->mItemFetchScope = fetchScope;
00124 }
00125 
00126 ItemFetchScope &Monitor::itemFetchScope()
00127 {
00128   return d->mItemFetchScope;
00129 }
00130 
00131 Collection::List Monitor::collectionsMonitored() const
00132 {
00133   return d->collections;
00134 }
00135 
00136 QList<Item::Id> Monitor::itemsMonitored() const
00137 {
00138   return d->items.toList();
00139 }
00140 
00141 QStringList Monitor::mimeTypesMonitored() const
00142 {
00143   return d->mimetypes.toList();
00144 }
00145 
00146 QList<QByteArray> Monitor::resourcesMonitored() const
00147 {
00148   return d->resources.toList();
00149 }
00150 
00151 bool Monitor::isAllMonitored() const
00152 {
00153   return d->monitorAll;
00154 }
00155 
00156 #undef d
00157 
00158 #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
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.8
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