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

akonadi

agentinstance.cpp

00001 /*
00002     Copyright (c) 2008 Tobias Koenig <tokoe@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 "agentinstance.h"
00021 #include "agentinstance_p.h"
00022 
00023 #include "agentmanager.h"
00024 #include "agentmanager_p.h"
00025 
00026 #include <KDebug>
00027 
00028 using namespace Akonadi;
00029 
00030 AgentInstance::AgentInstance()
00031   : d( new Private )
00032 {
00033 }
00034 
00035 AgentInstance::AgentInstance( const AgentInstance &other )
00036   : d( other.d )
00037 {
00038 }
00039 
00040 AgentInstance::~AgentInstance()
00041 {
00042 }
00043 
00044 bool AgentInstance::isValid() const
00045 {
00046   return !d->mIdentifier.isEmpty();
00047 }
00048 
00049 
00050 AgentType AgentInstance::type() const
00051 {
00052   return d->mType;
00053 }
00054 
00055 QString AgentInstance::identifier() const
00056 {
00057   return d->mIdentifier;
00058 }
00059 
00060 void AgentInstance::setName( const QString &name )
00061 {
00062   AgentManager::self()->d->setName( *this, name );
00063 }
00064 
00065 QString AgentInstance::name() const
00066 {
00067   return d->mName;
00068 }
00069 
00070 AgentInstance::Status AgentInstance::status() const
00071 {
00072   switch ( d->mStatus ) {
00073     case 0:
00074       return Idle;
00075     case 1:
00076       return Running;
00077     case 2:
00078     default:
00079       return Broken;
00080   }
00081 }
00082 
00083 QString AgentInstance::statusMessage() const
00084 {
00085   return d->mStatusMessage;
00086 }
00087 
00088 int AgentInstance::progress() const
00089 {
00090   return d->mProgress;
00091 }
00092 
00093 bool AgentInstance::isOnline() const
00094 {
00095   return d->mIsOnline;
00096 }
00097 
00098 void AgentInstance::setIsOnline( bool online )
00099 {
00100   AgentManager::self()->d->setOnline( *this, online );
00101 }
00102 
00103 void AgentInstance::configure( QWidget *parent )
00104 {
00105   AgentManager::self()->d->configure( *this, parent );
00106 }
00107 
00108 void AgentInstance::synchronize()
00109 {
00110   AgentManager::self()->d->synchronize( *this );
00111 }
00112 
00113 void AgentInstance::synchronizeCollectionTree()
00114 {
00115   AgentManager::self()->d->synchronizeCollectionTree( *this );
00116 }
00117 
00118 AgentInstance& AgentInstance::operator=( const AgentInstance &other )
00119 {
00120   if ( this != &other )
00121     d = other.d;
00122 
00123   return *this;
00124 }
00125 
00126 bool AgentInstance::operator==( const AgentInstance &other ) const
00127 {
00128   return (d->mIdentifier == other.d->mIdentifier);
00129 }
00130 
00131 void AgentInstance::reconfigure() const
00132 {
00133   QDBusInterface iface( "org.freedesktop.Akonadi.Agent." + identifier(), "/", "org.freedesktop.Akonadi.Agent.Control" );
00134   if ( iface.isValid() )
00135     iface.call( "reconfigure" );
00136   else
00137     kWarning() << "Unable to obtain agent interface";
00138 }

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
  •   richtextbuilders
  • 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