~mzanetti/+junk/swp-scope-with-aggregator-keyword

« back to all changes in this revision

Viewing changes to src/query.h

  • Committer: Michael Zanetti
  • Date: 2015-05-11 09:12:07 UTC
  • Revision ID: michael.zanetti@canonical.com-20150511091207-nx5edv19k7565cv6
simplify it a lot

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SCOPE_QUERY_H_
 
2
#define SCOPE_QUERY_H_
 
3
 
 
4
#include "client.h"
 
5
 
 
6
#include <unity/scopes/SearchQueryBase.h>
 
7
#include <unity/scopes/ReplyProxyFwd.h>
 
8
 
 
9
using namespace unity::scopes;
 
10
 
 
11
/**
 
12
 * Represents an individual query.
 
13
 *
 
14
 * A new Query object will be constructed for each query. It is
 
15
 * given query information, metadata about the search, and
 
16
 * some scope-specific configuration.
 
17
 */
 
18
class Query: public SearchQueryBase {
 
19
public:
 
20
    Query(const CannedQuery &query, const SearchMetadata &metadata);
 
21
 
 
22
    ~Query() = default;
 
23
 
 
24
    void cancelled() override;
 
25
 
 
26
    void run(const SearchReplyProxy &reply) override;
 
27
 
 
28
private:
 
29
    void fetchQuery(const SearchReplyProxy &reply, const CannedQuery &query);
 
30
    bool pushResult(const SearchReplyProxy &reply, Category::SCPtr category, const Client::NewsItem &news);
 
31
 
 
32
    Client m_client;
 
33
};
 
34
 
 
35
#endif // SCOPE_QUERY_H_
 
36
 
 
37