akonadi
conflicthandler_p.h
00001 /* 00002 Copyright (c) 2010 KDAB 00003 Author: Tobias Koenig <tokoe@kde.org> 00004 00005 This library is free software; you can redistribute it and/or modify it 00006 under the terms of the GNU Library General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or (at your 00008 option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, but WITHOUT 00011 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to the 00017 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 02110-1301, USA. 00019 */ 00020 00021 #ifndef AKONADI_CONFLICTHANDLER_P_H 00022 #define AKONADI_CONFLICTHANDLER_P_H 00023 00024 #include <QtCore/QObject> 00025 00026 #include <akonadi/item.h> 00027 00028 class KJob; 00029 00030 namespace Akonadi { 00031 00032 class Session; 00033 00039 class ConflictHandler : public QObject 00040 { 00041 Q_OBJECT 00042 00043 public: 00048 enum ConflictType 00049 { 00050 LocalLocalConflict, 00051 LocalRemoteConflict, 00052 BackendConflict 00053 }; 00054 00058 enum ResolveStrategy 00059 { 00060 UseLocalItem, 00061 UseOtherItem, 00062 UseBothItems 00063 }; 00064 00071 explicit ConflictHandler( ConflictType type, QObject *parent = 0 ); 00072 00080 void setConflictingItems( const Akonadi::Item &changedItem, const Akonadi::Item &conflictingItem ); 00081 00082 public Q_SLOTS: 00086 void start(); 00087 00088 Q_SIGNALS: 00093 void conflictResolved(); 00094 00101 void error( const QString &message ); 00102 00103 private Q_SLOTS: 00104 void slotOtherItemFetched( KJob* ); 00105 void slotUseLocalItemFinished( KJob* ); 00106 void slotUseBothItemsFinished( KJob* ); 00107 void resolve(); 00108 00109 private: 00110 void useLocalItem(); 00111 void useOtherItem(); 00112 void useBothItems(); 00113 00114 ConflictType mConflictType; 00115 Akonadi::Item mChangedItem; 00116 Akonadi::Item mConflictingItem; 00117 00118 Session *mSession; 00119 }; 00120 00121 } 00122 00123 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:18 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:18 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.