Searcher.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2005-2007 by Peter Dimov.
00004 
00005 This file is part of Calitko (http://www.calitko.org).
00006 
00007 Calitko is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 Calitko is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Calitko; if not, write to the Free Software
00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021 */
00022 
00023 #ifndef GNUTELLA__SEARCHING__SEARCHER_H
00024 #define GNUTELLA__SEARCHING__SEARCHER_H
00025 
00026 #include "Gnutella/Namespace.h"
00027 #include "Gnutella/Packets/Namespace.h"
00028 FORWARD_DECLARE3 (Gnutella, Packets, VendorMessages, class QueryStatusRequest)
00029 #include "UIs/Searching/Namespace.h"
00030 
00031 // Open containing namespaces:
00032 namespace Gnutella {
00033 namespace Searching {
00035 
00036 using Gnutella::LocalPeer;
00037 using Gnutella::Packets::QueryHits;
00038 using Gnutella::Packets::VendorMessages::QueryStatusRequest;
00039 using UIs::Searching::SearchModel;
00040 
00041 class Searcher  : public QObject
00042 {
00043     Q_OBJECT
00044     REFERENCE_OBJECT (Searcher)
00045 
00046 private:
00047     class SearcherPrivate;
00048 
00049 public:
00050     Searcher(LocalPeer *localPeer);
00051     ~Searcher();
00052 
00053     void startSearch (SearchModel *searchModel, const QString &searchString);
00054     void stopSearch (SearchModel *searchModel);
00055     void stopSearch (const QUuid &descriptoId);
00056 
00057 public slots:
00058     void processQueryHits (const QueryHits &queryHits);
00059     void processQueryStatusRequest (const QueryStatusRequest &request);
00060 
00061 private:
00062     SearcherPrivate *p;
00063 };
00064 
00065 // Close containing namespaces:
00066 } // namespace Searching
00067 } // namespace Gnutella
00069 
00070 #endif // GNUTELLA__SEARCHING__SEARCHER_H