AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
IMutableListModel.h
1/*
2 * AUI Framework - Declarative UI toolkit for modern C++20
3 * Copyright (C) 2020-2024 Alex2772 and Contributors
4 *
5 * SPDX-License-Identifier: MPL-2.0
6 *
7 * This Source Code Form is subject to the terms of the Mozilla Public
8 * License, v. 2.0. If a copy of the MPL was not distributed with this
9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 */
11
12#pragma once
13
14#include <AUI/Common/ASignal.h>
15#include <AUI/Model/AListModelSelection.h>
16#include "AListModelRange.h"
17
18template<typename T>
19class IRemovableListModel: public virtual IListModel<T>
20{
21public:
22 virtual ~IRemovableListModel() = default;
23 virtual void removeItems(const AListModelRange<T>& items) = 0;
24 virtual void removeItems(const AListModelSelection<T>& items) {
25 for (const auto& r : items.ranges()) {
26 removeItems(r);
27 }
28 }
29 virtual void removeItem(const AListModelIndex& item) = 0;
30
31};
32
33
34template<typename T>
35class IValueMutableListModel: public virtual IListModel<T>
36{
37public:
38 virtual ~IValueMutableListModel() = default;
39 virtual void setItem(const AListModelIndex& index, const T& value) = 0;
40
41};
Definition AListModelIndex.h:20
Definition AListModelRange.h:23
Definition AListModelSelection.h:28
Definition IListModel.h:23
Definition IMutableListModel.h:20
Definition IMutableListModel.h:36