blob: ffc4c25c0299ed92045586a00d0c17fbd2ad3d73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#pragma once
#include "search/hotels_classifier.hpp"
#include "search/search_params.hpp"
#include "std/function.hpp"
namespace search
{
class Results;
// An on-results-callback that should be used for interactive search.
//
// *NOTE* the class is NOT thread safe.
class ViewportSearchCallback
{
public:
class Delegate
{
public:
virtual ~Delegate() = default;
virtual void RunUITask(function<void()> fn) = 0;
virtual void SetHotelDisplacementMode() = 0;
virtual bool IsViewportSearchActive() const = 0;
virtual void ShowViewportSearchResults(Results const & results) = 0;
virtual void ClearViewportSearchResults() = 0;
};
using TOnResults = SearchParams::TOnResults;
ViewportSearchCallback(Delegate & delegate, TOnResults onResults);
void operator()(Results const & results);
private:
Delegate & m_delegate;
TOnResults m_onResults;
HotelsClassifier m_hotelsClassif;
bool m_hotelsModeSet;
bool m_firstCall;
};
} // namespace search
|