File indexing completed on 2024-04-14 15:05:40

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