File indexing completed on 2024-04-28 05:02:09

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_events_h_HEADER_GUARD_
0022 #define _TelepathyLoggerQt_pending_events_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-events.h <TelepathyLoggerQt/PendingEvents>
0034  * \brief An operation for retrieving events from the logger storage
0035  */
0036 class TELEPATHY_LOGGER_QT_EXPORT PendingEvents : public Tpl::PendingOperation
0037 {
0038     Q_OBJECT
0039     Q_DISABLE_COPY(PendingEvents);
0040 
0041 public:
0042     /**
0043      * \brief Destructor.
0044      */
0045     ~PendingEvents();
0046 
0047     /**
0048      * \brief Returns all events retrieved by the operation.
0049      *
0050      * It's an error calling this method before the finished() signal is emitted.
0051      */
0052     EventPtrList events() const;
0053 
0054 private Q_SLOTS:
0055     virtual void start();
0056 
0057 private:
0058     friend class LogManager;
0059     friend class LogWalker;
0060 
0061     PendingEvents(const LogManagerPtr & manager, const Tp::AccountPtr & account,
0062             const EntityPtr & entity, EventTypeMask typeMask, const QDate &date);
0063     PendingEvents(const LogManagerPtr & manager, const Tp::AccountPtr & account,
0064             const EntityPtr & entity, EventTypeMask typeMask, uint numEvents,
0065             LogEventFilter filterFunction, void *filterFunctionUserData);
0066     PendingEvents(const LogWalkerPtr & logWalker, uint numEvents);
0067 
0068     struct Private;
0069     friend struct Private;
0070     Private *mPriv;
0071 };
0072 
0073 } // Tpl
0074 
0075 #endif