File indexing completed on 2024-04-21 15:42:59

0001 /*
0002  * This file is part of TelepathyLoggerQt
0003  *
0004  * Copyright (C) 2011 Stefano Sanfilippo <stefano.k.sanfilippo@gmail.com>
0005  * Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public
0018  * License along with this library; if not, write to the Free Software
0019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
0020  */
0021 #ifndef _TelepathyLoggerQt_pending_dates_h_HEADER_GUARD_
0022 #define _TelepathyLoggerQt_pending_dates_h_HEADER_GUARD_
0023 
0024 #include "pending-operation.h"
0025 #include "types.h"
0026 
0027 #include <TelepathyLoggerQt_export.h>
0028 
0029 namespace Tpl
0030 {
0031 
0032 /**
0033  * \headerfile pending-dates.h <TelepathyLoggerQt/PendingDates>
0034  * \brief An operation for retrieving logged dates.
0035  */
0036 class TELEPATHY_LOGGER_QT_EXPORT PendingDates : public Tpl::PendingOperation
0037 {
0038     Q_OBJECT
0039     Q_DISABLE_COPY(PendingDates);
0040 
0041 public:
0042     /**
0043      * \brief Destructor.
0044      */
0045     ~PendingDates();
0046 
0047     /**
0048      * \brief Returns list of all dates retrieved from the log store.
0049      *
0050      * It's an error to call this method before the finished() signal is emitted.
0051      */
0052     QDateList dates() const;
0053 
0054     /**
0055      * \brief Returns account that has been queried
0056      */
0057     const Tp::AccountPtr account() const;
0058 
0059     /**
0060      * \brief Returns entity that has been queried.
0061      */
0062     const Tpl::EntityPtr entity() const;
0063 
0064 private Q_SLOTS:
0065     virtual void start();
0066 
0067 private:
0068     friend class LogManager;
0069 
0070     PendingDates(const LogManagerPtr & manager, const Tp::AccountPtr & account,
0071                  const EntityPtr & entity, EventTypeMask typeMask);
0072 
0073     struct Private;
0074     friend struct Private;
0075     Private *mPriv;
0076 };
0077 
0078 } // Tpl
0079 
0080 #endif