1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#ifndef RME_RESULT_WINDOW_H_
19#define RME_RESULT_WINDOW_H_
20
21#include "main.h"
22
23// Forward declarations
24class Position;
25class Map;
26
27// Constant for Next search button ID
28#define SEARCH_RESULT_NEXT_BUTTON 1001
29
30class SearchResultWindow : public wxPanel {
31public:
32 SearchResultWindow(wxWindow* parent);
33 virtual ~SearchResultWindow();
34
35 void Clear();
36 void AddPosition(wxString description, Position pos);
37 void SetIgnoredIds(const wxString& ignored_ids_str, bool enable);
38
39 // Get all found positions for continuation search
40 std::vector<Position> GetFoundPositions() const;
41
42 // Store search parameters for continuation
43 void StoreSearchInfo(uint16_t itemId, bool onSelection = false);
44
45 // Continue the search with the stored parameters
46 void ContinueSearch();
47
48 // Methods for retrieving ignored items info
49 wxString GetIgnoredItemsText() const;
50 bool IsIgnoreListEnabled() const;
51
52 void OnClickResult(wxCommandEvent&);
53 void OnClickExport(wxCommandEvent&);
54 void OnClickClear(wxCommandEvent&);
55 void OnClickNext(wxCommandEvent&);
56
57protected:
58 wxListBox* result_list;
59 std::vector<uint16_t> ignored_ids;
60 std::vector<std::pair<uint16_t, uint16_t>> ignored_ranges;
61 bool use_ignored_ids;
62
63 // Search continuation data
64 uint16_t last_search_itemid;
65 bool last_search_on_selection;
66 bool has_last_search;
67 wxString last_ignored_ids_text;
68 bool last_ignored_ids_enabled;
69
70 DECLARE_EVENT_TABLE()
71};
72
73#endif
74