14#include <AUI/Model/AListModelIndex.h>
15#include <AUI/Model/AListModelObserver.h>
16#include <AUI/Model/AListModelSelection.h>
17#include <AUI/Model/IListModel.h>
19#include "AScrollArea.h"
22class AListViewContainer;
28class API_AUI_VIEWS AListView :
public AScrollArea,
public AListModelObserver<AString>::IListModelListener {
29 friend class AListItem;
58 explicit AListView(_<IListModel<AString>> model);
61 void setModel(_<IListModel<AString>> model);
70 int getContentFullHeight() {
return getLayout()->getMinimumHeight() + 8; }
72 void setAllowMultipleSelection(
bool allowMultipleSelection);
74 [[nodiscard]] AListModelSelection<AString> getSelectionModel()
const {
75 return AListModelSelection<AString>(mSelectionModel, mObserver->getModel());
78 void insertItem(
size_t at,
const AString& value)
override;
79 void updateItem(
size_t at,
const AString& value)
override;
80 void removeItem(
size_t at)
override;
82 void onDataCountChanged()
override;
83 void onDataChanged()
override;
89 void clearSelection();
92 _<AListViewContainer> mContent;
93 ASet<AListModelIndex> mSelectionModel;
94 _<AListModelObserver<AString>> mObserver;
95 bool mAllowMultipleSelection =
false;
97 void handleMousePressed(AListItem* item);
98 void handleMouseDoubleClicked(AListItem* item);
100 void clearSelectionInternal();
Definition AListModelObserver.h:22
Displays a list model of strings.
Definition AListView.h:28
void selectItem(size_t i)
Acts on the item at index i as if the user were left-clicked without keyboard modifiers on it.
Definition AListView.h:68
SelectAction
Selection action for updateSelectionOnItem.
Definition AListView.h:35
@ TOGGLE
Selects or deselects the specified index depending on it's current state.
Definition AListView.h:54
@ UNSET
Deselects the specified index.
Definition AListView.h:49
@ SET
Selects the specified index. In single selection mode, acts like CLEAR_SELECTION_AND_SET.
Definition AListView.h:44
@ CLEAR_SELECTION_AND_SET
Clears old selection and selects the specified index. Used by selectItem.
Definition AListView.h:39
const _unique< ALayout > & getLayout() const noexcept
Get layout manager of the container.
Definition AViewContainerBase.h:140
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:572