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"
28class API_AUI_VIEWS AListView :
public AScrollArea,
public AListModelObserver<AString>::IListModelListener {
29 friend class AListItem;
35 bool mAllowMultipleSelection =
false;
37 void handleMousePressed(AListItem* item);
38 void handleMouseDoubleClicked(AListItem* item);
40 void clearSelectionInternal();
69 explicit AListView(
const _<IListModel<AString>>& model);
72 void setModel(
const _<IListModel<AString>>& model);
81 int getContentFullHeight() {
return getLayout()->getMinimumHeight() + 8; }
83 void setAllowMultipleSelection(
bool allowMultipleSelection);
85 [[nodiscard]] AListModelSelection<AString> getSelectionModel()
const {
86 return AListModelSelection<AString>(mSelectionModel, mObserver->getModel());
89 void insertItem(
size_t at,
const AString& value)
override;
90 void updateItem(
size_t at,
const AString& value)
override;
91 void removeItem(
size_t at)
override;
93 void onDataCountChanged()
override;
94 void onDataChanged()
override;
100 void clearSelection();
Definition AListView.cpp:65
Definition AListModelObserver.h:22
Definition AListView.cpp:24
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:79
SelectAction
Selection action for updateSelectionOnItem.
Definition AListView.h:46
@ TOGGLE
Selects or deselects the specified index depending on it's current state.
Definition AListView.h:65
@ UNSET
Deselects the specified index.
Definition AListView.h:60
@ SET
Selects the specified index. In single selection mode, acts like CLEAR_SELECTION_AND_SET.
Definition AListView.h:55
@ CLEAR_SELECTION_AND_SET
Clears old selection and selects the specified index. Used by selectItem.
Definition AListView.h:50
A std::set with AUI extensions.
Definition ASet.h:25
const _unique< ALayout > & getLayout() const noexcept
Get layout manager of the container.
Definition AViewContainerBase.h:140
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
ASignal< Args... > emits
A signal declaration.
Definition ASignal.h:348