summaryrefslogtreecommitdiff
path: root/LibGUI/GModelIndex.h
blob: a60b3c5efc82e9a5a0d2291192826bc020d88f41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once

class GModelIndex {
public:
    GModelIndex() { }
    GModelIndex(int row, int column)
        : m_row(row)
        , m_column(column)
    {
    }

    bool is_valid() const { return m_row != -1 && m_column != -1; }
    int row() const { return m_row; }
    int column() const { return m_column; }

    bool operator==(const GModelIndex& other) const { return m_row == other.m_row && m_column == other.m_column; }

private:
    int m_row { -1 };
    int m_column { -1 };
};