FifeGUI 0.2.0
A C++ GUI library designed for games.
listmodel.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#ifndef INCLUDE_FIFECHAN_LISTMODEL_HPP_
6#define INCLUDE_FIFECHAN_LISTMODEL_HPP_
7
8#include <string>
9
10#include "fifechan/platform.hpp"
11
12namespace fcn
13{
23 class FIFEGUI_API ListModel
24 {
25
26 public:
27 virtual ~ListModel() = default;
28
29 ListModel(ListModel const &) = default;
30 ListModel& operator=(ListModel const &) = default;
31 ListModel(ListModel&&) = default;
32 ListModel& operator=(ListModel&&) = default;
33
39 virtual int getNumberOfElements() = 0;
40
47 virtual std::string getElementAt(int i) = 0;
48
49 protected:
50 ListModel() = default;
51 };
52} // namespace fcn
53
54#endif // INCLUDE_FIFECHAN_LISTMODEL_HPP_
virtual int getNumberOfElements()=0
Gets the number of elements in the list.
virtual std::string getElementAt(int i)=0
Gets an element at a certain index in the list.