/* * This file is part of buteo-syncfw package * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Sateesh Kavuri * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef SYNCRESULTS_H_2 #define SYNCRESULTS_H_2 #include #include #include #include #include #include "TargetResults.h" class QDomDocument; class QDomElement; namespace Buteo { struct DatabaseResults { int iLocalItemsAdded; /*! targetResults() const; /*! \brief Adds target results to this object. * * \param aResults The target results to add. */ void addTargetResults(const TargetResults &aResults); /*! \brief Gets the sync time. * * \return Sync time. */ QDateTime syncTime() const; /*! \brief Gets the result code. * * \return major code. */ MajorCode majorCode() const; /*! \brief Sets the result code. * * \param aMajorCode The result code. */ void setMajorCode(MajorCode aMajorCode); /*! \brief Gets the failed reason. * * \return failed Reason. */ MinorCode minorCode() const; /*! \brief Sets the failed Reason. * * \param aMinorCode - minor code or the reason */ void setMinorCode(MinorCode aMinorCode); /*! \brief Sets the remote target Id. * * \param aTargetId The remote device Id. */ void setTargetId(const QString &aTargetId); /*! \brief Gets the remote target Id. */ QString getTargetId() const; /*! \brief Compares two results objects by sync time. * * The object with earlier sync time is smaller. * \param aOther Point of comparison. */ bool operator<(const SyncResults &aOther) const; /*! \brief Sets if the results are from a scheduled sync. * * \param aScheduled True if this is a scheduled sync. */ void setScheduled(bool aScheduled); /*! \brief Checks if the results are from a scheduled sync. * * \return True if scheduled. */ bool isScheduled() const; private: QVariantList variantTargetResults() const; QSharedPointer d_ptr; #ifdef SYNCFW_UNIT_TESTS friend class ClientThreadTest; #endif }; } Q_DECLARE_METATYPE(Buteo::SyncResults) #endif // SYNCRESULTS_H_2