aboutsummaryrefslogtreecommitdiff
path: root/src/base_tab/GameListManager.hpp
blob: c1452cb039dccd6f5da711674bfe2e86cb130787 (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
#pragma once

#include "ochess.hpp"

#define TERMS_IN(COL) (row.COL.find(terms) != std::string::npos)

typedef std::string CType;

typedef struct Item {
    CType White;
    CType Black;
    CType Event;
    CType Round;
    CType Result;
    CType Eco;
} RType;

class GameListManager {
    wxListCtrl *game_list;
    long game_counter;
    std::vector<RType> rows;

    void DisplayRow(long id);
    void ClearDisplayedRow();
public:
    GameListManager(wxListCtrl *game_list);
    void AddGame(CType White,CType Black,CType Event,CType Round, CType Result, CType Eco);
    void Clear();
    void MarkItemAsOpen(long item);
    void MarkItemAsDeleted(long item);
    std::vector<long> GetSelectedItems();
    long GetItemGameId(long item);
    void Filter(std::string terms);
    void ClearFilter();
};