akonadi
itemmovejob.cpp
00001 /* 00002 Copyright (c) 2008 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 "itemmovejob.h" 00021 00022 #include "collection.h" 00023 #include "item.h" 00024 #include "job_p.h" 00025 #include "protocolhelper_p.h" 00026 #include <akonadi/private/imapparser_p.h> 00027 #include "movejobimpl_p.h" 00028 00029 using namespace Akonadi; 00030 00031 class Akonadi::ItemMoveJobPrivate: public MoveJobImpl<Item, ItemMoveJob> 00032 { 00033 public: 00034 ItemMoveJobPrivate( ItemMoveJob *parent ) : MoveJobImpl<Item, ItemMoveJob>( parent ) {} 00035 Q_DECLARE_PUBLIC( ItemMoveJob ) 00036 }; 00037 00038 ItemMoveJob::ItemMoveJob(const Item &item, const Collection &destination, QObject *parent) : 00039 Job( new ItemMoveJobPrivate( this ), parent ) 00040 { 00041 Q_D( ItemMoveJob ); 00042 d->destination = destination; 00043 d->objectsToMove.append( item ); 00044 } 00045 00046 ItemMoveJob::ItemMoveJob( const Item::List &items, const Collection &destination, QObject* parent) : 00047 Job( new ItemMoveJobPrivate( this ), parent ) 00048 { 00049 Q_D( ItemMoveJob ); 00050 d->destination = destination; 00051 d->objectsToMove = items; 00052 } 00053 00054 ItemMoveJob::~ItemMoveJob() 00055 { 00056 } 00057 00058 void ItemMoveJob::doStart() 00059 { 00060 Q_D( ItemMoveJob ); 00061 d->sendCommand( "MOVE" ); 00062 } 00063 00064 Collection ItemMoveJob::destinationCollection() const 00065 { 00066 Q_D( const ItemMoveJob ); 00067 return d->destination; 00068 } 00069 00070 QList<Item> ItemMoveJob::items() const 00071 { 00072 Q_D( const ItemMoveJob ); 00073 return d->objectsToMove; 00074 } 00075 00076 #include "itemmovejob.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:09:23 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:09:23 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.