class EE::UI::Models::ModelSelection

#include <modelselection.hpp>

class ModelSelection {
public:
    // construction

    ModelSelection(UIAbstractView* view);

    // methods

    int size() const;
    bool isEmpty() const;
    bool contains(const ModelIndex& index) const;
    bool containsRow(int row) const;
    void set(const ModelIndex&);
    void set(const std::vector<ModelIndex>& indexes, bool notify = true);
    void add(const ModelIndex&);
    void toggle(const ModelIndex&);
    bool remove(const ModelIndex&);
    void clear(bool notify = true);

    template <typename Callback>
    void forEachIndex(Callback callback);

    template <typename Callback>
    void forEachIndex(Callback callback) const;

    std::vector<ModelIndex> indexes() const;
    ModelIndex first() const;
    void removeAllMatching(std::function<bool(ModelIndex const&)> filter);

    template <typename Function>
    void changeFromModel(Function f);
};